diff --git a/jdcloud_cli/client_factory.py b/jdcloud_cli/client_factory.py index 99c48f8..c8d6e97 100644 --- a/jdcloud_cli/client_factory.py +++ b/jdcloud_cli/client_factory.py @@ -18,66 +18,66 @@ from jdcloud_sdk.core.config import Config from jdcloud_sdk.core.credential import Credential -from jdcloud_sdk.services.rds.client.RdsClient import RdsClient -from jdcloud_sdk.services.kubernetes.client.KubernetesClient import KubernetesClient from jdcloud_sdk.services.vqd.client.VqdClient import VqdClient from jdcloud_sdk.services.streamcomputer.client.StreamcomputerClient import StreamcomputerClient -from jdcloud_sdk.services.ipanti.client.IpantiClient import IpantiClient from jdcloud_sdk.services.ssl.client.SslClient import SslClient from jdcloud_sdk.services.domainservice.client.DomainserviceClient import DomainserviceClient -from jdcloud_sdk.services.jmr.client.JmrClient import JmrClient from jdcloud_sdk.services.oss.client.OssClient import OssClient from jdcloud_sdk.services.redis.client.RedisClient import RedisClient from jdcloud_sdk.services.billing.client.BillingClient import BillingClient -from jdcloud_sdk.services.deploy.client.DeployClient import DeployClient -from jdcloud_sdk.services.sop.client.SopClient import SopClient -from jdcloud_sdk.services.function.client.FunctionClient import FunctionClient from jdcloud_sdk.services.portal.client.PortalClient import PortalClient -from jdcloud_sdk.services.jdccs.client.JdccsClient import JdccsClient -from jdcloud_sdk.services.logs.client.LogsClient import LogsClient from jdcloud_sdk.services.clouddnsservice.client.ClouddnsserviceClient import ClouddnsserviceClient -from jdcloud_sdk.services.cps.client.CpsClient import CpsClient from jdcloud_sdk.services.cdn.client.CdnClient import CdnClient from jdcloud_sdk.services.streambus.client.StreambusClient import StreambusClient from jdcloud_sdk.services.apigateway.client.ApigatewayClient import ApigatewayClient -from jdcloud_sdk.services.httpdns.client.HttpdnsClient import HttpdnsClient -from jdcloud_sdk.services.disk.client.DiskClient import DiskClient from jdcloud_sdk.services.sts.client.StsClient import StsClient -from jdcloud_sdk.services.nc.client.NcClient import NcClient -from jdcloud_sdk.services.vm.client.VmClient import VmClient from jdcloud_sdk.services.nativecontainer.client.NativecontainerClient import NativecontainerClient -from jdcloud_sdk.services.iotcore.client.IotcoreClient import IotcoreClient from jdcloud_sdk.services.pod.client.PodClient import PodClient -from jdcloud_sdk.services.ams.client.AmsClient import AmsClient -from jdcloud_sdk.services.jdro.client.JdroClient import JdroClient -from jdcloud_sdk.services.zfs.client.ZfsClient import ZfsClient -from jdcloud_sdk.services.vod.client.VodClient import VodClient -from jdcloud_sdk.services.yundingdatapush.client.YundingdatapushClient import YundingdatapushClient from jdcloud_sdk.services.datastar.client.DatastarClient import DatastarClient from jdcloud_sdk.services.kms.client.KmsClient import KmsClient from jdcloud_sdk.services.elite.client.EliteClient import EliteClient -from jdcloud_sdk.services.ossopenapi.client.OssopenapiClient import OssopenapiClient from jdcloud_sdk.services.iam.client.IamClient import IamClient from jdcloud_sdk.services.iothub.client.IothubClient import IothubClient from jdcloud_sdk.services.sms.client.SmsClient import SmsClient -from jdcloud_sdk.services.jcq.client.JcqClient import JcqClient from jdcloud_sdk.services.resourcetag.client.ResourcetagClient import ResourcetagClient -from jdcloud_sdk.services.baseanti.client.BaseantiClient import BaseantiClient +from jdcloud_sdk.services.jcq.client.JcqClient import JcqClient from jdcloud_sdk.services.ias.client.IasClient import IasClient -from jdcloud_sdk.services.mongodb.client.MongodbClient import MongodbClient from jdcloud_sdk.services.jdfusion.client.JdfusionClient import JdfusionClient -from jdcloud_sdk.services.live.client.LiveClient import LiveClient from jdcloud_sdk.services.detection.client.DetectionClient import DetectionClient from jdcloud_sdk.services.iotlink.client.IotlinkClient import IotlinkClient from jdcloud_sdk.services.renewal.client.RenewalClient import RenewalClient from jdcloud_sdk.services.yunding.client.YundingClient import YundingClient -from jdcloud_sdk.services.vpc.client.VpcClient import VpcClient -from jdcloud_sdk.services.monitor.client.MonitorClient import MonitorClient -from jdcloud_sdk.services.xdata.client.XdataClient import XdataClient from jdcloud_sdk.services.containerregistry.client.ContainerregistryClient import ContainerregistryClient from jdcloud_sdk.services.partner.client.PartnerClient import PartnerClient from jdcloud_sdk.services.lb.client.LbClient import LbClient from jdcloud_sdk.services.industrydata.client.IndustrydataClient import IndustrydataClient +from jdcloud_sdk.services.rds.client.RdsClient import RdsClient +from jdcloud_sdk.services.kubernetes.client.KubernetesClient import KubernetesClient +from jdcloud_sdk.services.ipanti.client.IpantiClient import IpantiClient +from jdcloud_sdk.services.jmr.client.JmrClient import JmrClient +from jdcloud_sdk.services.deploy.client.DeployClient import DeployClient +from jdcloud_sdk.services.sop.client.SopClient import SopClient +from jdcloud_sdk.services.function.client.FunctionClient import FunctionClient +from jdcloud_sdk.services.jdccs.client.JdccsClient import JdccsClient +from jdcloud_sdk.services.logs.client.LogsClient import LogsClient +from jdcloud_sdk.services.cps.client.CpsClient import CpsClient +from jdcloud_sdk.services.httpdns.client.HttpdnsClient import HttpdnsClient +from jdcloud_sdk.services.disk.client.DiskClient import DiskClient +from jdcloud_sdk.services.nc.client.NcClient import NcClient +from jdcloud_sdk.services.vm.client.VmClient import VmClient +from jdcloud_sdk.services.iotcore.client.IotcoreClient import IotcoreClient +from jdcloud_sdk.services.zfs.client.ZfsClient import ZfsClient +from jdcloud_sdk.services.ams.client.AmsClient import AmsClient +from jdcloud_sdk.services.jdro.client.JdroClient import JdroClient +from jdcloud_sdk.services.vod.client.VodClient import VodClient +from jdcloud_sdk.services.yundingdatapush.client.YundingdatapushClient import YundingdatapushClient +from jdcloud_sdk.services.ossopenapi.client.OssopenapiClient import OssopenapiClient +from jdcloud_sdk.services.baseanti.client.BaseantiClient import BaseantiClient +from jdcloud_sdk.services.mongodb.client.MongodbClient import MongodbClient +from jdcloud_sdk.services.live.client.LiveClient import LiveClient +from jdcloud_sdk.services.vpc.client.VpcClient import VpcClient +from jdcloud_sdk.services.monitor.client.MonitorClient import MonitorClient +from jdcloud_sdk.services.xdata.client.XdataClient import XdataClient from jdcloud_cli.config import ProfileManager from jdcloud_cli.logger import get_logger @@ -89,66 +89,66 @@ def __init__(self, service): def get(self, app): client_map = { - 'rds': RdsClient, - 'kubernetes': KubernetesClient, 'vqd': VqdClient, 'streamcomputer': StreamcomputerClient, - 'ipanti': IpantiClient, 'ssl': SslClient, 'domainservice': DomainserviceClient, - 'jmr': JmrClient, 'oss': OssClient, 'redis': RedisClient, 'billing': BillingClient, - 'deploy': DeployClient, - 'sop': SopClient, - 'function': FunctionClient, 'portal': PortalClient, - 'jdccs': JdccsClient, - 'logs': LogsClient, 'clouddnsservice': ClouddnsserviceClient, - 'cps': CpsClient, 'cdn': CdnClient, 'streambus': StreambusClient, 'apigateway': ApigatewayClient, - 'httpdns': HttpdnsClient, - 'disk': DiskClient, 'sts': StsClient, - 'nc': NcClient, - 'vm': VmClient, 'nativecontainer': NativecontainerClient, - 'iotcore': IotcoreClient, 'pod': PodClient, - 'ams': AmsClient, - 'jdro': JdroClient, - 'zfs': ZfsClient, - 'vod': VodClient, - 'yundingdatapush': YundingdatapushClient, 'datastar': DatastarClient, 'kms': KmsClient, 'elite': EliteClient, - 'ossopenapi': OssopenapiClient, 'iam': IamClient, 'iothub': IothubClient, 'sms': SmsClient, - 'jcq': JcqClient, 'resourcetag': ResourcetagClient, - 'baseanti': BaseantiClient, + 'jcq': JcqClient, 'ias': IasClient, - 'mongodb': MongodbClient, 'jdfusion': JdfusionClient, - 'live': LiveClient, 'detection': DetectionClient, 'iotlink': IotlinkClient, 'renewal': RenewalClient, 'yunding': YundingClient, - 'vpc': VpcClient, - 'monitor': MonitorClient, - 'xdata': XdataClient, 'containerregistry': ContainerregistryClient, 'partner': PartnerClient, 'lb': LbClient, 'industrydata': IndustrydataClient, + 'rds': RdsClient, + 'kubernetes': KubernetesClient, + 'ipanti': IpantiClient, + 'jmr': JmrClient, + 'deploy': DeployClient, + 'sop': SopClient, + 'function': FunctionClient, + 'jdccs': JdccsClient, + 'logs': LogsClient, + 'cps': CpsClient, + 'httpdns': HttpdnsClient, + 'disk': DiskClient, + 'nc': NcClient, + 'vm': VmClient, + 'iotcore': IotcoreClient, + 'zfs': ZfsClient, + 'ams': AmsClient, + 'jdro': JdroClient, + 'vod': VodClient, + 'yundingdatapush': YundingdatapushClient, + 'ossopenapi': OssopenapiClient, + 'baseanti': BaseantiClient, + 'mongodb': MongodbClient, + 'live': LiveClient, + 'vpc': VpcClient, + 'monitor': MonitorClient, + 'xdata': XdataClient, } profile_manager = ProfileManager() diff --git a/jdcloud_cli/controllers/services/ams.py b/jdcloud_cli/controllers/services/ams.py index 7e43175..d685c70 100644 --- a/jdcloud_cli/controllers/services/ams.py +++ b/jdcloud_cli/controllers/services/ams.py @@ -42,6 +42,7 @@ class Meta: (['--start-time'], dict(help="""(string) 起始时间 """, dest='startTime', required=False)), (['--end-time'], dict(help="""(string) 结束时间 """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -75,6 +76,7 @@ def describe_streams_input(self): (['--p-id'], dict(help="""(string) PinId """, dest='pId', required=True)), (['--ver'], dict(help="""(int) 版本 """, dest='ver', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, diff --git a/jdcloud_cli/controllers/services/apigateway.py b/jdcloud_cli/controllers/services/apigateway.py index f2c3901..5c207a6 100644 --- a/jdcloud_cli/controllers/services/apigateway.py +++ b/jdcloud_cli/controllers/services/apigateway.py @@ -39,31 +39,33 @@ class Meta: @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) auth_user_type - 授权类型,默认为 全部类型; auth_user_id - 用户标识,精确匹配,jd_cloud(京东云用户), jd_apikms(api网关签名密钥), jd_subscription_key(订阅密钥),jd_cloud_pin(激活用户); """, dest='filters', required=False)), + (['--order-by'], dict(help="""(string) 排序类型 """, dest='orderBy', required=False)), + (['--api-group-id'], dict(help="""(string) api分组id """, dest='apiGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询访问授权列表 ''', + help=''' 查询domian列表 ''', description=''' - 查询访问授权列表。 + 查询domian列表。 - 示例: jdc apigateway query-access-auths + 示例: jdc apigateway query-user-domains --api-group-id xxx ''', ) - def query_access_auths(self): + def query_user_domains(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryAccessAuthsRequest import QueryAccessAuthsRequest + from jdcloud_sdk.services.apigateway.apis.QueryUserDomainsRequest import QueryUserDomainsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryAccessAuthsRequest(params_dict, headers) + req = QueryUserDomainsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -74,29 +76,32 @@ def query_access_auths(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-auth-view'], dict(help="""(accessAuthView) api分组 """, dest='accessAuthView', required=False)), + (['--domain'], dict(help="""(string) 域名 """, dest='domain', required=True)), + (['--protocol'], dict(help="""(string) 协议 """, dest='protocol', required=False)), + (['--api-group-id'], dict(help="""(string) api分组id """, dest='apiGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建访问授权 ''', + help=''' 添加用户域名 ''', description=''' - 创建访问授权。 + 添加用户域名。 - 示例: jdc apigateway create-access-auth + 示例: jdc apigateway create-user-domain --domain xxx --api-group-id xxx ''', ) - def create_access_auth(self): + def create_user_domain(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CreateAccessAuthRequest import CreateAccessAuthRequest + from jdcloud_sdk.services.apigateway.apis.CreateUserDomainRequest import CreateUserDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateAccessAuthRequest(params_dict, headers) + req = CreateUserDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -107,30 +112,31 @@ def create_access_auth(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-key'], dict(help="""(string) NA """, dest='accessKey', required=True)), - (['--auth-user-type'], dict(help="""(string) NA """, dest='authUserType', required=True)), + (['--domain-ids'], dict(help="""(string) 要删除domain的id集合,以,分隔 """, dest='domainIds', required=True)), + (['--api-group-id'], dict(help="""(string) api分组id """, dest='apiGroupId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 检查accessAuth是否重复 ''', + help=''' 删除用户域名接口 ''', description=''' - 检查accessAuth是否重复。 + 删除用户域名接口。 - 示例: jdc apigateway check-auth-exist --access-key xxx --auth-user-type xxx + 示例: jdc apigateway delete-user-domain --domain-ids xxx ''', ) - def check_auth_exist(self): + def delete_user_domain(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CheckAuthExistRequest import CheckAuthExistRequest + from jdcloud_sdk.services.apigateway.apis.DeleteUserDomainRequest import DeleteUserDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CheckAuthExistRequest(params_dict, headers) + req = DeleteUserDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -141,29 +147,45 @@ def check_auth_exist(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-auth-id'], dict(help="""(string) 访问授权ID """, dest='accessAuthId', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--backend-config-id'], dict(help="""(string) 接口ID """, dest='backendConfigId', required=False)), + (['--base-group-id'], dict(help="""(string) 分组ID """, dest='baseGroupId', required=False)), + (['--environment'], dict(help="""(string) 环境:test、preview、online """, dest='environment', required=True)), + (['--backend-url'], dict(help="""(string) 后端地址 """, dest='backendUrl', required=False)), + (['--backend-service-type'], dict(help="""(string) 后端服务类型:mock、HTTP/HTTPS """, dest='backendServiceType', required=True)), + (['--header-params'], dict(help="""(array: simpleParameter) header参数列表 """, dest='headerParams', required=False)), + (['--query-params'], dict(help="""(array: simpleParameter) query参数列表 """, dest='queryParams', required=False)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--create-time'], dict(help="""(int) 发布日期,格式为毫秒级时间戳 """, dest='createTime', type=int, required=False)), + (['--sort'], dict(help="""(int) 排序,赋值0时为默认的后端配置 """, dest='sort', type=int, required=True)), + (['--user-sort'], dict(help="""(int) 排序,用于展示使用 """, dest='userSort', type=int, required=False)), + (['--jdsf-id'], dict(help="""(string) vpc网关id """, dest='jdsfId', required=False)), + (['--jdsf-param'], dict(help="""(string) vpc后端地址 """, dest='jdsfParam', required=False)), + (['--jdsf-region'], dict(help="""(string) vpc网关所属region """, dest='jdsfRegion', required=False)), + (['--jdsf-pin'], dict(help="""(string) vpc网关创建者的pin """, dest='jdsfPin', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个访问授权 ''', + help=''' 开通后端配置 ''', description=''' - 查询单个访问授权。 + 开通后端配置。 - 示例: jdc apigateway query-access-auth --access-auth-id xxx + 示例: jdc apigateway create-backend-config --api-group-id xxx --environment xxx --backend-service-type xxx --sort 5 ''', ) - def query_access_auth(self): + def create_backend_config(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryAccessAuthRequest import QueryAccessAuthRequest + from jdcloud_sdk.services.apigateway.apis.CreateBackendConfigRequest import CreateBackendConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryAccessAuthRequest(params_dict, headers) + req = CreateBackendConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -174,30 +196,34 @@ def query_access_auth(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-auth-id'], dict(help="""(string) 访问授权ID """, dest='accessAuthId', required=True)), - (['--access-auth-view'], dict(help="""(accessAuthView) 访问授权详情 """, dest='accessAuthView', required=False)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--environment'], dict(help="""(string) 环境:test、preview、online """, dest='environment', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) sort - 路由排序,赋值0时为默认的后端配置; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新访问授权 ''', + help=''' 查询指定环境下的所有后端配置 ''', description=''' - 更新访问授权。 + 查询指定环境下的所有后端配置。 - 示例: jdc apigateway update-access-auth --access-auth-id xxx + 示例: jdc apigateway describe-backend-configs --api-group-id xxx --environment xxx ''', ) - def update_access_auth(self): + def describe_backend_configs(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.UpdateAccessAuthRequest import UpdateAccessAuthRequest + from jdcloud_sdk.services.apigateway.apis.DescribeBackendConfigsRequest import DescribeBackendConfigsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateAccessAuthRequest(params_dict, headers) + req = DescribeBackendConfigsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -208,29 +234,31 @@ def update_access_auth(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-auth-id'], dict(help="""(string) 访问授权ID """, dest='accessAuthId', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--backend-config-id'], dict(help="""(string) backendConfigId """, dest='backendConfigId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除访问授权 ''', + help=''' 查询backendConfig ''', description=''' - 删除访问授权。 + 查询backendConfig。 - 示例: jdc apigateway delete-access-auth --access-auth-id xxx + 示例: jdc apigateway describe-backend-config --api-group-id xxx --backend-config-id xxx ''', ) - def delete_access_auth(self): + def describe_backend_config(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DeleteAccessAuthRequest import DeleteAccessAuthRequest + from jdcloud_sdk.services.apigateway.apis.DescribeBackendConfigRequest import DescribeBackendConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteAccessAuthRequest(params_dict, headers) + req = DescribeBackendConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -241,29 +269,45 @@ def delete_access_auth(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-auth-id'], dict(help="""(string) 访问授权ID """, dest='accessAuthId', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--backend-config-id'], dict(help="""(string) backendConfigId """, dest='backendConfigId', required=True)), + (['--base-group-id'], dict(help="""(string) 分组ID """, dest='baseGroupId', required=False)), + (['--environment'], dict(help="""(string) 环境:test、preview、online """, dest='environment', required=True)), + (['--backend-url'], dict(help="""(string) 后端地址 """, dest='backendUrl', required=False)), + (['--backend-service-type'], dict(help="""(string) 后端服务类型:mock、HTTP/HTTPS """, dest='backendServiceType', required=True)), + (['--header-params'], dict(help="""(array: simpleParameter) header参数列表 """, dest='headerParams', required=False)), + (['--query-params'], dict(help="""(array: simpleParameter) query参数列表 """, dest='queryParams', required=False)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--create-time'], dict(help="""(int) 发布日期,格式为毫秒级时间戳 """, dest='createTime', type=int, required=False)), + (['--sort'], dict(help="""(int) 排序,赋值0时为默认的后端配置 """, dest='sort', type=int, required=True)), + (['--user-sort'], dict(help="""(int) 排序,用于展示使用 """, dest='userSort', type=int, required=False)), + (['--jdsf-id'], dict(help="""(string) vpc网关id """, dest='jdsfId', required=False)), + (['--jdsf-param'], dict(help="""(string) vpc后端地址 """, dest='jdsfParam', required=False)), + (['--jdsf-region'], dict(help="""(string) vpc网关所属region """, dest='jdsfRegion', required=False)), + (['--jdsf-pin'], dict(help="""(string) vpc网关创建者的pin """, dest='jdsfPin', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询已绑定详情 ''', + help=''' 修改后端配置 ''', description=''' - 查询已绑定详情。 + 修改后端配置。 - 示例: jdc apigateway query-bind-group-auth --access-auth-id xxx + 示例: jdc apigateway update-backend-config --api-group-id xxx --backend-config-id xxx --environment xxx --backend-service-type xxx --sort 5 ''', ) - def query_bind_group_auth(self): + def update_backend_config(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryBindGroupAuthRequest import QueryBindGroupAuthRequest + from jdcloud_sdk.services.apigateway.apis.UpdateBackendConfigRequest import UpdateBackendConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryBindGroupAuthRequest(params_dict, headers) + req = UpdateBackendConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -274,30 +318,31 @@ def query_bind_group_auth(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-auth-id'], dict(help="""(string) 访问授权ID """, dest='accessAuthId', required=True)), - (['--deployment-ids'], dict(help="""(string) 待绑定的部署ids逗号隔开 """, dest='deploymentIds', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--backend-config-id'], dict(help="""(string) backendConfigId """, dest='backendConfigId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 绑定分组 ''', + help=''' 删除后端配置 ''', description=''' - 绑定分组。 + 删除后端配置。 - 示例: jdc apigateway bind-group-auth --access-auth-id xxx --deployment-ids xxx + 示例: jdc apigateway delete-backend-config --api-group-id xxx --backend-config-id xxx ''', ) - def bind_group_auth(self): + def delete_backend_config(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.BindGroupAuthRequest import BindGroupAuthRequest + from jdcloud_sdk.services.apigateway.apis.DeleteBackendConfigRequest import DeleteBackendConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BindGroupAuthRequest(params_dict, headers) + req = DeleteBackendConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -308,29 +353,32 @@ def bind_group_auth(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--auth-user-type'], dict(help="""(string) 待绑定的用户类型 """, dest='authUserType', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) accessKey - accesskey,精确匹配; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询可绑定部署列表 ''', + help=''' 查询密钥列表 ''', description=''' - 查询可绑定部署列表。 + 查询密钥列表。 - 示例: jdc apigateway query-auth-group-list --auth-user-type xxx + 示例: jdc apigateway query-uc-access-keys ''', ) - def query_auth_group_list(self): + def query_uc_access_keys(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryAuthGroupListRequest import QueryAuthGroupListRequest + from jdcloud_sdk.services.apigateway.apis.QueryUcAccessKeysRequest import QueryUcAccessKeysRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryAuthGroupListRequest(params_dict, headers) + req = QueryUcAccessKeysRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -343,29 +391,32 @@ def query_auth_group_list(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) apiGroupName - 名称,模糊匹配; """, dest='filters', required=False)), + (['--order-by'], dict(help="""(string) 排序类型 """, dest='orderBy', required=False)), + (['--user-type'], dict(help="""(string) 用户类型 """, dest='userType', required=False)), + (['--key-id'], dict(help="""(string) 密钥Id """, dest='keyId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询所有已授权api分组列表 ''', + help=''' 查询key列表 ''', description=''' - 查询所有已授权api分组列表。 + 查询key列表。 - 示例: jdc apigateway authorized-api-group-list + 示例: jdc apigateway query-keys ''', ) - def authorized_api_group_list(self): + def query_keys(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.AuthorizedApiGroupListRequest import AuthorizedApiGroupListRequest + from jdcloud_sdk.services.apigateway.apis.QueryKeysRequest import QueryKeysRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AuthorizedApiGroupListRequest(params_dict, headers) + req = QueryKeysRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -376,31 +427,31 @@ def authorized_api_group_list(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) description - 名称,模糊匹配; accessKey - accesskey,模糊匹配; """, dest='filters', required=False)), + (['--key-name'], dict(help="""(string) key 名称 """, dest='keyName', required=False)), + (['--key-desc'], dict(help="""(string) key 描述 """, dest='keyDesc', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询密钥列表 ''', + help=''' 创建key ''', description=''' - 查询密钥列表。 + 创建key。 - 示例: jdc apigateway query-access-keys + 示例: jdc apigateway create-key ''', ) - def query_access_keys(self): + def create_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryAccessKeysRequest import QueryAccessKeysRequest + from jdcloud_sdk.services.apigateway.apis.CreateKeyRequest import CreateKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryAccessKeysRequest(params_dict, headers) + req = CreateKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -411,31 +462,30 @@ def query_access_keys(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), - (['--access-key-type'], dict(help="""(string) 密钥类型 """, dest='accessKeyType', required=False)), - (['--access-key'], dict(help="""(string) Access Key """, dest='accessKey', required=False)), + (['--key-id'], dict(help="""(string) keyId """, dest='keyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建密钥 ''', + help=''' 重置key的acesskey和secretkey ''', description=''' - 创建密钥。 + 重置key的acesskey和secretkey。 - 示例: jdc apigateway create-access-key + 示例: jdc apigateway reset-key --key-id xxx ''', ) - def create_access_key(self): + def reset_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CreateAccessKeyRequest import CreateAccessKeyRequest + from jdcloud_sdk.services.apigateway.apis.ResetKeyRequest import ResetKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateAccessKeyRequest(params_dict, headers) + req = ResetKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -446,30 +496,32 @@ def create_access_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-key'], dict(help="""(string) NA """, dest='accessKey', required=True)), - (['--access-key-type'], dict(help="""(string) NA """, dest='accessKeyType', required=True)), + (['--key-id'], dict(help="""(string) keyid """, dest='keyId', required=True)), + (['--key-name'], dict(help="""(string) key 名称 """, dest='keyName', required=False)), + (['--key-desc'], dict(help="""(string) NA """, dest='keyDesc', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 检查AccessKey是否重复 ''', + help=''' 修改key信息 ''', description=''' - 检查AccessKey是否重复。 + 修改key信息。 - 示例: jdc apigateway check-key-exist --access-key xxx --access-key-type xxx + 示例: jdc apigateway update-key --key-id xxx ''', ) - def check_key_exist(self): + def update_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CheckKeyExistRequest import CheckKeyExistRequest + from jdcloud_sdk.services.apigateway.apis.UpdateKeyRequest import UpdateKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CheckKeyExistRequest(params_dict, headers) + req = UpdateKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -480,29 +532,30 @@ def check_key_exist(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-key-id'], dict(help="""(string) access key id """, dest='accessKeyId', required=True)), + (['--key-id'], dict(help="""(string) keyId """, dest='keyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个密钥 ''', + help=''' 查询key详情 ''', description=''' - 查询单个密钥。 + 查询key详情。 - 示例: jdc apigateway query-access-key --access-key-id xxx + 示例: jdc apigateway query-key-info --key-id xxx ''', ) - def query_access_key(self): + def query_key_info(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryAccessKeyRequest import QueryAccessKeyRequest + from jdcloud_sdk.services.apigateway.apis.QueryKeyInfoRequest import QueryKeyInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryAccessKeyRequest(params_dict, headers) + req = QueryKeyInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -513,32 +566,33 @@ def query_access_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-key-id'], dict(help="""(string) access key id """, dest='accessKeyId', required=True)), - (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), - (['--access-key-type'], dict(help="""(string) 密钥类型 """, dest='accessKeyType', required=False)), - (['--access-key'], dict(help="""(string) Access Key """, dest='accessKey', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) groupName - 分组名称,模糊匹配,支持单个; description - 描述信息,模糊匹配,支持单个; groupId - 分组ID,精确匹配; domain - 域名,模糊匹配; jdsfId - 微服务网关ID,精确匹配; """, dest='filters', required=False)), + (['--tag-filters'], dict(help="""(array: tagFilter) 标签查询条件 """, dest='tagFilters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新密钥 ''', + help=''' 查询分组 ''', description=''' - 更新密钥。 + 查询分组。 - 示例: jdc apigateway update-access-key --access-key-id xxx + 示例: jdc apigateway describe-api-groups ''', ) - def update_access_key(self): + def describe_api_groups(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.UpdateAccessKeyRequest import UpdateAccessKeyRequest + from jdcloud_sdk.services.apigateway.apis.DescribeApiGroupsRequest import DescribeApiGroupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateAccessKeyRequest(params_dict, headers) + req = DescribeApiGroupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -549,29 +603,39 @@ def update_access_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-key-id'], dict(help="""(string) access key id """, dest='accessKeyId', required=True)), + (['--group-name'], dict(help="""(string) 名称 """, dest='groupName', required=True)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--prefix'], dict(help="""(string) 分组路径前缀,无需添加/ """, dest='prefix', required=False)), + (['--key-check'], dict(help="""(string) 密钥验证方式:check_exist(密钥必须在访问授权中已配置)、no_check_exist(无需事先配置) """, dest='keyCheck', required=False)), + (['--auth-type'], dict(help="""(string) 访问授权方式:None(免鉴权)、jd_cloud(开启访问授权,且必须使用京东云的AK、SK验签)、hufu(虎符用户) """, dest='authType', required=True)), + (['--prefix-strip'], dict(help="""(int) 是否转发分组路径到后端服务:0(不转发)、1(转发)默认为1 """, dest='prefixStrip', type=int, required=False)), + (['--group-type'], dict(help="""(string) 分组类型:api_group(api分组)、jdsf_group(微服务分组)默认为 api_group """, dest='groupType', required=False)), + (['--jdsf-name'], dict(help="""(string) 微服务网关名称 """, dest='jdsfName', required=False)), + (['--jdsf-registry-name'], dict(help="""(string) 微服务注册中心ID """, dest='jdsfRegistryName', required=False)), + (['--jdsf-id'], dict(help="""(string) 微服务网关ID """, dest='jdsfId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除密钥 ''', + help=''' 创建API分组 ''', description=''' - 删除密钥。 + 创建API分组。 - 示例: jdc apigateway delete-access-key --access-key-id xxx + 示例: jdc apigateway create-api-group --group-name xxx --auth-type xxx ''', ) - def delete_access_key(self): + def create_api_group(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DeleteAccessKeyRequest import DeleteAccessKeyRequest + from jdcloud_sdk.services.apigateway.apis.CreateApiGroupRequest import CreateApiGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteAccessKeyRequest(params_dict, headers) + req = CreateApiGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -582,29 +646,30 @@ def delete_access_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-key-id'], dict(help="""(string) access key id """, dest='accessKeyId', required=True)), + (['--group-name'], dict(help="""(string) 分组名称 """, dest='groupName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询绑定分组详情 ''', + help=''' 检查分组名称是否重复,返回重复的apiGroupId,如果没有返回空 ''', description=''' - 查询绑定分组详情。 + 检查分组名称是否重复,返回重复的apiGroupId,如果没有返回空。 - 示例: jdc apigateway query-bind-group-key --access-key-id xxx + 示例: jdc apigateway check-group-name-exist --group-name xxx ''', ) - def query_bind_group_key(self): + def check_group_name_exist(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryBindGroupKeyRequest import QueryBindGroupKeyRequest + from jdcloud_sdk.services.apigateway.apis.CheckGroupNameExistRequest import CheckGroupNameExistRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryBindGroupKeyRequest(params_dict, headers) + req = CheckGroupNameExistRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -615,30 +680,30 @@ def query_bind_group_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-key-id'], dict(help="""(string) access key id """, dest='accessKeyId', required=True)), - (['--deployment-ids'], dict(help="""(string) 待绑定的部署ids用逗号隔开 """, dest='deploymentIds', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 绑定分组 ''', + help=''' 查询API分组详情 ''', description=''' - 绑定分组。 + 查询API分组详情。 - 示例: jdc apigateway bind-group-key --access-key-id xxx --deployment-ids xxx + 示例: jdc apigateway describe-api-group --api-group-id xxx ''', ) - def bind_group_key(self): + def describe_api_group(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.BindGroupKeyRequest import BindGroupKeyRequest + from jdcloud_sdk.services.apigateway.apis.DescribeApiGroupRequest import DescribeApiGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BindGroupKeyRequest(params_dict, headers) + req = DescribeApiGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -649,29 +714,40 @@ def bind_group_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--access-key-id'], dict(help="""(string) access key id """, dest='accessKeyId', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--group-name'], dict(help="""(string) 名称 """, dest='groupName', required=False)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--prefix'], dict(help="""(string) 分组路径前缀 """, dest='prefix', required=False)), + (['--key-check'], dict(help="""(string) 密钥验证方式:check_exist(密钥必须在访问授权中已配置)、no_check_exist(无需事先配置) """, dest='keyCheck', required=False)), + (['--auth-type'], dict(help="""(string) 访问授权方式:None(免鉴权)、jd_cloud(开启访问授权,且必须使用京东云的AK、SK验签)、hufu(虎符用户) """, dest='authType', required=False)), + (['--prefix-strip'], dict(help="""(int) 是否转发分组路径到后端服务:0(不转发)、1(转发)默认为1 """, dest='prefixStrip', type=int, required=False)), + (['--group-type'], dict(help="""(string) 分组类型:api_group(api分组)、jdsf_group(微服务分组)默认为 api_group """, dest='groupType', required=False)), + (['--jdsf-name'], dict(help="""(string) 微服务网关名称 """, dest='jdsfName', required=False)), + (['--jdsf-registry-name'], dict(help="""(string) 微服务注册中心ID """, dest='jdsfRegistryName', required=False)), + (['--jdsf-id'], dict(help="""(string) 微服务网关ID """, dest='jdsfId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询可绑定部署列表 ''', + help=''' 修改API分组信息 ''', description=''' - 查询可绑定部署列表。 + 修改API分组信息。 - 示例: jdc apigateway query-key-group-list --access-key-id xxx + 示例: jdc apigateway modify-api-group-attribute --api-group-id xxx ''', ) - def query_key_group_list(self): + def modify_api_group_attribute(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryKeyGroupListRequest import QueryKeyGroupListRequest + from jdcloud_sdk.services.apigateway.apis.ModifyApiGroupAttributeRequest import ModifyApiGroupAttributeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryKeyGroupListRequest(params_dict, headers) + req = ModifyApiGroupAttributeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -683,32 +759,29 @@ def query_key_group_list(self): arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) apiName - API名称,模糊匹配,支持单个; action - 动作,精确匹配,支持多个; backServiceType- 后端服务类型,精确匹配,支持多个; path - 路径,模糊匹配,支持单个; description - 描述,模糊匹配,支持单个; isApiProduct - 是否API产品,精确匹配,1为是; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询api列表 ''', + help=''' 删除单个API分组 ''', description=''' - 查询api列表。 + 删除单个API分组。 - 示例: jdc apigateway query-apis --api-group-id xxx --revision xxx + 示例: jdc apigateway delete-api-group --api-group-id xxx ''', ) - def query_apis(self): + def delete_api_group(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryApisRequest import QueryApisRequest + from jdcloud_sdk.services.apigateway.apis.DeleteApiGroupRequest import DeleteApiGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryApisRequest(params_dict, headers) + req = DeleteApiGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -719,31 +792,30 @@ def query_apis(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), - (['--api'], dict(help="""(createApi) api """, dest='api', required=False)), + (['--filters'], dict(help="""(array: filter) deployStatus - 发布状态,已发布:1,未发布:0; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建api ''', + help=''' 查询分组 ''', description=''' - 创建api。 + 查询分组。 - 示例: jdc apigateway create-apis --api-group-id xxx --revision xxx + 示例: jdc apigateway describe-is-deploy-api-groups ''', ) - def create_apis(self): + def describe_is_deploy_api_groups(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CreateApisRequest import CreateApisRequest + from jdcloud_sdk.services.apigateway.apis.DescribeIsDeployApiGroupsRequest import DescribeIsDeployApiGroupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateApisRequest(params_dict, headers) + req = DescribeIsDeployApiGroupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -754,31 +826,32 @@ def create_apis(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), - (['--api-name'], dict(help="""(string) API名称 """, dest='apiName', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) policyName - 策略名称,模糊匹配; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建API时,检查API名称是否重复,返回重复的apiId,如果没有返回空 ''', + help=''' 查询流控策略列表 ''', description=''' - 创建API时,检查API名称是否重复,返回重复的apiId,如果没有返回空。 + 查询流控策略列表。 - 示例: jdc apigateway check-api-name-exist --api-group-id xxx --revision xxx --api-name xxx + 示例: jdc apigateway query-rate-limit-policies ''', ) - def check_api_name_exist(self): + def query_rate_limit_policies(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CheckApiNameExistRequest import CheckApiNameExistRequest + from jdcloud_sdk.services.apigateway.apis.QueryRateLimitPoliciesRequest import QueryRateLimitPoliciesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CheckApiNameExistRequest(params_dict, headers) + req = QueryRateLimitPoliciesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -789,32 +862,30 @@ def check_api_name_exist(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), - (['--api-id'], dict(help="""(string) 接口ID """, dest='apiId', required=True)), - (['--filters'], dict(help="""(array: filter) isApiProduct - 是否API产品,精确匹配,1为是; """, dest='filters', required=False)), + (['--rate-limit-policy-view'], dict(help="""(rateLimitPolicyView) 流控策略详情 """, dest='rateLimitPolicyView', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个api ''', + help=''' 创建流控策略 ''', description=''' - 查询单个api。 + 创建流控策略。 - 示例: jdc apigateway query-api --api-group-id xxx --revision xxx --api-id xxx + 示例: jdc apigateway create-rate-limit-policy ''', ) - def query_api(self): + def create_rate_limit_policy(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryApiRequest import QueryApiRequest + from jdcloud_sdk.services.apigateway.apis.CreateRateLimitPolicyRequest import CreateRateLimitPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryApiRequest(params_dict, headers) + req = CreateRateLimitPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -825,32 +896,30 @@ def query_api(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), - (['--api-id'], dict(help="""(string) 接口ID """, dest='apiId', required=True)), - (['--api'], dict(help="""(createApi) api """, dest='api', required=False)), + (['--policy-name'], dict(help="""(string) NA """, dest='policyName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改api ''', + help=''' 检查策略名是否重复 ''', description=''' - 修改api。 + 检查策略名是否重复。 - 示例: jdc apigateway update-api --api-group-id xxx --revision xxx --api-id xxx + 示例: jdc apigateway check-policy-name --policy-name xxx ''', ) - def update_api(self): + def check_policy_name(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.UpdateApiRequest import UpdateApiRequest + from jdcloud_sdk.services.apigateway.apis.CheckPolicyNameRequest import CheckPolicyNameRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateApiRequest(params_dict, headers) + req = CheckPolicyNameRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -861,31 +930,30 @@ def update_api(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), - (['--api-id'], dict(help="""(string) 接口ID """, dest='apiId', required=True)), + (['--policy-id'], dict(help="""(string) 限流策略ID """, dest='policyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除api ''', + help=''' 查询单个流控策略 ''', description=''' - 删除api。 + 查询单个流控策略。 - 示例: jdc apigateway delete-api --api-group-id xxx --revision xxx --api-id xxx + 示例: jdc apigateway query-rate-limit-policy --policy-id xxx ''', ) - def delete_api(self): + def query_rate_limit_policy(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DeleteApiRequest import DeleteApiRequest + from jdcloud_sdk.services.apigateway.apis.QueryRateLimitPolicyRequest import QueryRateLimitPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteApiRequest(params_dict, headers) + req = QueryRateLimitPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -896,32 +964,31 @@ def delete_api(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), - (['--api-name'], dict(help="""(string) NA """, dest='apiName', required=True)), - (['--api'], dict(help="""(createApi) api """, dest='api', required=False)), + (['--policy-id'], dict(help="""(string) 限流策略ID """, dest='policyId', required=True)), + (['--rate-limit-policy-view'], dict(help="""(rateLimitPolicyView) 流控策略详情 """, dest='rateLimitPolicyView', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改api ''', + help=''' 修改流控策略 ''', description=''' - 修改api。 + 修改流控策略。 - 示例: jdc apigateway update-api-by-name --api-group-id xxx --revision xxx --api-name xxx + 示例: jdc apigateway update-rate-limit-policy --policy-id xxx ''', ) - def update_api_by_name(self): + def update_rate_limit_policy(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.UpdateApiByNameRequest import UpdateApiByNameRequest + from jdcloud_sdk.services.apigateway.apis.UpdateRateLimitPolicyRequest import UpdateRateLimitPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateApiByNameRequest(params_dict, headers) + req = UpdateRateLimitPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -932,31 +999,30 @@ def update_api_by_name(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), - (['--api-name'], dict(help="""(string) NA """, dest='apiName', required=True)), + (['--policy-id'], dict(help="""(string) 限流策略ID """, dest='policyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除api ''', + help=''' 删除单个流控策略 ''', description=''' - 删除api。 + 删除单个流控策略。 - 示例: jdc apigateway delete-api-by-name --api-group-id xxx --revision xxx --api-name xxx + 示例: jdc apigateway delete-rate-limit-policy --policy-id xxx ''', ) - def delete_api_by_name(self): + def delete_rate_limit_policy(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DeleteApiByNameRequest import DeleteApiByNameRequest + from jdcloud_sdk.services.apigateway.apis.DeleteRateLimitPolicyRequest import DeleteRateLimitPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteApiByNameRequest(params_dict, headers) + req = DeleteRateLimitPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -967,32 +1033,30 @@ def delete_api_by_name(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) groupName - 分组名称,模糊匹配,支持单个; description - 描述信息,模糊匹配,支持单个; groupId - 分组ID,精确匹配; domain - 域名,模糊匹配; jdsfId - 微服务网关ID,精确匹配; """, dest='filters', required=False)), - (['--tag-filters'], dict(help="""(array: tagFilter) 标签查询条件 """, dest='tagFilters', required=False)), + (['--policy-id'], dict(help="""(string) 限流策略ID """, dest='policyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询分组 ''', + help=''' 查询绑定部署详情 ''', description=''' - 查询分组。 + 查询绑定部署详情。 - 示例: jdc apigateway describe-api-groups + 示例: jdc apigateway query-bind-group-policy --policy-id xxx ''', ) - def describe_api_groups(self): + def query_bind_group_policy(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DescribeApiGroupsRequest import DescribeApiGroupsRequest + from jdcloud_sdk.services.apigateway.apis.QueryBindGroupPolicyRequest import QueryBindGroupPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeApiGroupsRequest(params_dict, headers) + req = QueryBindGroupPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1003,38 +1067,31 @@ def describe_api_groups(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--group-name'], dict(help="""(string) 名称 """, dest='groupName', required=True)), - (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), - (['--prefix'], dict(help="""(string) 分组路径前缀,无需添加/ """, dest='prefix', required=False)), - (['--key-check'], dict(help="""(string) 密钥验证方式:check_exist(密钥必须在访问授权中已配置)、no_check_exist(无需事先配置) """, dest='keyCheck', required=False)), - (['--auth-type'], dict(help="""(string) 访问授权方式:None(免鉴权)、jd_cloud(开启访问授权,且必须使用京东云的AK、SK验签)、hufu(虎符用户) """, dest='authType', required=True)), - (['--prefix-strip'], dict(help="""(int) 是否转发分组路径到后端服务:0(不转发)、1(转发)默认为1 """, dest='prefixStrip', type=int, required=False)), - (['--group-type'], dict(help="""(string) 分组类型:api_group(api分组)、jdsf_group(微服务分组)默认为 api_group """, dest='groupType', required=False)), - (['--jdsf-name'], dict(help="""(string) 微服务网关名称 """, dest='jdsfName', required=False)), - (['--jdsf-registry-name'], dict(help="""(string) 微服务注册中心ID """, dest='jdsfRegistryName', required=False)), - (['--jdsf-id'], dict(help="""(string) 微服务网关ID """, dest='jdsfId', required=False)), + (['--policy-id'], dict(help="""(string) 限流策略ID """, dest='policyId', required=True)), + (['--deployment-ids'], dict(help="""(string) 待绑定的部署ids逗号隔开 """, dest='deploymentIds', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建API分组 ''', + help=''' 绑定 ''', description=''' - 创建API分组。 + 绑定。 - 示例: jdc apigateway create-api-group --group-name xxx --auth-type xxx + 示例: jdc apigateway bind-group-policy --policy-id xxx --deployment-ids xxx ''', ) - def create_api_group(self): + def bind_group_policy(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CreateApiGroupRequest import CreateApiGroupRequest + from jdcloud_sdk.services.apigateway.apis.BindGroupPolicyRequest import BindGroupPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateApiGroupRequest(params_dict, headers) + req = BindGroupPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1045,29 +1102,30 @@ def create_api_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--group-name'], dict(help="""(string) 分组名称 """, dest='groupName', required=True)), + (['--policy-id'], dict(help="""(string) 限流策略ID """, dest='policyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 检查分组名称是否重复,返回重复的apiGroupId,如果没有返回空 ''', + help=''' 查询可绑定部署列表 ''', description=''' - 检查分组名称是否重复,返回重复的apiGroupId,如果没有返回空。 + 查询可绑定部署列表。 - 示例: jdc apigateway check-group-name-exist --group-name xxx + 示例: jdc apigateway query-policy-group-list --policy-id xxx ''', ) - def check_group_name_exist(self): + def query_policy_group_list(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CheckGroupNameExistRequest import CheckGroupNameExistRequest + from jdcloud_sdk.services.apigateway.apis.QueryPolicyGroupListRequest import QueryPolicyGroupListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CheckGroupNameExistRequest(params_dict, headers) + req = QueryPolicyGroupListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1078,29 +1136,32 @@ def check_group_name_exist(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) description - 名称,模糊匹配; subscriptionKeyId - subscriptionKeyId,精确匹配; orderBy - 排序类型 desc asc; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询API分组详情 ''', + help=''' 查询密钥列表 ''', description=''' - 查询API分组详情。 + 查询密钥列表。 - 示例: jdc apigateway describe-api-group --api-group-id xxx + 示例: jdc apigateway query-subscription-keys ''', ) - def describe_api_group(self): + def query_subscription_keys(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DescribeApiGroupRequest import DescribeApiGroupRequest + from jdcloud_sdk.services.apigateway.apis.QuerySubscriptionKeysRequest import QuerySubscriptionKeysRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeApiGroupRequest(params_dict, headers) + req = QuerySubscriptionKeysRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1111,39 +1172,31 @@ def describe_api_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--group-name'], dict(help="""(string) 名称 """, dest='groupName', required=False)), (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), - (['--prefix'], dict(help="""(string) 分组路径前缀 """, dest='prefix', required=False)), - (['--key-check'], dict(help="""(string) 密钥验证方式:check_exist(密钥必须在访问授权中已配置)、no_check_exist(无需事先配置) """, dest='keyCheck', required=False)), - (['--auth-type'], dict(help="""(string) 访问授权方式:None(免鉴权)、jd_cloud(开启访问授权,且必须使用京东云的AK、SK验签)、hufu(虎符用户) """, dest='authType', required=False)), - (['--prefix-strip'], dict(help="""(int) 是否转发分组路径到后端服务:0(不转发)、1(转发)默认为1 """, dest='prefixStrip', type=int, required=False)), - (['--group-type'], dict(help="""(string) 分组类型:api_group(api分组)、jdsf_group(微服务分组)默认为 api_group """, dest='groupType', required=False)), - (['--jdsf-name'], dict(help="""(string) 微服务网关名称 """, dest='jdsfName', required=False)), - (['--jdsf-registry-name'], dict(help="""(string) 微服务注册中心ID """, dest='jdsfRegistryName', required=False)), - (['--jdsf-id'], dict(help="""(string) 微服务网关ID """, dest='jdsfId', required=False)), + (['--name'], dict(help="""(string) 密钥名称 """, dest='name', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改API分组信息 ''', + help=''' 创建密钥 ''', description=''' - 修改API分组信息。 + 创建密钥。 - 示例: jdc apigateway modify-api-group-attribute --api-group-id xxx + 示例: jdc apigateway create-subscription-key ''', ) - def modify_api_group_attribute(self): + def create_subscription_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.ModifyApiGroupAttributeRequest import ModifyApiGroupAttributeRequest + from jdcloud_sdk.services.apigateway.apis.CreateSubscriptionKeyRequest import CreateSubscriptionKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyApiGroupAttributeRequest(params_dict, headers) + req = CreateSubscriptionKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1154,29 +1207,30 @@ def modify_api_group_attribute(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--subscription-key-id'], dict(help="""(string) subscription key id """, dest='subscriptionKeyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除单个API分组 ''', + help=''' 查询单个密钥 ''', description=''' - 删除单个API分组。 + 查询单个密钥。 - 示例: jdc apigateway delete-api-group --api-group-id xxx + 示例: jdc apigateway query-subscription-key --subscription-key-id xxx ''', ) - def delete_api_group(self): + def query_subscription_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DeleteApiGroupRequest import DeleteApiGroupRequest + from jdcloud_sdk.services.apigateway.apis.QuerySubscriptionKeyRequest import QuerySubscriptionKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteApiGroupRequest(params_dict, headers) + req = QuerySubscriptionKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1187,29 +1241,32 @@ def delete_api_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--filters'], dict(help="""(array: filter) deployStatus - 发布状态,已发布:1,未发布:0; """, dest='filters', required=False)), + (['--subscription-key-id'], dict(help="""(string) subscription key id """, dest='subscriptionKeyId', required=True)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--name'], dict(help="""(string) 密钥名称 """, dest='name', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询分组 ''', + help=''' 更新密钥 ''', description=''' - 查询分组。 + 更新密钥。 - 示例: jdc apigateway describe-is-deploy-api-groups + 示例: jdc apigateway update-subscription-key --subscription-key-id xxx ''', ) - def describe_is_deploy_api_groups(self): + def update_subscription_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DescribeIsDeployApiGroupsRequest import DescribeIsDeployApiGroupsRequest + from jdcloud_sdk.services.apigateway.apis.UpdateSubscriptionKeyRequest import UpdateSubscriptionKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeIsDeployApiGroupsRequest(params_dict, headers) + req = UpdateSubscriptionKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1220,44 +1277,30 @@ def describe_is_deploy_api_groups(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--backend-config-id'], dict(help="""(string) 接口ID """, dest='backendConfigId', required=False)), - (['--base-group-id'], dict(help="""(string) 分组ID """, dest='baseGroupId', required=False)), - (['--environment'], dict(help="""(string) 环境:test、preview、online """, dest='environment', required=True)), - (['--backend-url'], dict(help="""(string) 后端地址 """, dest='backendUrl', required=False)), - (['--backend-service-type'], dict(help="""(string) 后端服务类型:mock、HTTP/HTTPS """, dest='backendServiceType', required=True)), - (['--header-params'], dict(help="""(array: simpleParameter) header参数列表 """, dest='headerParams', required=False)), - (['--query-params'], dict(help="""(array: simpleParameter) query参数列表 """, dest='queryParams', required=False)), - (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), - (['--create-time'], dict(help="""(int) 发布日期,格式为毫秒级时间戳 """, dest='createTime', type=int, required=False)), - (['--sort'], dict(help="""(int) 排序,赋值0时为默认的后端配置 """, dest='sort', type=int, required=True)), - (['--user-sort'], dict(help="""(int) 排序,用于展示使用 """, dest='userSort', type=int, required=False)), - (['--jdsf-id'], dict(help="""(string) vpc网关id """, dest='jdsfId', required=False)), - (['--jdsf-param'], dict(help="""(string) vpc后端地址 """, dest='jdsfParam', required=False)), - (['--jdsf-region'], dict(help="""(string) vpc网关所属region """, dest='jdsfRegion', required=False)), - (['--jdsf-pin'], dict(help="""(string) vpc网关创建者的pin """, dest='jdsfPin', required=False)), + (['--subscription-key-id'], dict(help="""(string) subscription key id """, dest='subscriptionKeyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开通后端配置 ''', + help=''' 删除密钥 ''', description=''' - 开通后端配置。 + 删除密钥。 - 示例: jdc apigateway create-backend-config --api-group-id xxx --environment xxx --backend-service-type xxx --sort 0 + 示例: jdc apigateway delete-subscription-key --subscription-key-id xxx ''', ) - def create_backend_config(self): + def delete_subscription_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CreateBackendConfigRequest import CreateBackendConfigRequest + from jdcloud_sdk.services.apigateway.apis.DeleteSubscriptionKeyRequest import DeleteSubscriptionKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateBackendConfigRequest(params_dict, headers) + req = DeleteSubscriptionKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1268,33 +1311,32 @@ def create_backend_config(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--environment'], dict(help="""(string) 环境:test、preview、online """, dest='environment', required=True)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) sort - 路由排序,赋值0时为默认的后端配置; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) description - 名称,模糊匹配; accessKey - accesskey,模糊匹配; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询指定环境下的所有后端配置 ''', + help=''' 查询密钥列表 ''', description=''' - 查询指定环境下的所有后端配置。 + 查询密钥列表。 - 示例: jdc apigateway describe-backend-configs --api-group-id xxx --environment xxx + 示例: jdc apigateway query-access-keys ''', ) - def describe_backend_configs(self): + def query_access_keys(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DescribeBackendConfigsRequest import DescribeBackendConfigsRequest + from jdcloud_sdk.services.apigateway.apis.QueryAccessKeysRequest import QueryAccessKeysRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBackendConfigsRequest(params_dict, headers) + req = QueryAccessKeysRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1305,30 +1347,32 @@ def describe_backend_configs(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--backend-config-id'], dict(help="""(string) backendConfigId """, dest='backendConfigId', required=True)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--access-key-type'], dict(help="""(string) 密钥类型 """, dest='accessKeyType', required=False)), + (['--access-key'], dict(help="""(string) Access Key """, dest='accessKey', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询backendConfig ''', + help=''' 创建密钥 ''', description=''' - 查询backendConfig。 + 创建密钥。 - 示例: jdc apigateway describe-backend-config --api-group-id xxx --backend-config-id xxx + 示例: jdc apigateway create-access-key ''', ) - def describe_backend_config(self): + def create_access_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DescribeBackendConfigRequest import DescribeBackendConfigRequest + from jdcloud_sdk.services.apigateway.apis.CreateAccessKeyRequest import CreateAccessKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBackendConfigRequest(params_dict, headers) + req = CreateAccessKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1337,46 +1381,33 @@ def describe_backend_config(self): print(e) @expose( - arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--backend-config-id'], dict(help="""(string) backendConfigId """, dest='backendConfigId', required=True)), - (['--base-group-id'], dict(help="""(string) 分组ID """, dest='baseGroupId', required=False)), - (['--environment'], dict(help="""(string) 环境:test、preview、online """, dest='environment', required=True)), - (['--backend-url'], dict(help="""(string) 后端地址 """, dest='backendUrl', required=False)), - (['--backend-service-type'], dict(help="""(string) 后端服务类型:mock、HTTP/HTTPS """, dest='backendServiceType', required=True)), - (['--header-params'], dict(help="""(array: simpleParameter) header参数列表 """, dest='headerParams', required=False)), - (['--query-params'], dict(help="""(array: simpleParameter) query参数列表 """, dest='queryParams', required=False)), - (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), - (['--create-time'], dict(help="""(int) 发布日期,格式为毫秒级时间戳 """, dest='createTime', type=int, required=False)), - (['--sort'], dict(help="""(int) 排序,赋值0时为默认的后端配置 """, dest='sort', type=int, required=True)), - (['--user-sort'], dict(help="""(int) 排序,用于展示使用 """, dest='userSort', type=int, required=False)), - (['--jdsf-id'], dict(help="""(string) vpc网关id """, dest='jdsfId', required=False)), - (['--jdsf-param'], dict(help="""(string) vpc后端地址 """, dest='jdsfParam', required=False)), - (['--jdsf-region'], dict(help="""(string) vpc网关所属region """, dest='jdsfRegion', required=False)), - (['--jdsf-pin'], dict(help="""(string) vpc网关创建者的pin """, dest='jdsfPin', required=False)), + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--access-key'], dict(help="""(string) NA """, dest='accessKey', required=True)), + (['--access-key-type'], dict(help="""(string) NA """, dest='accessKeyType', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改后端配置 ''', + help=''' 检查AccessKey是否重复 ''', description=''' - 修改后端配置。 + 检查AccessKey是否重复。 - 示例: jdc apigateway update-backend-config --api-group-id xxx --backend-config-id xxx --environment xxx --backend-service-type xxx --sort 0 + 示例: jdc apigateway check-key-exist --access-key xxx --access-key-type xxx ''', ) - def update_backend_config(self): + def check_key_exist(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.UpdateBackendConfigRequest import UpdateBackendConfigRequest + from jdcloud_sdk.services.apigateway.apis.CheckKeyExistRequest import CheckKeyExistRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateBackendConfigRequest(params_dict, headers) + req = CheckKeyExistRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1387,30 +1418,30 @@ def update_backend_config(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--backend-config-id'], dict(help="""(string) backendConfigId """, dest='backendConfigId', required=True)), + (['--access-key-id'], dict(help="""(string) access key id """, dest='accessKeyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除后端配置 ''', + help=''' 查询单个密钥 ''', description=''' - 删除后端配置。 + 查询单个密钥。 - 示例: jdc apigateway delete-backend-config --api-group-id xxx --backend-config-id xxx + 示例: jdc apigateway query-access-key --access-key-id xxx ''', ) - def delete_backend_config(self): + def query_access_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DeleteBackendConfigRequest import DeleteBackendConfigRequest + from jdcloud_sdk.services.apigateway.apis.QueryAccessKeyRequest import QueryAccessKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteBackendConfigRequest(params_dict, headers) + req = QueryAccessKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1421,30 +1452,33 @@ def delete_backend_config(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--filters'], dict(help="""(array: filter) isApiProduct - 是否API产品,精确匹配,1为是; """, dest='filters', required=False)), + (['--access-key-id'], dict(help="""(string) access key id """, dest='accessKeyId', required=True)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--access-key-type'], dict(help="""(string) 密钥类型 """, dest='accessKeyType', required=False)), + (['--access-key'], dict(help="""(string) Access Key """, dest='accessKey', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询部署列表 ''', + help=''' 更新密钥 ''', description=''' - 查询部署列表。 + 更新密钥。 - 示例: jdc apigateway describe-deployments --api-group-id xxx + 示例: jdc apigateway update-access-key --access-key-id xxx ''', ) - def describe_deployments(self): + def update_access_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DescribeDeploymentsRequest import DescribeDeploymentsRequest + from jdcloud_sdk.services.apigateway.apis.UpdateAccessKeyRequest import UpdateAccessKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDeploymentsRequest(params_dict, headers) + req = UpdateAccessKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1455,37 +1489,30 @@ def describe_deployments(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--revision'], dict(help="""(string) 发布的修订版本号 """, dest='revision', required=True)), - (['--environment'], dict(help="""(string) 环境:test、preview、online """, dest='environment', required=True)), - (['--backend-service-type'], dict(help="""(string) 后端服务类型:mock、unique、vpc """, dest='backendServiceType', required=False)), - (['--backend-url'], dict(help="""(string) 后端地址 """, dest='backendUrl', required=False)), - (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), - (['--jdsf-name'], dict(help="""(string) 微服务网关名称 """, dest='jdsfName', required=False)), - (['--jdsf-registry-name'], dict(help="""(string) 微服务注册中心ID """, dest='jdsfRegistryName', required=False)), - (['--jdsf-id'], dict(help="""(string) 微服务ID """, dest='jdsfId', required=False)), + (['--access-key-id'], dict(help="""(string) access key id """, dest='accessKeyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 发布版本 ''', + help=''' 删除密钥 ''', description=''' - 发布版本。 + 删除密钥。 - 示例: jdc apigateway deploy --api-group-id xxx --revision xxx --environment xxx + 示例: jdc apigateway delete-access-key --access-key-id xxx ''', ) - def deploy(self): + def delete_access_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DeployRequest import DeployRequest + from jdcloud_sdk.services.apigateway.apis.DeleteAccessKeyRequest import DeleteAccessKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeployRequest(params_dict, headers) + req = DeleteAccessKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1496,30 +1523,30 @@ def deploy(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--deployment-id'], dict(help="""(string) 部署ID """, dest='deploymentId', required=True)), + (['--access-key-id'], dict(help="""(string) access key id """, dest='accessKeyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询该版本的部署详情 ''', + help=''' 查询绑定分组详情 ''', description=''' - 查询该版本的部署详情。 + 查询绑定分组详情。 - 示例: jdc apigateway describe-deployment --api-group-id xxx --deployment-id xxx + 示例: jdc apigateway query-bind-group-key --access-key-id xxx ''', ) - def describe_deployment(self): + def query_bind_group_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DescribeDeploymentRequest import DescribeDeploymentRequest + from jdcloud_sdk.services.apigateway.apis.QueryBindGroupKeyRequest import QueryBindGroupKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDeploymentRequest(params_dict, headers) + req = QueryBindGroupKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1530,30 +1557,31 @@ def describe_deployment(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--deployment-id'], dict(help="""(string) 部署ID """, dest='deploymentId', required=True)), + (['--access-key-id'], dict(help="""(string) access key id """, dest='accessKeyId', required=True)), + (['--deployment-ids'], dict(help="""(string) 待绑定的部署ids用逗号隔开 """, dest='deploymentIds', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 下线 ''', + help=''' 绑定分组 ''', description=''' - 下线。 + 绑定分组。 - 示例: jdc apigateway offline --api-group-id xxx --deployment-id xxx + 示例: jdc apigateway bind-group-key --access-key-id xxx --deployment-ids xxx ''', ) - def offline(self): + def bind_group_key(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.OfflineRequest import OfflineRequest + from jdcloud_sdk.services.apigateway.apis.BindGroupKeyRequest import BindGroupKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = OfflineRequest(params_dict, headers) + req = BindGroupKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1564,30 +1592,30 @@ def offline(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), - (['--deployment-ids'], dict(help="""(string) 要删除的部署ID集合,以,分隔 """, dest='deploymentIds', required=False)), + (['--access-key-id'], dict(help="""(string) access key id """, dest='accessKeyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量下线 ''', + help=''' 查询可绑定部署列表 ''', description=''' - 批量下线。 + 查询可绑定部署列表。 - 示例: jdc apigateway batch-offline --api-group-id xxx + 示例: jdc apigateway query-key-group-list --access-key-id xxx ''', ) - def batch_offline(self): + def query_key_group_list(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.BatchOfflineRequest import BatchOfflineRequest + from jdcloud_sdk.services.apigateway.apis.QueryKeyGroupListRequest import QueryKeyGroupListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BatchOfflineRequest(params_dict, headers) + req = QueryKeyGroupListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1598,33 +1626,30 @@ def batch_offline(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--order-by'], dict(help="""(string) 排序类型 """, dest='orderBy', required=False)), - (['--user-type'], dict(help="""(string) 用户类型 """, dest='userType', required=False)), - (['--key-id'], dict(help="""(string) 密钥Id """, dest='keyId', required=False)), + (['--pin'], dict(help="""(string) 京东云pin """, dest='pin', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询key列表 ''', + help=''' 校验pin是否存在 ''', description=''' - 查询key列表。 + 校验pin是否存在。 - 示例: jdc apigateway query-keys + 示例: jdc apigateway check-pin --pin xxx ''', ) - def query_keys(self): + def check_pin(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryKeysRequest import QueryKeysRequest + from jdcloud_sdk.services.apigateway.apis.CheckPinRequest import CheckPinRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryKeysRequest(params_dict, headers) + req = CheckPinRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1635,30 +1660,34 @@ def query_keys(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--key-name'], dict(help="""(string) key 名称 """, dest='keyName', required=False)), - (['--key-desc'], dict(help="""(string) key 描述 """, dest='keyDesc', required=False)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) apiName - API名称,模糊匹配,支持单个; action - 动作,精确匹配,支持多个; backServiceType- 后端服务类型,精确匹配,支持多个; path - 路径,模糊匹配,支持单个; description - 描述,模糊匹配,支持单个; isApiProduct - 是否API产品,精确匹配,1为是; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建key ''', + help=''' 查询api列表 ''', description=''' - 创建key。 + 查询api列表。 - 示例: jdc apigateway create-key + 示例: jdc apigateway query-apis --api-group-id xxx --revision xxx ''', ) - def create_key(self): + def query_apis(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CreateKeyRequest import CreateKeyRequest + from jdcloud_sdk.services.apigateway.apis.QueryApisRequest import QueryApisRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateKeyRequest(params_dict, headers) + req = QueryApisRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1669,29 +1698,32 @@ def create_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--key-id'], dict(help="""(string) keyId """, dest='keyId', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), + (['--api'], dict(help="""(createApi) api """, dest='api', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 重置key的acesskey和secretkey ''', + help=''' 创建api ''', description=''' - 重置key的acesskey和secretkey。 + 创建api。 - 示例: jdc apigateway reset-key --key-id xxx + 示例: jdc apigateway create-apis --api-group-id xxx --revision xxx ''', ) - def reset_key(self): + def create_apis(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.ResetKeyRequest import ResetKeyRequest + from jdcloud_sdk.services.apigateway.apis.CreateApisRequest import CreateApisRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ResetKeyRequest(params_dict, headers) + req = CreateApisRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1702,31 +1734,32 @@ def reset_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--key-id'], dict(help="""(string) keyid """, dest='keyId', required=True)), - (['--key-name'], dict(help="""(string) key 名称 """, dest='keyName', required=False)), - (['--key-desc'], dict(help="""(string) NA """, dest='keyDesc', required=False)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), + (['--api-name'], dict(help="""(string) API名称 """, dest='apiName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改key信息 ''', + help=''' 创建API时,检查API名称是否重复,返回重复的apiId,如果没有返回空 ''', description=''' - 修改key信息。 + 创建API时,检查API名称是否重复,返回重复的apiId,如果没有返回空。 - 示例: jdc apigateway update-key --key-id xxx + 示例: jdc apigateway check-api-name-exist --api-group-id xxx --revision xxx --api-name xxx ''', ) - def update_key(self): + def check_api_name_exist(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.UpdateKeyRequest import UpdateKeyRequest + from jdcloud_sdk.services.apigateway.apis.CheckApiNameExistRequest import CheckApiNameExistRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateKeyRequest(params_dict, headers) + req = CheckApiNameExistRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1737,29 +1770,33 @@ def update_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--key-id'], dict(help="""(string) keyId """, dest='keyId', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), + (['--api-id'], dict(help="""(string) 接口ID """, dest='apiId', required=True)), + (['--filters'], dict(help="""(array: filter) isApiProduct - 是否API产品,精确匹配,1为是; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询key详情 ''', + help=''' 查询单个api ''', description=''' - 查询key详情。 + 查询单个api。 - 示例: jdc apigateway query-key-info --key-id xxx + 示例: jdc apigateway query-api --api-group-id xxx --revision xxx --api-id xxx ''', ) - def query_key_info(self): + def query_api(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryKeyInfoRequest import QueryKeyInfoRequest + from jdcloud_sdk.services.apigateway.apis.QueryApiRequest import QueryApiRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryKeyInfoRequest(params_dict, headers) + req = QueryApiRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1770,31 +1807,33 @@ def query_key_info(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) policyName - 策略名称,模糊匹配; """, dest='filters', required=False)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), + (['--api-id'], dict(help="""(string) 接口ID """, dest='apiId', required=True)), + (['--api'], dict(help="""(createApi) api """, dest='api', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询流控策略列表 ''', + help=''' 修改api ''', description=''' - 查询流控策略列表。 + 修改api。 - 示例: jdc apigateway query-rate-limit-policies + 示例: jdc apigateway update-api --api-group-id xxx --revision xxx --api-id xxx ''', ) - def query_rate_limit_policies(self): + def update_api(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryRateLimitPoliciesRequest import QueryRateLimitPoliciesRequest + from jdcloud_sdk.services.apigateway.apis.UpdateApiRequest import UpdateApiRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryRateLimitPoliciesRequest(params_dict, headers) + req = UpdateApiRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1805,29 +1844,32 @@ def query_rate_limit_policies(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--rate-limit-policy-view'], dict(help="""(rateLimitPolicyView) 流控策略详情 """, dest='rateLimitPolicyView', required=False)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), + (['--api-id'], dict(help="""(string) 接口ID """, dest='apiId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建流控策略 ''', + help=''' 删除api ''', description=''' - 创建流控策略。 + 删除api。 - 示例: jdc apigateway create-rate-limit-policy + 示例: jdc apigateway delete-api --api-group-id xxx --revision xxx --api-id xxx ''', ) - def create_rate_limit_policy(self): + def delete_api(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CreateRateLimitPolicyRequest import CreateRateLimitPolicyRequest + from jdcloud_sdk.services.apigateway.apis.DeleteApiRequest import DeleteApiRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateRateLimitPolicyRequest(params_dict, headers) + req = DeleteApiRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1838,29 +1880,33 @@ def create_rate_limit_policy(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--policy-name'], dict(help="""(string) NA """, dest='policyName', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), + (['--api-name'], dict(help="""(string) NA """, dest='apiName', required=True)), + (['--api'], dict(help="""(createApi) api """, dest='api', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 检查策略名是否重复 ''', + help=''' 修改api ''', description=''' - 检查策略名是否重复。 + 修改api。 - 示例: jdc apigateway check-policy-name --policy-name xxx + 示例: jdc apigateway update-api-by-name --api-group-id xxx --revision xxx --api-name xxx ''', ) - def check_policy_name(self): + def update_api_by_name(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CheckPolicyNameRequest import CheckPolicyNameRequest + from jdcloud_sdk.services.apigateway.apis.UpdateApiByNameRequest import UpdateApiByNameRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CheckPolicyNameRequest(params_dict, headers) + req = UpdateApiByNameRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1871,29 +1917,32 @@ def check_policy_name(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--policy-id'], dict(help="""(string) 限流策略ID """, dest='policyId', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), + (['--api-name'], dict(help="""(string) NA """, dest='apiName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个流控策略 ''', + help=''' 删除api ''', description=''' - 查询单个流控策略。 + 删除api。 - 示例: jdc apigateway query-rate-limit-policy --policy-id xxx + 示例: jdc apigateway delete-api-by-name --api-group-id xxx --revision xxx --api-name xxx ''', ) - def query_rate_limit_policy(self): + def delete_api_by_name(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryRateLimitPolicyRequest import QueryRateLimitPolicyRequest + from jdcloud_sdk.services.apigateway.apis.DeleteApiByNameRequest import DeleteApiByNameRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryRateLimitPolicyRequest(params_dict, headers) + req = DeleteApiByNameRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1904,30 +1953,31 @@ def query_rate_limit_policy(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--policy-id'], dict(help="""(string) 限流策略ID """, dest='policyId', required=True)), - (['--rate-limit-policy-view'], dict(help="""(rateLimitPolicyView) 流控策略详情 """, dest='rateLimitPolicyView', required=False)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--filters'], dict(help="""(array: filter) isApiProduct - 是否API产品,精确匹配,1为是; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改流控策略 ''', + help=''' 查询部署列表 ''', description=''' - 修改流控策略。 + 查询部署列表。 - 示例: jdc apigateway update-rate-limit-policy --policy-id xxx + 示例: jdc apigateway describe-deployments --api-group-id xxx ''', ) - def update_rate_limit_policy(self): + def describe_deployments(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.UpdateRateLimitPolicyRequest import UpdateRateLimitPolicyRequest + from jdcloud_sdk.services.apigateway.apis.DescribeDeploymentsRequest import DescribeDeploymentsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateRateLimitPolicyRequest(params_dict, headers) + req = DescribeDeploymentsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1938,29 +1988,38 @@ def update_rate_limit_policy(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--policy-id'], dict(help="""(string) 限流策略ID """, dest='policyId', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--revision'], dict(help="""(string) 发布的修订版本号 """, dest='revision', required=True)), + (['--environment'], dict(help="""(string) 环境:test、preview、online """, dest='environment', required=True)), + (['--backend-service-type'], dict(help="""(string) 后端服务类型:mock、unique、vpc """, dest='backendServiceType', required=False)), + (['--backend-url'], dict(help="""(string) 后端地址 """, dest='backendUrl', required=False)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--jdsf-name'], dict(help="""(string) 微服务网关名称 """, dest='jdsfName', required=False)), + (['--jdsf-registry-name'], dict(help="""(string) 微服务注册中心ID """, dest='jdsfRegistryName', required=False)), + (['--jdsf-id'], dict(help="""(string) 微服务ID """, dest='jdsfId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除单个流控策略 ''', + help=''' 发布版本 ''', description=''' - 删除单个流控策略。 + 发布版本。 - 示例: jdc apigateway delete-rate-limit-policy --policy-id xxx + 示例: jdc apigateway deploy --api-group-id xxx --revision xxx --environment xxx ''', ) - def delete_rate_limit_policy(self): + def deploy(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DeleteRateLimitPolicyRequest import DeleteRateLimitPolicyRequest + from jdcloud_sdk.services.apigateway.apis.DeployRequest import DeployRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteRateLimitPolicyRequest(params_dict, headers) + req = DeployRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1971,29 +2030,31 @@ def delete_rate_limit_policy(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--policy-id'], dict(help="""(string) 限流策略ID """, dest='policyId', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--deployment-id'], dict(help="""(string) 部署ID """, dest='deploymentId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询绑定部署详情 ''', + help=''' 查询该版本的部署详情 ''', description=''' - 查询绑定部署详情。 + 查询该版本的部署详情。 - 示例: jdc apigateway query-bind-group-policy --policy-id xxx + 示例: jdc apigateway describe-deployment --api-group-id xxx --deployment-id xxx ''', ) - def query_bind_group_policy(self): + def describe_deployment(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryBindGroupPolicyRequest import QueryBindGroupPolicyRequest + from jdcloud_sdk.services.apigateway.apis.DescribeDeploymentRequest import DescribeDeploymentRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryBindGroupPolicyRequest(params_dict, headers) + req = DescribeDeploymentRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2004,30 +2065,31 @@ def query_bind_group_policy(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--policy-id'], dict(help="""(string) 限流策略ID """, dest='policyId', required=True)), - (['--deployment-ids'], dict(help="""(string) 待绑定的部署ids逗号隔开 """, dest='deploymentIds', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--deployment-id'], dict(help="""(string) 部署ID """, dest='deploymentId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 绑定 ''', + help=''' 下线 ''', description=''' - 绑定。 + 下线。 - 示例: jdc apigateway bind-group-policy --policy-id xxx --deployment-ids xxx + 示例: jdc apigateway offline --api-group-id xxx --deployment-id xxx ''', ) - def bind_group_policy(self): + def offline(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.BindGroupPolicyRequest import BindGroupPolicyRequest + from jdcloud_sdk.services.apigateway.apis.OfflineRequest import OfflineRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BindGroupPolicyRequest(params_dict, headers) + req = OfflineRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2038,29 +2100,31 @@ def bind_group_policy(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--policy-id'], dict(help="""(string) 限流策略ID """, dest='policyId', required=True)), + (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), + (['--deployment-ids'], dict(help="""(string) 要删除的部署ID集合,以,分隔 """, dest='deploymentIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询可绑定部署列表 ''', + help=''' 批量下线 ''', description=''' - 查询可绑定部署列表。 + 批量下线。 - 示例: jdc apigateway query-policy-group-list --policy-id xxx + 示例: jdc apigateway batch-offline --api-group-id xxx ''', ) - def query_policy_group_list(self): + def batch_offline(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryPolicyGroupListRequest import QueryPolicyGroupListRequest + from jdcloud_sdk.services.apigateway.apis.BatchOfflineRequest import BatchOfflineRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryPolicyGroupListRequest(params_dict, headers) + req = BatchOfflineRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2076,6 +2140,7 @@ def query_policy_group_list(self): (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), (['--filters'], dict(help="""(array: filter) revision - 修订版本号,精确匹配; environment - 发布环境,模糊匹配; revisionNote - 修订备注,精确匹配; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2112,6 +2177,7 @@ def describe_revisions(self): (['--base-revision'], dict(help="""(string) 基于此版本,如果创建版本时传回修订版本,此为必填项 """, dest='baseRevision', required=False)), (['--revision-note'], dict(help="""(string) 修订备注 """, dest='revisionNote', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2145,6 +2211,7 @@ def create_revision(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2179,6 +2246,7 @@ def get_revision_ids(self): (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), (['--revision'], dict(help="""(string) 版本号 """, dest='revision', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2216,6 +2284,7 @@ def check_revision_exist(self): (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), (['--filters'], dict(help="""(array: filter) revision - 修订版本号,模糊匹配; environment - 发布环境,模糊匹配; revisionNote - 修订备注,模糊匹配; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2251,6 +2320,7 @@ def query_revision(self): (['--revision-id'], dict(help="""(string) 版本ID """, dest='revisionId', required=True)), (['--revision-note'], dict(help="""(string) 修订备注 """, dest='revisionNote', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2285,6 +2355,7 @@ def modify_revision(self): (['--api-group-id'], dict(help="""(string) 分组ID """, dest='apiGroupId', required=True)), (['--revision-id'], dict(help="""(string) 版本ID """, dest='revisionId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2318,29 +2389,30 @@ def delete_revision(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) description - 名称,模糊匹配; subscriptionKeyId - subscriptionKeyId,精确匹配; orderBy - 排序类型 desc asc; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) auth_user_type - 授权类型,默认为 全部类型; auth_user_id - 用户标识,精确匹配,jd_cloud(京东云用户), jd_apikms(api网关签名密钥), jd_subscription_key(订阅密钥),jd_cloud_pin(激活用户); """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询密钥列表 ''', + help=''' 查询访问授权列表 ''', description=''' - 查询密钥列表。 + 查询访问授权列表。 - 示例: jdc apigateway query-subscription-keys + 示例: jdc apigateway query-access-auths ''', ) - def query_subscription_keys(self): + def query_access_auths(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QuerySubscriptionKeysRequest import QuerySubscriptionKeysRequest + from jdcloud_sdk.services.apigateway.apis.QueryAccessAuthsRequest import QueryAccessAuthsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QuerySubscriptionKeysRequest(params_dict, headers) + req = QueryAccessAuthsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2351,30 +2423,30 @@ def query_subscription_keys(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), - (['--name'], dict(help="""(string) 密钥名称 """, dest='name', required=False)), + (['--access-auth-view'], dict(help="""(accessAuthView) api分组 """, dest='accessAuthView', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建密钥 ''', + help=''' 创建访问授权 ''', description=''' - 创建密钥。 + 创建访问授权。 - 示例: jdc apigateway create-subscription-key + 示例: jdc apigateway create-access-auth ''', ) - def create_subscription_key(self): + def create_access_auth(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CreateSubscriptionKeyRequest import CreateSubscriptionKeyRequest + from jdcloud_sdk.services.apigateway.apis.CreateAccessAuthRequest import CreateAccessAuthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateSubscriptionKeyRequest(params_dict, headers) + req = CreateAccessAuthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2385,29 +2457,31 @@ def create_subscription_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--subscription-key-id'], dict(help="""(string) subscription key id """, dest='subscriptionKeyId', required=True)), + (['--access-key'], dict(help="""(string) NA """, dest='accessKey', required=True)), + (['--auth-user-type'], dict(help="""(string) NA """, dest='authUserType', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个密钥 ''', + help=''' 检查accessAuth是否重复 ''', description=''' - 查询单个密钥。 + 检查accessAuth是否重复。 - 示例: jdc apigateway query-subscription-key --subscription-key-id xxx + 示例: jdc apigateway check-auth-exist --access-key xxx --auth-user-type xxx ''', ) - def query_subscription_key(self): + def check_auth_exist(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QuerySubscriptionKeyRequest import QuerySubscriptionKeyRequest + from jdcloud_sdk.services.apigateway.apis.CheckAuthExistRequest import CheckAuthExistRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QuerySubscriptionKeyRequest(params_dict, headers) + req = CheckAuthExistRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2418,31 +2492,30 @@ def query_subscription_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--subscription-key-id'], dict(help="""(string) subscription key id """, dest='subscriptionKeyId', required=True)), - (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), - (['--name'], dict(help="""(string) 密钥名称 """, dest='name', required=False)), + (['--access-auth-id'], dict(help="""(string) 访问授权ID """, dest='accessAuthId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新密钥 ''', + help=''' 查询单个访问授权 ''', description=''' - 更新密钥。 + 查询单个访问授权。 - 示例: jdc apigateway update-subscription-key --subscription-key-id xxx + 示例: jdc apigateway query-access-auth --access-auth-id xxx ''', ) - def update_subscription_key(self): + def query_access_auth(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.UpdateSubscriptionKeyRequest import UpdateSubscriptionKeyRequest + from jdcloud_sdk.services.apigateway.apis.QueryAccessAuthRequest import QueryAccessAuthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateSubscriptionKeyRequest(params_dict, headers) + req = QueryAccessAuthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2453,29 +2526,31 @@ def update_subscription_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--subscription-key-id'], dict(help="""(string) subscription key id """, dest='subscriptionKeyId', required=True)), + (['--access-auth-id'], dict(help="""(string) 访问授权ID """, dest='accessAuthId', required=True)), + (['--access-auth-view'], dict(help="""(accessAuthView) 访问授权详情 """, dest='accessAuthView', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除密钥 ''', + help=''' 更新访问授权 ''', description=''' - 删除密钥。 + 更新访问授权。 - 示例: jdc apigateway delete-subscription-key --subscription-key-id xxx + 示例: jdc apigateway update-access-auth --access-auth-id xxx ''', ) - def delete_subscription_key(self): + def update_access_auth(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DeleteSubscriptionKeyRequest import DeleteSubscriptionKeyRequest + from jdcloud_sdk.services.apigateway.apis.UpdateAccessAuthRequest import UpdateAccessAuthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteSubscriptionKeyRequest(params_dict, headers) + req = UpdateAccessAuthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2486,31 +2561,30 @@ def delete_subscription_key(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) accessKey - accesskey,精确匹配; """, dest='filters', required=False)), + (['--access-auth-id'], dict(help="""(string) 访问授权ID """, dest='accessAuthId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询密钥列表 ''', + help=''' 删除访问授权 ''', description=''' - 查询密钥列表。 + 删除访问授权。 - 示例: jdc apigateway query-uc-access-keys + 示例: jdc apigateway delete-access-auth --access-auth-id xxx ''', ) - def query_uc_access_keys(self): + def delete_access_auth(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryUcAccessKeysRequest import QueryUcAccessKeysRequest + from jdcloud_sdk.services.apigateway.apis.DeleteAccessAuthRequest import DeleteAccessAuthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryUcAccessKeysRequest(params_dict, headers) + req = DeleteAccessAuthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2521,29 +2595,30 @@ def query_uc_access_keys(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--pin'], dict(help="""(string) 京东云pin """, dest='pin', required=True)), + (['--access-auth-id'], dict(help="""(string) 访问授权ID """, dest='accessAuthId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 校验pin是否存在 ''', + help=''' 查询已绑定详情 ''', description=''' - 校验pin是否存在。 + 查询已绑定详情。 - 示例: jdc apigateway check-pin --pin xxx + 示例: jdc apigateway query-bind-group-auth --access-auth-id xxx ''', ) - def check_pin(self): + def query_bind_group_auth(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CheckPinRequest import CheckPinRequest + from jdcloud_sdk.services.apigateway.apis.QueryBindGroupAuthRequest import QueryBindGroupAuthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CheckPinRequest(params_dict, headers) + req = QueryBindGroupAuthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2554,32 +2629,31 @@ def check_pin(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--order-by'], dict(help="""(string) 排序类型 """, dest='orderBy', required=False)), - (['--api-group-id'], dict(help="""(string) api分组id """, dest='apiGroupId', required=True)), + (['--access-auth-id'], dict(help="""(string) 访问授权ID """, dest='accessAuthId', required=True)), + (['--deployment-ids'], dict(help="""(string) 待绑定的部署ids逗号隔开 """, dest='deploymentIds', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询domian列表 ''', + help=''' 绑定分组 ''', description=''' - 查询domian列表。 + 绑定分组。 - 示例: jdc apigateway query-user-domains --api-group-id xxx + 示例: jdc apigateway bind-group-auth --access-auth-id xxx --deployment-ids xxx ''', ) - def query_user_domains(self): + def bind_group_auth(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.QueryUserDomainsRequest import QueryUserDomainsRequest + from jdcloud_sdk.services.apigateway.apis.BindGroupAuthRequest import BindGroupAuthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryUserDomainsRequest(params_dict, headers) + req = BindGroupAuthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2590,31 +2664,30 @@ def query_user_domains(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--domain'], dict(help="""(string) 域名 """, dest='domain', required=True)), - (['--protocol'], dict(help="""(string) 协议 """, dest='protocol', required=False)), - (['--api-group-id'], dict(help="""(string) api分组id """, dest='apiGroupId', required=True)), + (['--auth-user-type'], dict(help="""(string) 待绑定的用户类型 """, dest='authUserType', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加用户域名 ''', + help=''' 查询可绑定部署列表 ''', description=''' - 添加用户域名。 + 查询可绑定部署列表。 - 示例: jdc apigateway create-user-domain --domain xxx --api-group-id xxx + 示例: jdc apigateway query-auth-group-list --auth-user-type xxx ''', ) - def create_user_domain(self): + def query_auth_group_list(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.CreateUserDomainRequest import CreateUserDomainRequest + from jdcloud_sdk.services.apigateway.apis.QueryAuthGroupListRequest import QueryAuthGroupListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateUserDomainRequest(params_dict, headers) + req = QueryAuthGroupListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2625,30 +2698,32 @@ def create_user_domain(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--domain-ids'], dict(help="""(string) 要删除domain的id集合,以,分隔 """, dest='domainIds', required=True)), - (['--api-group-id'], dict(help="""(string) api分组id """, dest='apiGroupId', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) apiGroupName - 名称,模糊匹配; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除用户域名接口 ''', + help=''' 查询所有已授权api分组列表 ''', description=''' - 删除用户域名接口。 + 查询所有已授权api分组列表。 - 示例: jdc apigateway delete-user-domain --domain-ids xxx + 示例: jdc apigateway authorized-api-group-list ''', ) - def delete_user_domain(self): + def authorized_api_group_list(self): client_factory = ClientFactory('apigateway') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.apigateway.apis.DeleteUserDomainRequest import DeleteUserDomainRequest + from jdcloud_sdk.services.apigateway.apis.AuthorizedApiGroupListRequest import AuthorizedApiGroupListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteUserDomainRequest(params_dict, headers) + req = AuthorizedApiGroupListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2658,7 +2733,7 @@ def delete_user_domain(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['query-access-auths','create-access-auth','check-auth-exist','query-access-auth','update-access-auth','delete-access-auth','query-bind-group-auth','bind-group-auth','query-auth-group-list','authorized-api-group-list','query-access-keys','create-access-key','check-key-exist','query-access-key','update-access-key','delete-access-key','query-bind-group-key','bind-group-key','query-key-group-list','query-apis','create-apis','check-api-name-exist','query-api','update-api','delete-api','update-api-by-name','delete-api-by-name','describe-api-groups','create-api-group','check-group-name-exist','describe-api-group','modify-api-group-attribute','delete-api-group','describe-is-deploy-api-groups','create-backend-config','describe-backend-configs','describe-backend-config','update-backend-config','delete-backend-config','describe-deployments','deploy','describe-deployment','offline','batch-offline','query-keys','create-key','reset-key','update-key','query-key-info','query-rate-limit-policies','create-rate-limit-policy','check-policy-name','query-rate-limit-policy','update-rate-limit-policy','delete-rate-limit-policy','query-bind-group-policy','bind-group-policy','query-policy-group-list','describe-revisions','create-revision','get-revision-ids','check-revision-exist','query-revision','modify-revision','delete-revision','query-subscription-keys','create-subscription-key','query-subscription-key','update-subscription-key','delete-subscription-key','query-uc-access-keys','check-pin','query-user-domains','create-user-domain','delete-user-domain',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['query-user-domains','create-user-domain','delete-user-domain','create-backend-config','describe-backend-configs','describe-backend-config','update-backend-config','delete-backend-config','query-uc-access-keys','query-keys','create-key','reset-key','update-key','query-key-info','describe-api-groups','create-api-group','check-group-name-exist','describe-api-group','modify-api-group-attribute','delete-api-group','describe-is-deploy-api-groups','query-rate-limit-policies','create-rate-limit-policy','check-policy-name','query-rate-limit-policy','update-rate-limit-policy','delete-rate-limit-policy','query-bind-group-policy','bind-group-policy','query-policy-group-list','query-subscription-keys','create-subscription-key','query-subscription-key','update-subscription-key','delete-subscription-key','query-access-keys','create-access-key','check-key-exist','query-access-key','update-access-key','delete-access-key','query-bind-group-key','bind-group-key','query-key-group-list','check-pin','query-apis','create-apis','check-api-name-exist','query-api','update-api','delete-api','update-api-by-name','delete-api-by-name','describe-deployments','deploy','describe-deployment','offline','batch-offline','describe-revisions','create-revision','get-revision-ids','check-revision-exist','query-revision','modify-revision','delete-revision','query-access-auths','create-access-auth','check-auth-exist','query-access-auth','update-access-auth','delete-access-auth','query-bind-group-auth','bind-group-auth','query-auth-group-list','authorized-api-group-list',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/baseanti.py b/jdcloud_cli/controllers/services/baseanti.py index 7197f28..5dd3426 100644 --- a/jdcloud_cli/controllers/services/baseanti.py +++ b/jdcloud_cli/controllers/services/baseanti.py @@ -38,33 +38,31 @@ class Meta: @expose( arguments=[ - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小 """, dest='pageSize', type=int, required=False)), - (['--start-time'], dict(help="""(string) 开始时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=True)), - (['--ip'], dict(help="""(array: string) 基础防护已防护的公网 IP, ip 不为空时, 查询 ip 对应的攻击记录, ip 为空时, 查询用户所有攻击记录
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网IP 和 弹性公网 IP
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=False)), + (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), + (['--ip'], dict(help="""(string) IP 模糊匹配 """, dest='ip', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询攻击记录 ''', + help=''' 查询基础防护已防护的公网 IP 的安全信息列表. 包括私有网络的弹性公网 IP(运营商级 NAT 保留地址除外), 云物理服务器的公网 IP 和弹性公网 IP. (已废弃, 建议使用 describeElasticIpResources, describeCpsIpResources 接口) ''', description=''' - 查询攻击记录。 + 查询基础防护已防护的公网 IP 的安全信息列表. 包括私有网络的弹性公网 IP(运营商级 NAT 保留地址除外), 云物理服务器的公网 IP 和弹性公网 IP. (已废弃, 建议使用 describeElasticIpResources, describeCpsIpResources 接口)。 - 示例: jdc baseanti describe-attack-logs --start-time xxx --end-time xxx + 示例: jdc baseanti describe-ip-resources ''', ) - def describe_attack_logs(self): + def describe_ip_resources(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeAttackLogsRequest import DescribeAttackLogsRequest + from jdcloud_sdk.services.baseanti.apis.DescribeIpResourcesRequest import DescribeIpResourcesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAttackLogsRequest(params_dict, headers) + req = DescribeIpResourcesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -74,31 +72,33 @@ def describe_attack_logs(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 开始时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=True)), - (['--ip'], dict(help="""(array: string) 基础防护已防护的公网 IP, ip 不为空时, 统计 ip 对应的攻击情况, ip 为空时, 统计用户所有公网 IP 的攻击情况.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP.
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网IP 和 弹性公网 IP.
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=False)), + (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小 """, dest='pageSize', type=int, required=False)), + (['--ip'], dict(help="""(string) IP 模糊匹配 """, dest='ip', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 攻击情况统计 ''', + help=''' 查询基础防护已防护的私有网络的弹性公网 IP 的安全信息. 包括私有网络的弹性公网 IP(运营商级 NAT 保留地址除外); ''', description=''' - 攻击情况统计。 + 查询基础防护已防护的私有网络的弹性公网 IP 的安全信息. 包括私有网络的弹性公网 IP(运营商级 NAT 保留地址除外); 。 - 示例: jdc baseanti describe-attack-statistics --start-time xxx --end-time xxx + 示例: jdc baseanti describe-elastic-ip-resources ''', ) - def describe_attack_statistics(self): + def describe_elastic_ip_resources(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeAttackStatisticsRequest import DescribeAttackStatisticsRequest + from jdcloud_sdk.services.baseanti.apis.DescribeElasticIpResourcesRequest import DescribeElasticIpResourcesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAttackStatisticsRequest(params_dict, headers) + req = DescribeElasticIpResourcesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -108,31 +108,33 @@ def describe_attack_statistics(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 开始时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=True)), - (['--ip'], dict(help="""(array: string) 基础防护已防护的公网 IP, ip 不为空时, 查询 ip 对应的各类型攻击次数, ip 为空时, 查询用户所有公网 IP 的各类型攻击次数.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP.
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网IP 和 弹性公网 IP.
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=False)), + (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小 """, dest='pageSize', type=int, required=False)), + (['--ip'], dict(help="""(string) IP 模糊匹配 """, dest='ip', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询各类型攻击次数 ''', + help=''' 查询基础防护已防护的云物理服务器公网 IP 的安全信息. 包括云物理服务器的公网 IP 和弹性公网 IP.; ''', description=''' - 查询各类型攻击次数。 + 查询基础防护已防护的云物理服务器公网 IP 的安全信息. 包括云物理服务器的公网 IP 和弹性公网 IP.; 。 - 示例: jdc baseanti describe-attack-type-count --start-time xxx --end-time xxx + 示例: jdc baseanti describe-cps-ip-resources ''', ) - def describe_attack_type_count(self): + def describe_cps_ip_resources(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeAttackTypeCountRequest import DescribeAttackTypeCountRequest + from jdcloud_sdk.services.baseanti.apis.DescribeCpsIpResourcesRequest import DescribeCpsIpResourcesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAttackTypeCountRequest(params_dict, headers) + req = DescribeCpsIpResourcesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -142,31 +144,33 @@ def describe_attack_type_count(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 开始时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=True)), - (['--ip'], dict(help="""(array: string) 基础防护已防护的公网 IP.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP.
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网IP 和 弹性公网 IP.
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=False)), + (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小 """, dest='pageSize', type=int, required=False)), + (['--ip'], dict(help="""(string) IP 模糊匹配 """, dest='ip', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询多个公网 IP 的监控流量, 支持 ipv4 和 ipv6 ''', + help=''' 查询基础防护已防护的托管区 IP 的安全信息 ''', description=''' - 查询多个公网 IP 的监控流量, 支持 ipv4 和 ipv6。 + 查询基础防护已防护的托管区 IP 的安全信息。 - 示例: jdc baseanti describe-ip-monitor-flow --start-time xxx --end-time xxx + 示例: jdc baseanti describe-ccs-ip-resources ''', ) - def describe_ip_monitor_flow(self): + def describe_ccs_ip_resources(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeIpMonitorFlowRequest import DescribeIpMonitorFlowRequest + from jdcloud_sdk.services.baseanti.apis.DescribeCcsIpResourcesRequest import DescribeCcsIpResourcesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeIpMonitorFlowRequest(params_dict, headers) + req = DescribeCcsIpResourcesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -177,29 +181,32 @@ def describe_ip_monitor_flow(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小 """, dest='pageSize', type=int, required=False)), (['--ip'], dict(help="""(string) IP 模糊匹配 """, dest='ip', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询基础防护已防护的公网 IP 的安全信息列表. 包括私有网络的弹性公网 IP(运营商级 NAT 保留地址除外), 云物理服务器的公网 IP 和弹性公网 IP. (已废弃, 建议使用 describeElasticIpResources, describeCpsIpResources 接口) ''', + help=''' 查询基础防护已防护的Web应用防火墙 IP 的安全信息 ''', description=''' - 查询基础防护已防护的公网 IP 的安全信息列表. 包括私有网络的弹性公网 IP(运营商级 NAT 保留地址除外), 云物理服务器的公网 IP 和弹性公网 IP. (已废弃, 建议使用 describeElasticIpResources, describeCpsIpResources 接口)。 + 查询基础防护已防护的Web应用防火墙 IP 的安全信息。 - 示例: jdc baseanti describe-ip-resources + 示例: jdc baseanti describe-waf-ip-resources ''', ) - def describe_ip_resources(self): + def describe_waf_ip_resources(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeIpResourcesRequest import DescribeIpResourcesRequest + from jdcloud_sdk.services.baseanti.apis.DescribeWafIpResourcesRequest import DescribeWafIpResourcesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeIpResourcesRequest(params_dict, headers) + req = DescribeWafIpResourcesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -210,30 +217,30 @@ def describe_ip_resources(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小 """, dest='pageSize', type=int, required=False)), + (['--ip'], dict(help="""(string) 基础防护已防护的公网 IP, 仅支持 ipv4 格式.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网 IP 和 弹性公网 IP
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询基础防护已防护的私有网络的弹性公网 IP 的安全信息. 包括私有网络的弹性公网 IP(运营商级 NAT 保留地址除外); ''', + help=''' 查询公网 IP 安全信息, 仅支持 ipv4. (已废弃, 建议使用 describeIpSafetyInfo 接口); ''', description=''' - 查询基础防护已防护的私有网络的弹性公网 IP 的安全信息. 包括私有网络的弹性公网 IP(运营商级 NAT 保留地址除外); 。 + 查询公网 IP 安全信息, 仅支持 ipv4. (已废弃, 建议使用 describeIpSafetyInfo 接口); 。 - 示例: jdc baseanti describe-elastic-ip-resources + 示例: jdc baseanti describe-ip-resource-info --ip xxx ''', ) - def describe_elastic_ip_resources(self): + def describe_ip_resource_info(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeElasticIpResourcesRequest import DescribeElasticIpResourcesRequest + from jdcloud_sdk.services.baseanti.apis.DescribeIpResourceInfoRequest import DescribeIpResourceInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeElasticIpResourcesRequest(params_dict, headers) + req = DescribeIpResourceInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -244,30 +251,30 @@ def describe_elastic_ip_resources(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小 """, dest='pageSize', type=int, required=False)), + (['--ip'], dict(help="""(string) 基础防护已防护公网 IP, 支持 ipv4 和 ipv6. ;
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP;
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网IP 和 弹性公网 IP;
- 使用 describeWafIpResources 接口查询基础防护已防护的Web应用防火墙 IP;
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP; """, dest='ip', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询基础防护已防护的云物理服务器公网 IP 的安全信息. 包括云物理服务器的公网 IP 和弹性公网 IP.; ''', + help=''' 查询基础防护已防护公网 IP 安全信息, 支持 ipv4 和 ipv6 ''', description=''' - 查询基础防护已防护的云物理服务器公网 IP 的安全信息. 包括云物理服务器的公网 IP 和弹性公网 IP.; 。 + 查询基础防护已防护公网 IP 安全信息, 支持 ipv4 和 ipv6。 - 示例: jdc baseanti describe-cps-ip-resources + 示例: jdc baseanti describe-ip-safety-info --ip xxx ''', ) - def describe_cps_ip_resources(self): + def describe_ip_safety_info(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeCpsIpResourcesRequest import DescribeCpsIpResourcesRequest + from jdcloud_sdk.services.baseanti.apis.DescribeIpSafetyInfoRequest import DescribeIpSafetyInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCpsIpResourcesRequest(params_dict, headers) + req = DescribeIpSafetyInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -278,30 +285,31 @@ def describe_cps_ip_resources(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小 """, dest='pageSize', type=int, required=False)), + (['--ip'], dict(help="""(string) 基础防护已防护的公网 IP, 仅支持 ipv4 格式.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网 IP 和 弹性公网 IP
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=True)), + (['--clean-threshold-spec'], dict(help="""(cleanThresholdSpec) 请求参数 """, dest='cleanThresholdSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询基础防护已防护的托管区 IP 的安全信息 ''', + help=''' 设置基础防护已防护公网 IP 的清洗阈值, 仅支持 ipv4. (已废弃, 建议使用 setIpCleanThreshold 接口); ''', description=''' - 查询基础防护已防护的托管区 IP 的安全信息。 + 设置基础防护已防护公网 IP 的清洗阈值, 仅支持 ipv4. (已废弃, 建议使用 setIpCleanThreshold 接口); 。 - 示例: jdc baseanti describe-ccs-ip-resources + 示例: jdc baseanti set-clean-threshold --ip xxx --clean-threshold-spec '{"":""}' ''', ) - def describe_ccs_ip_resources(self): + def set_clean_threshold(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeCcsIpResourcesRequest import DescribeCcsIpResourcesRequest + from jdcloud_sdk.services.baseanti.apis.SetCleanThresholdRequest import SetCleanThresholdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCcsIpResourcesRequest(params_dict, headers) + req = SetCleanThresholdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -312,29 +320,30 @@ def describe_ccs_ip_resources(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), - (['--ip'], dict(help="""(string) 基础防护已防护的公网 IP, 仅支持 ipv4 格式.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网 IP 和 弹性公网 IP
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=True)), + (['--ip-clean-threshold-spec'], dict(help="""(ipCleanThresholdSpec) 请求参数 """, dest='ipCleanThresholdSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询公网 IP 安全信息, 仅支持 ipv4. (已废弃, 建议使用 describeIpSafetyInfo 接口); ''', + help=''' 设置基础防护已防护公网 IP 的清洗阈值, 支持 ipv4 和 ipv6 ''', description=''' - 查询公网 IP 安全信息, 仅支持 ipv4. (已废弃, 建议使用 describeIpSafetyInfo 接口); 。 + 设置基础防护已防护公网 IP 的清洗阈值, 支持 ipv4 和 ipv6。 - 示例: jdc baseanti describe-ip-resource-info --ip xxx + 示例: jdc baseanti set-ip-clean-threshold --ip-clean-threshold-spec '{"":""}' ''', ) - def describe_ip_resource_info(self): + def set_ip_clean_threshold(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeIpResourceInfoRequest import DescribeIpResourceInfoRequest + from jdcloud_sdk.services.baseanti.apis.SetIpCleanThresholdRequest import SetIpCleanThresholdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeIpResourceInfoRequest(params_dict, headers) + req = SetIpCleanThresholdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -345,29 +354,30 @@ def describe_ip_resource_info(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), - (['--ip'], dict(help="""(string) 基础防护已防护公网 IP.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网IP 和 弹性公网 IP
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=True)), + (['--ip'], dict(help="""(string) 基础防护已防护公网 IP, 支持 ipv4 和 ipv6. ;
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP;
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网IP 和 弹性公网 IP;
- 使用 describeWafIpResources 接口查询基础防护已防护的Web应用防火墙 IP;
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP; """, dest='ip', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询基础防护已防护公网 IP 安全信息, 支持 ipv4 和 ipv6 ''', + help=''' 查询公网 IP 可设置清洗阈值范围, 支持 ipv4 和 ipv6 ''', description=''' - 查询基础防护已防护公网 IP 安全信息, 支持 ipv4 和 ipv6。 + 查询公网 IP 可设置清洗阈值范围, 支持 ipv4 和 ipv6。 - 示例: jdc baseanti describe-ip-safety-info --ip xxx + 示例: jdc baseanti describe-ip-clean-threshold-range --ip xxx ''', ) - def describe_ip_safety_info(self): + def describe_ip_clean_threshold_range(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeIpSafetyInfoRequest import DescribeIpSafetyInfoRequest + from jdcloud_sdk.services.baseanti.apis.DescribeIpCleanThresholdRangeRequest import DescribeIpCleanThresholdRangeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeIpSafetyInfoRequest(params_dict, headers) + req = DescribeIpCleanThresholdRangeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -379,29 +389,31 @@ def describe_ip_safety_info(self): arguments=[ (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), (['--ip'], dict(help="""(string) 基础防护已防护的公网 IP, 仅支持 ipv4 格式.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网 IP 和 弹性公网 IP
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=True)), - (['--clean-threshold-spec'], dict(help="""(cleanThresholdSpec) 请求参数 """, dest='cleanThresholdSpec', required=True)), + (['--start'], dict(help="""(int) 限制查询的开始范围 """, dest='start', type=int, required=False)), + (['--limit'], dict(help="""(int) 限制查询的记录数 """, dest='limit', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置基础防护已防护公网 IP 的清洗阈值, 仅支持 ipv4. (已废弃, 建议使用 setIpCleanThreshold 接口); ''', + help=''' 查询公网 IP 的攻击记录, 仅支持 ipv4. (已废弃, 建议使用 describeAttackLogs 接口); ''', description=''' - 设置基础防护已防护公网 IP 的清洗阈值, 仅支持 ipv4. (已废弃, 建议使用 setIpCleanThreshold 接口); 。 + 查询公网 IP 的攻击记录, 仅支持 ipv4. (已废弃, 建议使用 describeAttackLogs 接口); 。 - 示例: jdc baseanti set-clean-threshold --ip xxx --clean-threshold-spec '{"":""}' + 示例: jdc baseanti describe-ip-resource-protect-info --ip xxx ''', ) - def set_clean_threshold(self): + def describe_ip_resource_protect_info(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.SetCleanThresholdRequest import SetCleanThresholdRequest + from jdcloud_sdk.services.baseanti.apis.DescribeIpResourceProtectInfoRequest import DescribeIpResourceProtectInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetCleanThresholdRequest(params_dict, headers) + req = DescribeIpResourceProtectInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -412,29 +424,31 @@ def set_clean_threshold(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), - (['--ip-clean-threshold-spec'], dict(help="""(ipCleanThresholdSpec) 请求参数 """, dest='ipCleanThresholdSpec', required=True)), + (['--ip'], dict(help="""(string) 基础防护已防护的公网 IP, 仅支持 ipv4 格式.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网 IP 和 弹性公网 IP
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=True)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ, 为空时查询当前时间之前 15 分钟内监控流量 """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置基础防护已防护公网 IP 的清洗阈值, 支持 ipv4 和 ipv6 ''', + help=''' 查询公网 IP 的 endTime 之前 15 分钟内监控流量, 仅支持 ipv4. (已废弃, 建议使用 describeIpMonitorFlow 接口); ''', description=''' - 设置基础防护已防护公网 IP 的清洗阈值, 支持 ipv4 和 ipv6。 + 查询公网 IP 的 endTime 之前 15 分钟内监控流量, 仅支持 ipv4. (已废弃, 建议使用 describeIpMonitorFlow 接口); 。 - 示例: jdc baseanti set-ip-clean-threshold --ip-clean-threshold-spec '{"":""}' + 示例: jdc baseanti describe-ip-resource-flow --ip xxx ''', ) - def set_ip_clean_threshold(self): + def describe_ip_resource_flow(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.SetIpCleanThresholdRequest import SetIpCleanThresholdRequest + from jdcloud_sdk.services.baseanti.apis.DescribeIpResourceFlowRequest import DescribeIpResourceFlowRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetIpCleanThresholdRequest(params_dict, headers) + req = DescribeIpResourceFlowRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -444,30 +458,34 @@ def set_ip_clean_threshold(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), - (['--ip'], dict(help="""(string) 基础防护已防护公网 IP.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网IP 和 弹性公网 IP
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=True)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小 """, dest='pageSize', type=int, required=False)), + (['--start-time'], dict(help="""(string) 开始时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=True)), + (['--ip'], dict(help="""(array: string) 基础防护已防护的公网 IP, ip 不为空时, 查询 ip 对应的攻击记录, ip 为空时, 查询用户所有攻击记录
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网IP 和 弹性公网 IP
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询公网 IP 可设置清洗阈值范围, 支持 ipv4 和 ipv6 ''', + help=''' 查询攻击记录 ''', description=''' - 查询公网 IP 可设置清洗阈值范围, 支持 ipv4 和 ipv6。 + 查询攻击记录。 - 示例: jdc baseanti describe-ip-clean-threshold-range --ip xxx + 示例: jdc baseanti describe-attack-logs --start-time xxx --end-time xxx ''', ) - def describe_ip_clean_threshold_range(self): + def describe_attack_logs(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeIpCleanThresholdRangeRequest import DescribeIpCleanThresholdRangeRequest + from jdcloud_sdk.services.baseanti.apis.DescribeAttackLogsRequest import DescribeAttackLogsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeIpCleanThresholdRangeRequest(params_dict, headers) + req = DescribeAttackLogsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -477,32 +495,32 @@ def describe_ip_clean_threshold_range(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), - (['--ip'], dict(help="""(string) 基础防护已防护的公网 IP, 仅支持 ipv4 格式.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网 IP 和 弹性公网 IP
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=True)), - (['--start'], dict(help="""(int) 限制查询的开始范围 """, dest='start', type=int, required=False)), - (['--limit'], dict(help="""(int) 限制查询的记录数 """, dest='limit', type=int, required=False)), + (['--start-time'], dict(help="""(string) 开始时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=True)), + (['--ip'], dict(help="""(array: string) 基础防护已防护的公网 IP, ip 不为空时, 统计 ip 对应的攻击情况, ip 为空时, 统计用户所有公网 IP 的攻击情况.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP.
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网IP 和 弹性公网 IP.
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询公网 IP 的攻击记录, 仅支持 ipv4. (已废弃, 建议使用 describeAttackLogs 接口); ''', + help=''' 攻击情况统计 ''', description=''' - 查询公网 IP 的攻击记录, 仅支持 ipv4. (已废弃, 建议使用 describeAttackLogs 接口); 。 + 攻击情况统计。 - 示例: jdc baseanti describe-ip-resource-protect-info --ip xxx + 示例: jdc baseanti describe-attack-statistics --start-time xxx --end-time xxx ''', ) - def describe_ip_resource_protect_info(self): + def describe_attack_statistics(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeIpResourceProtectInfoRequest import DescribeIpResourceProtectInfoRequest + from jdcloud_sdk.services.baseanti.apis.DescribeAttackStatisticsRequest import DescribeAttackStatisticsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeIpResourceProtectInfoRequest(params_dict, headers) + req = DescribeAttackStatisticsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -512,31 +530,67 @@ def describe_ip_resource_protect_info(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域编码. 基础防护已支持华北-北京, 华东-宿迁, 华东-上海, 华南-广州 """, dest='regionId', required=False)), - (['--ip'], dict(help="""(string) 基础防护已防护的公网 IP, 仅支持 ipv4 格式.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网 IP 和 弹性公网 IP
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=True)), - (['--end-time'], dict(help="""(string) 查询的结束时间, UTC时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ, 为空时查询当前时间之前 15 分钟内监控流量 """, dest='endTime', required=False)), + (['--start-time'], dict(help="""(string) 开始时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=True)), + (['--ip'], dict(help="""(array: string) 基础防护已防护的公网 IP, ip 不为空时, 查询 ip 对应的各类型攻击次数, ip 为空时, 查询用户所有公网 IP 的各类型攻击次数.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP.
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网IP 和 弹性公网 IP.
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询公网 IP 的 endTime 之前 15 分钟内监控流量, 仅支持 ipv4. (已废弃, 建议使用 describeIpMonitorFlow 接口); ''', + help=''' 查询各类型攻击次数 ''', description=''' - 查询公网 IP 的 endTime 之前 15 分钟内监控流量, 仅支持 ipv4. (已废弃, 建议使用 describeIpMonitorFlow 接口); 。 + 查询各类型攻击次数。 - 示例: jdc baseanti describe-ip-resource-flow --ip xxx + 示例: jdc baseanti describe-attack-type-count --start-time xxx --end-time xxx ''', ) - def describe_ip_resource_flow(self): + def describe_attack_type_count(self): client_factory = ClientFactory('baseanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.baseanti.apis.DescribeIpResourceFlowRequest import DescribeIpResourceFlowRequest + from jdcloud_sdk.services.baseanti.apis.DescribeAttackTypeCountRequest import DescribeAttackTypeCountRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeIpResourceFlowRequest(params_dict, headers) + req = DescribeAttackTypeCountRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--start-time'], dict(help="""(string) 开始时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=True)), + (['--ip'], dict(help="""(array: string) 基础防护已防护的公网 IP.
- 使用 describeElasticIpResources 接口查询基础防护已防护的私有网络弹性公网 IP.
- 使用 describeCpsIpResources 接口查询基础防护已防护的云物理服务器公网IP 和 弹性公网 IP.
- 使用 describeCcsIpResources 接口查询基础防护已防护的托管区公网 IP """, dest='ip', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询多个公网 IP 的监控流量, 支持 ipv4 和 ipv6 ''', + description=''' + 查询多个公网 IP 的监控流量, 支持 ipv4 和 ipv6。 + + 示例: jdc baseanti describe-ip-monitor-flow --start-time xxx --end-time xxx + ''', + ) + def describe_ip_monitor_flow(self): + client_factory = ClientFactory('baseanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.baseanti.apis.DescribeIpMonitorFlowRequest import DescribeIpMonitorFlowRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeIpMonitorFlowRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -546,7 +600,7 @@ def describe_ip_resource_flow(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-attack-logs','describe-attack-statistics','describe-attack-type-count','describe-ip-monitor-flow','describe-ip-resources','describe-elastic-ip-resources','describe-cps-ip-resources','describe-ccs-ip-resources','describe-ip-resource-info','describe-ip-safety-info','set-clean-threshold','set-ip-clean-threshold','describe-ip-clean-threshold-range','describe-ip-resource-protect-info','describe-ip-resource-flow',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-ip-resources','describe-elastic-ip-resources','describe-cps-ip-resources','describe-ccs-ip-resources','describe-waf-ip-resources','describe-ip-resource-info','describe-ip-safety-info','set-clean-threshold','set-ip-clean-threshold','describe-ip-clean-threshold-range','describe-ip-resource-protect-info','describe-ip-resource-flow','describe-attack-logs','describe-attack-statistics','describe-attack-type-count','describe-ip-monitor-flow',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/billing.py b/jdcloud_cli/controllers/services/billing.py index f05133b..2216fd2 100644 --- a/jdcloud_cli/controllers/services/billing.py +++ b/jdcloud_cli/controllers/services/billing.py @@ -44,10 +44,11 @@ class Meta: (['--app-code'], dict(help="""(string) 产品线代码 """, dest='appCode', required=False)), (['--service-code'], dict(help="""(string) 产品代码 """, dest='serviceCode', required=False)), (['--resource-ids'], dict(help="""(array: string) 资源单id列表,最多支持传入500个 """, dest='resourceIds', required=False)), - (['--tags'], dict(help="""(array: object) 标签 """, dest='tags', required=False)), + (['--tags'], dict(help="""(array: object) 标签,JSON格式:[{"k1":"v1"},{"k1":"v2"},{"k2":""}]; 示例:; 选择的标签为, 部门:广告部、部门:物流部、项目; 则传值为:[{"部门":"广告部"},{"部门":"物流部"},{"项目":""}]; """, dest='tags', required=False)), (['--page-index'], dict(help="""(int) pageIndex 分页,默认从1开始 """, dest='pageIndex', type=int, required=False)), (['--page-size'], dict(help="""(int) pageSize 每页查询数据条数,最多支持1000条 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -85,10 +86,11 @@ def query_bill_summary(self): (['--service-code'], dict(help="""(string) 产品代码 """, dest='serviceCode', required=False)), (['--billing-type'], dict(help="""(int) 计费类型 1、按配置 2、按用量 3、包年包月 4、按次 """, dest='billingType', type=int, required=False)), (['--resource-ids'], dict(help="""(array: string) 资源单id列表,最多支持传入500个 """, dest='resourceIds', required=False)), - (['--tags'], dict(help="""(array: object) 标签 """, dest='tags', required=False)), + (['--tags'], dict(help="""(array: object) 标签,JSON格式:[{"k1":"v1"},{"k1":"v2"},{"k2":""}]; 示例:; 选择的标签为, 部门:广告部、部门:物流部、项目; 则传值为:[{"部门":"广告部"},{"部门":"物流部"},{"项目":""}]; """, dest='tags', required=False)), (['--page-index'], dict(help="""(int) pageIndex 分页,默认从1开始 """, dest='pageIndex', type=int, required=False)), (['--page-size'], dict(help="""(int) pageSize 每页查询数据条数,最多支持1000条 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -122,12 +124,16 @@ def query_bill_detail(self): (['--region-id'], dict(help="""(string) NA """, dest='regionId', required=False)), (['--cmd'], dict(help="""(int) 操作类型 1:创建 2:续费 3:升配 4:删除 """, dest='cmd', type=int, required=True)), (['--order-list'], dict(help="""(array: orderPriceProtocol) 计算价格的订单 """, dest='orderList', required=False)), - (['--operate-time'], dict(help="""(string) 操作时间,遵循ISO8601标准,使用UTC时间,格式为:YYYY-MM-DDTHH:mm:ssZ """, dest='operateTime', required=False)), + (['--operate-time'], dict(help="""(string) 操作时间(格式为:yyyy-MM-dd HH:mm:ss) """, dest='operateTime', required=False)), (['--promotion-info'], dict(help="""(string) 1:折扣(不需要传) 2:免费活动3:付费活动 4:推荐码 5:会员价 [{"promotionType":1,"activityCode":123},{"promotionType":2,"activityCode":}] """, dest='promotionInfo', required=False)), (['--client-type'], dict(help="""(int) 客户端:1.PC端;2.移动端; """, dest='clientType', type=int, required=False)), (['--package-count'], dict(help="""(int) 批量购买时数量 """, dest='packageCount', type=int, required=True)), (['--process-type'], dict(help="""(int) 临时升配时必传,3-临时升配 """, dest='processType', type=int, required=False)), + (['--renew-mode'], dict(help="""(int) 续费方式 0:正常续费 1:续费至统一到期日,续费时必传 """, dest='renewMode', type=int, required=False)), + (['--unify-expire-day'], dict(help="""(int) 续费统一到期日(1-28),续费时必传 """, dest='unifyExpireDay', type=int, required=False)), + (['--total-price-rule'], dict(help="""(int) 计算总价规则 1:计算预付费资源总价(计费类型为包年包月、按次) ;不传计算所有资源总价 """, dest='totalPriceRule', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -135,7 +141,7 @@ def query_bill_detail(self): description=''' 查询计费价格信息。 - 示例: jdc billing calculate-total-price --cmd 0 --package-count 0 + 示例: jdc billing calculate-total-price --cmd 5 --package-count 5 ''', ) def calculate_total_price(self): diff --git a/jdcloud_cli/controllers/services/cdn.py b/jdcloud_cli/controllers/services/cdn.py index 8699c82..fad2390 100644 --- a/jdcloud_cli/controllers/services/cdn.py +++ b/jdcloud_cli/controllers/services/cdn.py @@ -38,33 +38,33 @@ class Meta: @expose( arguments=[ - (['--domains'], dict(help="""(array) NA """, dest='domains', required=False)), - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--interval'], dict(help="""(string) 时间间隔,取值(hour,day,fiveMin),不传默认小时。 """, dest='interval', required=False)), - (['--log-type'], dict(help="""(string) 日志类型,取值(log,zip,gz),不传默认gz。 """, dest='logType', required=False)), + (['--query-domain'], dict(help="""(string) 封禁域名,模糊查询 """, dest='queryDomain', required=False)), + (['--forbidden-url'], dict(help="""(string) 封禁url,精确查询 """, dest='forbiddenUrl', required=False)), + (['--page-number'], dict(help="""(int) 页码数 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页size """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量域名查询日志 ''', + help=''' 查询封禁信息 ''', description=''' - 批量域名查询日志。 + 查询封禁信息。 - 示例: jdc cdn query-domains-log + 示例: jdc cdn query-forbidden-info-list ''', ) - def query_domains_log(self): + def query_forbidden_info_list(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryDomainsLogRequest import QueryDomainsLogRequest + from jdcloud_sdk.services.cdn.apis.QueryForbiddenInfoListRequest import QueryForbiddenInfoListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDomainsLogRequest(params_dict, headers) + req = QueryForbiddenInfoListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -74,35 +74,36 @@ def query_domains_log(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--interval'], dict(help="""(string) 时间间隔,取值(hour,day,fiveMin),不传默认小时。 """, dest='interval', required=False)), - (['--log-type'], dict(help="""(string) 日志类型,取值(log,zip,gz),不传默认gz。 """, dest='logType', required=False)), - (['--page-size'], dict(help="""(int) 页面大小,默认值10 """, dest='pageSize', type=int, required=False)), - (['--page-number'], dict(help="""(int) 分页页数,默认值1 """, dest='pageNumber', type=int, required=False)), + (['--forbidden-type'], dict(help="""(string) 封禁类型,domain 域名封禁,url url封禁 """, dest='forbiddenType', required=False)), + (['--forbidden-domain'], dict(help="""(string) 封禁域名 """, dest='forbiddenDomain', required=False)), + (['--forbidden-url'], dict(help="""(string) 封禁url,多个以;隔开 """, dest='forbiddenUrl', required=False)), + (['--reason'], dict(help="""(string) 封禁原因 """, dest='reason', required=False)), + (['--link-other'], dict(help="""(string) y,n y表示是,n表示否 """, dest='linkOther', required=False)), + (['--share-cache-domain-flag'], dict(help="""(string) 是否同步操作共享缓存域名,0:仅操作本域名,1:同步操作共享缓存域名,默认为0 """, dest='shareCacheDomainFlag', required=False)), + (['--token'], dict(help="""(string) 用于封禁前缀识别的URL,应为单个特殊字符,如:~ """, dest='token', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询日志 ''', + help=''' 设置封禁 ''', description=''' - 查询日志。 + 设置封禁。 - 示例: jdc cdn query-domain-log --domain xxx + 示例: jdc cdn create-forbidden-info ''', ) - def query_domain_log(self): + def create_forbidden_info(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryDomainLogRequest import QueryDomainLogRequest + from jdcloud_sdk.services.cdn.apis.CreateForbiddenInfoRequest import CreateForbiddenInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDomainLogRequest(params_dict, headers) + req = CreateForbiddenInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -112,28 +113,34 @@ def query_domain_log(self): @expose( arguments=[ + (['--forbidden-type'], dict(help="""(string) 封禁类型,domain 域名封禁,url url封禁 """, dest='forbiddenType', required=False)), + (['--forbidden-domain'], dict(help="""(string) 封禁域名 """, dest='forbiddenDomain', required=False)), + (['--forbidden-url'], dict(help="""(string) 封禁url,多个以;隔开 """, dest='forbiddenUrl', required=False)), + (['--share-cache-domain-flag'], dict(help="""(string) 是否同步操作共享缓存域名,0:仅操作本域名,1:同步操作共享缓存域名,默认为0 """, dest='shareCacheDomainFlag', required=False)), + (['--token'], dict(help="""(string) 用于封禁前缀识别的URL,应为单个特殊字符,如:~ """, dest='token', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置线上计费方式 ''', + help=''' 删除封禁信息 ''', description=''' - 设置线上计费方式。 + 删除封禁信息。 - 示例: jdc cdn query-online-billing-type + 示例: jdc cdn delete-forbidden-info ''', ) - def query_online_billing_type(self): + def delete_forbidden_info(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryOnlineBillingTypeRequest import QueryOnlineBillingTypeRequest + from jdcloud_sdk.services.cdn.apis.DeleteForbiddenInfoRequest import DeleteForbiddenInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryOnlineBillingTypeRequest(params_dict, headers) + req = DeleteForbiddenInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -143,29 +150,34 @@ def query_online_billing_type(self): @expose( arguments=[ - (['--all-type'], dict(help="""(int) 计费方式,取值[0,1],0:日流量计费,1:日峰值带宽计费. """, dest='allType', type=int, required=False)), + (['--domain'], dict(help="""(string) 根据域名进行匹配 """, dest='domain', required=False)), + (['--url'], dict(help="""(string) 根据url进行匹配 """, dest='url', required=False)), + (['--task-id'], dict(help="""(string) 解封的任务id """, dest='taskId', required=False)), + (['--page-number'], dict(help="""(int) pageNumber,默认值1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) pageSize,最大值50,默认值10 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置线上计费方式 ''', + help=''' 查询解封状态 ''', description=''' - 设置线上计费方式。 + 查询解封状态。 - 示例: jdc cdn set-online-billing-type + 示例: jdc cdn query-un-forbidden-status ''', ) - def set_online_billing_type(self): + def query_un_forbidden_status(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetOnlineBillingTypeRequest import SetOnlineBillingTypeRequest + from jdcloud_sdk.services.cdn.apis.QueryUnForbiddenStatusRequest import QueryUnForbiddenStatusRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetOnlineBillingTypeRequest(params_dict, headers) + req = QueryUnForbiddenStatusRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -175,34 +187,32 @@ def set_online_billing_type(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--area'], dict(help="""(string) 地域 """, dest='area', required=False)), - (['--isp'], dict(help="""(string) 运营商 """, dest='isp', required=False)), - (['--period'], dict(help="""(string) 查询周期 """, dest='period', required=False)), + (['--url-list'], dict(help="""(array) 预热的URL """, dest='urlList', required=False)), + (['--prefetch-time'], dict(help="""(int) 预热时长 """, dest='prefetchTime', type=int, required=False)), + (['--action'], dict(help="""(string) 操作类型只能是[start,stop]中的一种 """, dest='action', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 带宽查询接口 ''', + help=''' 创建直播预热任务 ''', description=''' - 带宽查询接口。 + 创建直播预热任务。 - 示例: jdc cdn query-band + 示例: jdc cdn create-live-domain-prefecth-task ''', ) - def query_band(self): + def create_live_domain_prefecth_task(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryBandRequest import QueryBandRequest + from jdcloud_sdk.services.cdn.apis.CreateLiveDomainPrefecthTaskRequest import CreateLiveDomainPrefecthTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryBandRequest(params_dict, headers) + req = CreateLiveDomainPrefecthTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -212,34 +222,30 @@ def query_band(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--area'], dict(help="""(string) 地域 """, dest='area', required=False)), - (['--isp'], dict(help="""(string) 运营商 """, dest='isp', required=False)), - (['--period'], dict(help="""(string) 查询周期 """, dest='period', required=False)), + (['--url-list'], dict(help="""(array) 预热的URL """, dest='urlList', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 分地域运营商带宽查询接口 ''', + help=''' 查询直播预热任务 ''', description=''' - 分地域运营商带宽查询接口。 + 查询直播预热任务。 - 示例: jdc cdn query-band-with-area + 示例: jdc cdn query-live-prefetch-task ''', ) - def query_band_with_area(self): + def query_live_prefetch_task(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryBandWithAreaRequest import QueryBandWithAreaRequest + from jdcloud_sdk.services.cdn.apis.QueryLivePrefetchTaskRequest import QueryLivePrefetchTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryBandWithAreaRequest(params_dict, headers) + req = QueryLivePrefetchTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -249,29 +255,29 @@ def query_band_with_area(self): @expose( arguments=[ - (['--task-id'], dict(help="""(string) 任务ID """, dest='taskId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询域名配置状态 ''', + help=''' 查找地域运营商列表 ''', description=''' - 查询域名配置状态。 + 查找地域运营商列表。 - 示例: jdc cdn query-domain-config-status --task-id xxx + 示例: jdc cdn query-area-isp-list ''', ) - def query_domain_config_status(self): + def query_area_isp_list(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryDomainConfigStatusRequest import QueryDomainConfigStatusRequest + from jdcloud_sdk.services.cdn.apis.QueryAreaIspListRequest import QueryAreaIspListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDomainConfigStatusRequest(params_dict, headers) + req = QueryAreaIspListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -282,6 +288,7 @@ def query_domain_config_status(self): @expose( arguments=[ (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -289,20 +296,20 @@ def query_domain_config_status(self): description=''' 查找地域运营商列表。 - 示例: jdc cdn query-area-isp-list + 示例: jdc cdn query-area-isp-list-v2 ''', ) - def query_area_isp_list(self): + def query_area_isp_list_v2(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryAreaIspListRequest import QueryAreaIspListRequest + from jdcloud_sdk.services.cdn.apis.QueryAreaIspListV2Request import QueryAreaIspListV2Request params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryAreaIspListRequest(params_dict, headers) + req = QueryAreaIspListV2Request(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -312,30 +319,38 @@ def query_area_isp_list(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--content'], dict(help="""(string) NA """, dest='content', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), + (['--area'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔 """, dest='area', required=False)), + (['--isp'], dict(help="""(string) 查询的运营商,cmcc,cnc,ct,表示移动、联通、电信。多个用逗号分隔 """, dest='isp', required=False)), + (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), + (['--scheme'], dict(help="""(string) 查询协议,可选值:[http,https,all],传空默认返回全部协议汇总后的数据 """, dest='scheme', required=False)), + (['--cache-type'], dict(help="""(string) 查询节点层级,可选值:[all,edge,mid],默认查询all,edge边缘 mid中间 """, dest='cacheType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 预览证书 ''', + help=''' 查询统计数据,仅可查询中国境内的相关信息 ''', description=''' - 预览证书。 + 查询统计数据,仅可查询中国境内的相关信息。 - 示例: jdc cdn preview-certificate --domain xxx + 示例: jdc cdn query-mix-statistics-data ''', ) - def preview_certificate(self): + def query_mix_statistics_data(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.PreviewCertificateRequest import PreviewCertificateRequest + from jdcloud_sdk.services.cdn.apis.QueryMixStatisticsDataRequest import QueryMixStatisticsDataRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = PreviewCertificateRequest(params_dict, headers) + req = QueryMixStatisticsDataRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -345,28 +360,37 @@ def preview_certificate(self): @expose( arguments=[ + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), + (['--area'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔 """, dest='area', required=False)), + (['--isp'], dict(help="""(string) 查询的运营商,cmcc,cnc,ct,表示移动、联通、电信。多个用逗号分隔 """, dest='isp', required=False)), + (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), + (['--cache-type'], dict(help="""(string) 查询节点层级,可选值:[all,edge,mid],默认查询all,edge边缘 mid中间 """, dest='cacheType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询默认http header头部参数列表 ''', + help=''' 分地区及运营商查询统计数据,仅可查询中国境内的相关信息 ''', description=''' - 查询默认http header头部参数列表。 + 分地区及运营商查询统计数据,仅可查询中国境内的相关信息。 - 示例: jdc cdn query-default-http-header-key + 示例: jdc cdn query-mix-statistics-with-area-data ''', ) - def query_default_http_header_key(self): + def query_mix_statistics_with_area_data(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryDefaultHttpHeaderKeyRequest import QueryDefaultHttpHeaderKeyRequest + from jdcloud_sdk.services.cdn.apis.QueryMixStatisticsWithAreaDataRequest import QueryMixStatisticsWithAreaDataRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDefaultHttpHeaderKeyRequest(params_dict, headers) + req = QueryMixStatisticsWithAreaDataRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -376,29 +400,38 @@ def query_default_http_header_key(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), + (['--area'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔 """, dest='area', required=False)), + (['--isp'], dict(help="""(string) 查询的运营商,cmcc,cnc,ct,表示移动、联通、电信。多个用逗号分隔 """, dest='isp', required=False)), + (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), + (['--group-by'], dict(help="""(string) 分组依据,只能按域名[domain]分组 """, dest='groupBy', required=False)), + (['--cache-type'], dict(help="""(string) 查询节点层级,可选值:[all,edge,mid],默认查询all,edge边缘 mid中间 """, dest='cacheType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询ip黑名单 ''', + help=''' 查询统计数据并进行汇总加和,仅可查询中国境内的相关信息 ''', description=''' - 查询ip黑名单。 + 查询统计数据并进行汇总加和,仅可查询中国境内的相关信息。 - 示例: jdc cdn query-ip-black-list --domain xxx + 示例: jdc cdn query-mix-traffic-group-sum ''', ) - def query_ip_black_list(self): + def query_mix_traffic_group_sum(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryIpBlackListRequest import QueryIpBlackListRequest + from jdcloud_sdk.services.cdn.apis.QueryMixTrafficGroupSumRequest import QueryMixTrafficGroupSumRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryIpBlackListRequest(params_dict, headers) + req = QueryMixTrafficGroupSumRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -408,30 +441,40 @@ def query_ip_black_list(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--ips'], dict(help="""(array) ip黑名单,ips中url不能超过50条 """, dest='ips', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--sub-domain'], dict(help="""(string) 查询泛域名时,指定的子域名列表,多个用逗号分隔。非泛域名时,传入空即可 """, dest='subDomain', required=False)), + (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), + (['--area'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔 """, dest='area', required=False)), + (['--isp'], dict(help="""(string) 查询的运营商,cmcc,cnc,ct,表示移动、联通、电信。多个用逗号分隔 """, dest='isp', required=False)), + (['--origin'], dict(help="""(bool) 是否查询回源统计信息。取值为true和false,默认为false。注意,如果查询回源信息,Fields的取值当前只支持oribandwidth,oripv,oricodestat三个,其余Fields忽略。 """, dest='origin', type=bool, required=False)), + (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), + (['--abroad'], dict(help="""(bool) true 代表查询境外数据,默认false查询境内数据 """, dest='abroad', type=bool, required=False)), + (['--cache-type'], dict(help="""(string) 查询节点层级,可选值:[all,edge,mid],默认查询all,edge边缘 mid中间 """, dest='cacheType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置ip黑名单 ''', + help=''' 查询统计数据 ''', description=''' - 设置ip黑名单。 + 查询统计数据。 - 示例: jdc cdn set-ip-black-list --domain xxx + 示例: jdc cdn query-statistics-data ''', ) - def set_ip_black_list(self): + def query_statistics_data(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetIpBlackListRequest import SetIpBlackListRequest + from jdcloud_sdk.services.cdn.apis.QueryStatisticsDataRequest import QueryStatisticsDataRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetIpBlackListRequest(params_dict, headers) + req = QueryStatisticsDataRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -441,30 +484,42 @@ def set_ip_black_list(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--status'], dict(help="""(string) ip黑名单状态取值[on,off] """, dest='status', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--sub-domain'], dict(help="""(string) 查询泛域名时,指定的子域名列表,多个用逗号分隔。非泛域名时,传入空即可 """, dest='subDomain', required=False)), + (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), + (['--area'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔 """, dest='area', required=False)), + (['--isp'], dict(help="""(string) 查询的运营商,cmcc,cnc,ct,表示移动、联通、电信。多个用逗号分隔 """, dest='isp', required=False)), + (['--origin'], dict(help="""(bool) 是否查询回源统计信息。取值为true和false,默认为false。注意,如果查询回源信息,Fields的取值当前只支持oribandwidth,oripv,oricodestat三个,其余Fields忽略 """, dest='origin', type=bool, required=False)), + (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), + (['--group-by'], dict(help="""(string) 分组依据,可选值:[terminal,sdtfrom],如果为空,则只按area/isp进行group """, dest='groupBy', required=False)), + (['--scheme'], dict(help="""(string) 查询协议,可选值:[http,https,all],传空默认返回全部协议汇总后的数据 """, dest='scheme', required=False)), + (['--abroad'], dict(help="""(bool) true 代表查询境外数据,默认false查询境内数据 """, dest='abroad', type=bool, required=False)), + (['--cache-type'], dict(help="""(string) 查询节点层级,可选值:[all,edge,mid],默认查询all,edge边缘 mid中间 """, dest='cacheType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置ip黑名单状态 ''', + help=''' 分地区及运营商查询统计数据 ''', description=''' - 设置ip黑名单状态。 + 分地区及运营商查询统计数据。 - 示例: jdc cdn operate-ip-black-list --domain xxx + 示例: jdc cdn query-statistics-data-group-by-area ''', ) - def operate_ip_black_list(self): + def query_statistics_data_group_by_area(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.OperateIpBlackListRequest import OperateIpBlackListRequest + from jdcloud_sdk.services.cdn.apis.QueryStatisticsDataGroupByAreaRequest import QueryStatisticsDataGroupByAreaRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = OperateIpBlackListRequest(params_dict, headers) + req = QueryStatisticsDataGroupByAreaRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -474,33 +529,41 @@ def operate_ip_black_list(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--weight'], dict(help="""(int) 此条配置的权重值, 取值范围为1-10,1最大 """, dest='weight', type=int, required=False)), - (['--ttl'], dict(help="""(int) 缓存时间,单位秒 """, dest='ttl', type=int, required=False)), - (['--contents'], dict(help="""(string) 规则内容。其他类型只能以/或者.开头,如/a/b或.jpg """, dest='contents', required=False)), - (['--cache-type'], dict(help="""(int) 缓存方式:0、不缓存,1自定义 """, dest='cacheType', type=int, required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--sub-domain'], dict(help="""(string) 查询泛域名时,指定的子域名列表,多个用逗号分隔。非泛域名时,传入空即可 """, dest='subDomain', required=False)), + (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), + (['--area'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔 """, dest='area', required=False)), + (['--isp'], dict(help="""(string) 查询的运营商,cmcc,cnc,ct,表示移动、联通、电信。多个用逗号分隔 """, dest='isp', required=False)), + (['--origin'], dict(help="""(bool) 是否查询回源统计信息。取值为true和false,默认为false。注意,如果查询回源信息,Fields的取值当前只支持oribandwidth,oripv,oricodestat三个,其余Fields忽略。 """, dest='origin', type=bool, required=False)), + (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), + (['--group-by'], dict(help="""(string) 分组依据,可选值:[area,isp,domain,scheme] """, dest='groupBy', required=False)), + (['--abroad'], dict(help="""(bool) true 代表查询境外数据,默认false查询境内数据 """, dest='abroad', type=bool, required=False)), + (['--cache-type'], dict(help="""(string) 查询节点层级,可选值:[all,edge,mid],默认查询all,edge边缘 mid中间 """, dest='cacheType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加缓存规则 ''', + help=''' 查询统计数据并进行汇总加和 ''', description=''' - 添加缓存规则。 + 查询统计数据并进行汇总加和。 - 示例: jdc cdn create-cache-rule --domain xxx + 示例: jdc cdn query-statistics-data-group-sum ''', ) - def create_cache_rule(self): + def query_statistics_data_group_sum(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.CreateCacheRuleRequest import CreateCacheRuleRequest + from jdcloud_sdk.services.cdn.apis.QueryStatisticsDataGroupSumRequest import QueryStatisticsDataGroupSumRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateCacheRuleRequest(params_dict, headers) + req = QueryStatisticsDataGroupSumRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -510,34 +573,43 @@ def create_cache_rule(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--weight'], dict(help="""(int) 此条配置的权重值, 取值范围为1-10,1最大 """, dest='weight', type=int, required=False)), - (['--ttl'], dict(help="""(int) 缓存时间,单位秒 """, dest='ttl', type=int, required=False)), - (['--contents'], dict(help="""(string) 规则内容。其他类型只能以/或者.开头,如/a/b或.jpg """, dest='contents', required=False)), - (['--cache-type'], dict(help="""(int) 缓存方式:0、不缓存,1自定义 """, dest='cacheType', type=int, required=False)), - (['--config-id'], dict(help="""(int) 缓存规则配置ID """, dest='configId', type=int, required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--app-name'], dict(help="""(string) app名,查询的App名称,多个用逗号分隔。注意,传如多个AppName时,表示查询这些AppName的和值,即“或”的关系。默认为空,表示查询所有App """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名,查询的流名称,多个用逗号分隔。注意,传如多个StreamName时,表示查询这些StreamName的和值,即“或”的关系。默认为空,表示查询所有Stream """, dest='streamName', required=False)), + (['--sub-domain'], dict(help="""(string) 子域名,查询泛域名时,指定的子域名列表,多个用逗号分隔。非泛域名时,传入空即可 """, dest='subDomain', required=False)), + (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), + (['--area'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔 """, dest='area', required=False)), + (['--isp'], dict(help="""(string) 查询的运营商,cmcc,cnc,ct,表示移动、联通、电信。多个用逗号分隔 """, dest='isp', required=False)), + (['--req-method'], dict(help="""(string) 当前取值范围("GET,HEAD,forward,forward-hls,ingest,play,publish,detour-ingest,Forward-Origin") """, dest='reqMethod', required=False)), + (['--scheme'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个用逗号分隔,默认为空,表示查询所有协议。 """, dest='scheme', required=False)), + (['--cache-level'], dict(help="""(string) cacheLevel,可选值:[L1,L2,L3] """, dest='cacheLevel', required=False)), + (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), + (['--cache-type'], dict(help="""(string) 查询节点层级,可选值:[all,edge,mid],默认查询all,edge边缘 mid中间 """, dest='cacheType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改缓存规则 ''', + help=''' 查询统计数据 ''', description=''' - 修改缓存规则。 + 查询统计数据。 - 示例: jdc cdn update-cache-rule --domain xxx + 示例: jdc cdn query-live-statistics-data ''', ) - def update_cache_rule(self): + def query_live_statistics_data(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.UpdateCacheRuleRequest import UpdateCacheRuleRequest + from jdcloud_sdk.services.cdn.apis.QueryLiveStatisticsDataRequest import QueryLiveStatisticsDataRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateCacheRuleRequest(params_dict, headers) + req = QueryLiveStatisticsDataRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -547,30 +619,44 @@ def update_cache_rule(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--config-id'], dict(help="""(int) 缓存规则配置ID """, dest='configId', type=int, required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--app-name'], dict(help="""(string) 查询的App名称,多个用逗号分隔。 """, dest='appName', required=False)), + (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), + (['--area'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔 """, dest='area', required=False)), + (['--isp'], dict(help="""(string) 查询的运营商,cmcc,cnc,ct,表示移动、联通、电信。多个用逗号分隔 """, dest='isp', required=False)), + (['--stream-name'], dict(help="""(string) 查询的流名称,多个用逗号分隔。 """, dest='streamName', required=False)), + (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), + (['--group-by'], dict(help="""(string) 分组依据,可选值:[appname,streamname],如果为空,则只按area/isp进行group。 """, dest='groupBy', required=False)), + (['--sub-domain'], dict(help="""(string) 查询泛域名时,指定的子域名列表,多个用逗号分隔。非泛域名时,传入空即可 """, dest='subDomain', required=False)), + (['--scheme'], dict(help="""(string) 查询的流协议,取值范围:"rtmp,hdl,hls",多个用逗号分隔,默认为空,表示查询所有协议。 """, dest='scheme', required=False)), + (['--req-method'], dict(help="""(string) 当前取值范围("GET,HEAD,forward,forward-hls,ingest,play,publish,detour-ingest,Forward-Origin") """, dest='reqMethod', required=False)), + (['--cache-level'], dict(help="""(string) cacheLevel,可选值:[L1,L2,L3] """, dest='cacheLevel', required=False)), + (['--cache-type'], dict(help="""(string) 查询节点层级,可选值:[all,edge,mid],默认查询all,edge边缘 mid中间 """, dest='cacheType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除缓存规则 ''', + help=''' 分地区及运营商查询统计数据 ''', description=''' - 删除缓存规则。 + 分地区及运营商查询统计数据。 - 示例: jdc cdn delete-cache-rule --domain xxx + 示例: jdc cdn query-live-statistics-area-data-group-by ''', ) - def delete_cache_rule(self): + def query_live_statistics_area_data_group_by(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.DeleteCacheRuleRequest import DeleteCacheRuleRequest + from jdcloud_sdk.services.cdn.apis.QueryLiveStatisticsAreaDataGroupByRequest import QueryLiveStatisticsAreaDataGroupByRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteCacheRuleRequest(params_dict, headers) + req = QueryLiveStatisticsAreaDataGroupByRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -580,29 +666,44 @@ def delete_cache_rule(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--sub-domain'], dict(help="""(string) 查询泛域名时,指定的子域名列表,多个用逗号分隔。非泛域名时,传入空即可 """, dest='subDomain', required=False)), + (['--app-name'], dict(help="""(string) 查询的App名称,多个用逗号分隔。 """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 查询的流名称,多个用逗号分隔。 """, dest='streamName', required=False)), + (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), + (['--area'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔 """, dest='area', required=False)), + (['--isp'], dict(help="""(string) 查询的运营商,cmcc,cnc,ct,表示移动、联通、电信。多个用逗号分隔 """, dest='isp', required=False)), + (['--scheme'], dict(help="""(string) 查询的流协议,取值范围:"rtmp,hdl,hls",多个用逗号分隔,默认为空,表示查询所有协议。 """, dest='scheme', required=False)), + (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), + (['--group-by'], dict(help="""(string) 分组依据,可选值:[appname,streamname,domain,area,isp,scheme] """, dest='groupBy', required=False)), + (['--req-method'], dict(help="""(string) 当前取值范围("GET,HEAD,forward,forward-hls,ingest,play,publish,detour-ingest,Forward-Origin") """, dest='reqMethod', required=False)), + (['--cache-level'], dict(help="""(string) cacheLevel,可选值:[L1,L2,L3] """, dest='cacheLevel', required=False)), + (['--cache-type'], dict(help="""(string) 查询节点层级,可选值:[all,edge,mid],默认查询all,edge边缘 mid中间 """, dest='cacheType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询http header头 ''', + help=''' 查询统计数据并进行汇总加和 ''', description=''' - 查询http header头。 + 查询统计数据并进行汇总加和。 - 示例: jdc cdn query-http-header --domain xxx + 示例: jdc cdn query-live-traffic-group-sum ''', ) - def query_http_header(self): + def query_live_traffic_group_sum(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryHttpHeaderRequest import QueryHttpHeaderRequest + from jdcloud_sdk.services.cdn.apis.QueryLiveTrafficGroupSumRequest import QueryLiveTrafficGroupSumRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryHttpHeaderRequest(params_dict, headers) + req = QueryLiveTrafficGroupSumRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -612,32 +713,35 @@ def query_http_header(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--header-type'], dict(help="""(string) header类型[resp,req] """, dest='headerType', required=False)), - (['--header-name'], dict(help="""(string) header名 """, dest='headerName', required=False)), - (['--header-value'], dict(help="""(string) header值 """, dest='headerValue', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--sub-domain'], dict(help="""(string) 待查询的子域名,查询泛域名时,指定的子域名列表,多个用逗号分隔。非泛域名时,传入空即可 """, dest='subDomain', required=False)), + (['--size'], dict(help="""(int) 查询的topN的条数,取值范围:1-100,默认为20 """, dest='size', type=int, required=False)), + (['--top-by'], dict(help="""(string) 排序依据,当前可选:pv,flow, 分别表示按pv、按流量topN ip,默认为"pv" """, dest='topBy', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加httpHeader ''', + help=''' 查询TOP IP,仅可查询中国境内的相关信息 ''', description=''' - 添加httpHeader。 + 查询TOP IP,仅可查询中国境内的相关信息。 - 示例: jdc cdn set-http-header --domain xxx + 示例: jdc cdn query-statistics-top-ip ''', ) - def set_http_header(self): + def query_statistics_top_ip(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetHttpHeaderRequest import SetHttpHeaderRequest + from jdcloud_sdk.services.cdn.apis.QueryStatisticsTopIpRequest import QueryStatisticsTopIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetHttpHeaderRequest(params_dict, headers) + req = QueryStatisticsTopIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -647,31 +751,35 @@ def set_http_header(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--header-type'], dict(help="""(string) header类型[resp,req] """, dest='headerType', required=False)), - (['--header-name'], dict(help="""(string) header名 """, dest='headerName', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--sub-domain'], dict(help="""(string) 待查询的子域名,查询泛域名时,指定的子域名列表,多个用逗号分隔。非泛域名时,传入空即可 """, dest='subDomain', required=False)), + (['--size'], dict(help="""(int) 查询的topN的条数,取值范围:1-100,默认为20 """, dest='size', type=int, required=False)), + (['--top-by'], dict(help="""(string) 排序依据,当前可选:pv,flow,bandwidth, 分别表示按pv、按流量、按带宽topN url,默认为"pv" """, dest='topBy', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除httpHeader ''', + help=''' 查询TOP Url,仅可查询中国境内的相关信息 ''', description=''' - 删除httpHeader。 + 查询TOP Url,仅可查询中国境内的相关信息。 - 示例: jdc cdn delete-http-header --domain xxx + 示例: jdc cdn query-statistics-top-url ''', ) - def delete_http_header(self): + def query_statistics_top_url(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.DeleteHttpHeaderRequest import DeleteHttpHeaderRequest + from jdcloud_sdk.services.cdn.apis.QueryStatisticsTopUrlRequest import QueryStatisticsTopUrlRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteHttpHeaderRequest(params_dict, headers) + req = QueryStatisticsTopUrlRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -681,30 +789,35 @@ def delete_http_header(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--status'], dict(help="""(string) 开关取值[on,off] """, dest='status', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名,该接口仅支持单域名查询 """, dest='domain', required=False)), + (['--dirs'], dict(help="""(string) 需要过滤的目录 """, dest='dirs', required=False)), + (['--regions'], dict(help="""(string) 需要过滤的地区 """, dest='regions', required=False)), + (['--cache-type'], dict(help="""(string) 查询节点层级,可选值:[all,edge,mid],默认查询all,edge边缘 mid中间 """, dest='cacheType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置视频拖拽 ''', + help=''' 查询目录带宽,仅有部分用户支持该功能 ''', description=''' - 设置视频拖拽。 + 查询目录带宽,仅有部分用户支持该功能。 - 示例: jdc cdn set-video-draft --domain xxx + 示例: jdc cdn query-dir-bandwidth ''', ) - def set_video_draft(self): + def query_dir_bandwidth(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetVideoDraftRequest import SetVideoDraftRequest + from jdcloud_sdk.services.cdn.apis.QueryDirBandwidthRequest import QueryDirBandwidthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetVideoDraftRequest(params_dict, headers) + req = QueryDirBandwidthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -714,30 +827,34 @@ def set_video_draft(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--status'], dict(help="""(string) 开关取值[on,off] """, dest='status', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名,该接口仅支持单域名查询 """, dest='domain', required=False)), + (['--dirs'], dict(help="""(string) 需要过滤的目录 """, dest='dirs', required=False)), + (['--cache-type'], dict(help="""(string) 查询节点层级,可选值:[all,edge,mid],默认查询all,edge边缘 mid中间 """, dest='cacheType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置range参数 ''', + help=''' 查询目录基础统计数据,仅有部分用户支持该功能 ''', description=''' - 设置range参数。 + 查询目录基础统计数据,仅有部分用户支持该功能。 - 示例: jdc cdn set-range --domain xxx + 示例: jdc cdn query-dir-stats-data ''', ) - def set_range(self): + def query_dir_stats_data(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetRangeRequest import SetRangeRequest + from jdcloud_sdk.services.cdn.apis.QueryDirStatsDataRequest import QueryDirStatsDataRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetRangeRequest(params_dict, headers) + req = QueryDirStatsDataRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -747,30 +864,33 @@ def set_range(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--status'], dict(help="""(string) 开关取值[on,off] """, dest='status', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2020-12-07T16:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2020-12-07T16:20:00Z,开始时间和结束时间跨度 不能超过4个小时 """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名,该接口仅支持单域名查询 """, dest='domain', required=False)), + (['--dir'], dict(help="""(string) 需要过滤的目录,以正斜线(/)开头,不填表示查询所有目录。查询目录同时需要以正斜线(/)结尾。 如:/path1/path2/path3/ """, dest='dir', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置忽略参数 ''', + help=''' 查询定制的目录带宽,仅有部分用户支持该功能 ''', description=''' - 设置忽略参数。 + 查询定制的目录带宽,仅有部分用户支持该功能。 - 示例: jdc cdn set-ignore-query-string --domain xxx + 示例: jdc cdn query-customized-dir-band-width ''', ) - def set_ignore_query_string(self): + def query_customized_dir_band_width(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetIgnoreQueryStringRequest import SetIgnoreQueryStringRequest + from jdcloud_sdk.services.cdn.apis.QueryCustomizedDirBandWidthRequest import QueryCustomizedDirBandWidthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetIgnoreQueryStringRequest(params_dict, headers) + req = QueryCustomizedDirBandWidthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -781,28 +901,35 @@ def set_ignore_query_string(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--app-name'], dict(help="""(string) app名 """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名 """, dest='streamName', required=False)), + (['--page-num'], dict(help="""(int) 页码,不传默认1 """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 页size,不传默认100,最大值1000 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置userAgent信息 ''', + help=''' 分页查询直播流数据接口 ''', description=''' - 设置userAgent信息。 + 分页查询直播流数据接口。 - 示例: jdc cdn query-user-agent --domain xxx + 示例: jdc cdn query-stream-info --domain xxx ''', ) - def query_user_agent(self): + def query_stream_info(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryUserAgentRequest import QueryUserAgentRequest + from jdcloud_sdk.services.cdn.apis.QueryStreamInfoRequest import QueryStreamInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryUserAgentRequest(params_dict, headers) + req = QueryStreamInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -812,31 +939,32 @@ def query_user_agent(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--user-agent-type'], dict(help="""(string) userAgent类型,取值:block(黑名单),allow(白名单),默认为block """, dest='userAgentType', required=False)), - (['--user-agent-list'], dict(help="""(array) UA列表,如果userAgentList为空,则为全部删除 """, dest='userAgentList', required=False)), + (['--inst-name'], dict(help="""(string) 根据关键字进行模糊匹配 """, dest='instName', required=False)), + (['--page-number'], dict(help="""(int) pageNumber,默认值1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) pageSize,最大值50,默认值20 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置userAgent信息 ''', + help=''' 查询模板实例列表接口 ''', description=''' - 设置userAgent信息。 + 查询模板实例列表接口。 - 示例: jdc cdn set-user-agent-config --domain xxx + 示例: jdc cdn query-domain-temp-inst-list ''', ) - def set_user_agent_config(self): + def query_domain_temp_inst_list(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetUserAgentConfigRequest import SetUserAgentConfigRequest + from jdcloud_sdk.services.cdn.apis.QueryDomainTempInstListRequest import QueryDomainTempInstListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetUserAgentConfigRequest(params_dict, headers) + req = QueryDomainTempInstListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -846,29 +974,29 @@ def set_user_agent_config(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询url鉴权 ''', + help=''' 查询模板详情 ''', description=''' - 查询url鉴权。 + 查询模板详情。 - 示例: jdc cdn query-accesskey-config --domain xxx + 示例: jdc cdn query-domain-temp-pro-keys ''', ) - def query_accesskey_config(self): + def query_domain_temp_pro_keys(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryAccesskeyConfigRequest import QueryAccesskeyConfigRequest + from jdcloud_sdk.services.cdn.apis.QueryDomainTempProKeysRequest import QueryDomainTempProKeysRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryAccesskeyConfigRequest(params_dict, headers) + req = QueryDomainTempProKeysRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -878,32 +1006,33 @@ def query_accesskey_config(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--accesskey-type'], dict(help="""(int) 鉴权类型,0表示无鉴权,1表示参数鉴权,2表示路径鉴权 """, dest='accesskeyType', type=int, required=False)), - (['--accesskey-key'], dict(help="""(string) 密码,长度为8到32 """, dest='accesskeyKey', required=False)), - (['--accesskey-keep'], dict(help="""(int) 是否是回源鉴权 0表示是 1表示否 """, dest='accesskeyKeep', type=int, required=False)), + (['--temp-id'], dict(help="""(int) 模板id,预留字段 """, dest='tempId', type=int, required=False)), + (['--inst-id'], dict(help="""(int) 模板实例id,修改时必传 """, dest='instId', type=int, required=False)), + (['--inst-name'], dict(help="""(string) 模板实例名称 """, dest='instName', required=False)), + (['--inst-pro-info-map'], dict(help="""(object) 查询结果,类型为Map> """, dest='instProInfoMap', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置url鉴权 ''', + help=''' 创建修改模板实例 ''', description=''' - 设置url鉴权。 + 创建修改模板实例。 - 示例: jdc cdn set-accesskey-config --domain xxx + 示例: jdc cdn modify-domain-temp-inst ''', ) - def set_accesskey_config(self): + def modify_domain_temp_inst(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetAccesskeyConfigRequest import SetAccesskeyConfigRequest + from jdcloud_sdk.services.cdn.apis.ModifyDomainTempInstRequest import ModifyDomainTempInstRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetAccesskeyConfigRequest(params_dict, headers) + req = ModifyDomainTempInstRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -913,33 +1042,30 @@ def set_accesskey_config(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--refer-type'], dict(help="""(string) refer类型,取值:block(黑名单),allow(白名单)默认为block """, dest='referType', required=False)), - (['--refer-list'], dict(help="""(array) 逗号隔开的域名列表,如果referList传空则为删除 """, dest='referList', required=False)), - (['--allow-no-refer-header'], dict(help="""(string) 是否允许空refer访问,默认为“on” """, dest='allowNoReferHeader', required=False)), - (['--allow-null-refer-header'], dict(help="""(string) 是否允许无ua访问,默认为“on” """, dest='allowNullReferHeader', required=False)), + (['--inst-id'], dict(help="""(int) 模板实例id """, dest='instId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置域名refer ''', + help=''' 查询模板实例详情 ''', description=''' - 设置域名refer。 + 查询模板实例详情。 - 示例: jdc cdn set-refer --domain xxx + 示例: jdc cdn query-domain-temp-inst --inst-id 5 ''', ) - def set_refer(self): + def query_domain_temp_inst(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetReferRequest import SetReferRequest + from jdcloud_sdk.services.cdn.apis.QueryDomainTempInstRequest import QueryDomainTempInstRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetReferRequest(params_dict, headers) + req = QueryDomainTempInstRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -949,29 +1075,30 @@ def set_refer(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--inst-id'], dict(help="""(int) 模板实例id """, dest='instId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询源站监控信息 ''', + help=''' 删除修改模板实例 ''', description=''' - 查询源站监控信息。 + 删除修改模板实例。 - 示例: jdc cdn query-monitor --domain xxx + 示例: jdc cdn del-domain-temp-instance --inst-id 5 ''', ) - def query_monitor(self): + def del_domain_temp_instance(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryMonitorRequest import QueryMonitorRequest + from jdcloud_sdk.services.cdn.apis.DelDomainTempInstanceRequest import DelDomainTempInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryMonitorRequest(params_dict, headers) + req = DelDomainTempInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -981,32 +1108,35 @@ def query_monitor(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--cycle'], dict(help="""(int) 探测周期,取值1和5,单位为分钟 """, dest='cycle', type=int, required=False)), - (['--monitor-path'], dict(help="""(string) 探测路径 """, dest='monitorPath', required=False)), - (['--http-request-header'], dict(help="""(object) http请求头 """, dest='httpRequestHeader', required=False)), + (['--key-word'], dict(help="""(string) 根据关键字进行模糊匹配 """, dest='keyWord', required=False)), + (['--page-number'], dict(help="""(int) pageNumber,默认值1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) pageSize,最大值50,默认值20 """, dest='pageSize', type=int, required=False)), + (['--status'], dict(help="""(string) 根据域名状态查询, 可选值[offline, online, configuring, auditing, audit_reject] """, dest='status', required=False)), + (['--type'], dict(help="""(string) 域名类型,(web:静态小文件,download:大文件加速,vod:视频加速,live:直播加速),不传查所有 """, dest='type', required=False)), + (['--accelerate-region'], dict(help="""(string) 加速区域,(mainLand:中国大陆,nonMainLand:海外加港澳台,all:全球),不传为全球 """, dest='accelerateRegion', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置源站监控信息 ''', + help=''' 查询加速域名接口 ''', description=''' - 设置源站监控信息。 + 查询加速域名接口。 - 示例: jdc cdn set-monitor --domain xxx + 示例: jdc cdn get-domain-list ''', ) - def set_monitor(self): + def get_domain_list(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetMonitorRequest import SetMonitorRequest + from jdcloud_sdk.services.cdn.apis.GetDomainListRequest import GetDomainListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetMonitorRequest(params_dict, headers) + req = GetDomainListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1016,29 +1146,37 @@ def set_monitor(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--key-word'], dict(help="""(string) 根据关键字进行模糊匹配,域名或者回源信息 """, dest='keyWord', required=False)), + (['--page-number'], dict(help="""(int) pageNumber,默认值为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) pageSize,默认值为20,最大值为50 """, dest='pageSize', type=int, required=False)), + (['--status'], dict(help="""(string) 根据域名状态查询, 可选值[offline, online, configuring, auditing, audit_reject] """, dest='status', required=False)), + (['--type'], dict(help="""(string) 域名类型,(web:静态小文件,download:大文件加速,vod:视频加速,live:直播加速),不传查所有 """, dest='type', required=False)), + (['--accelerate-region'], dict(help="""(string) 加速区域,(mainLand:中国大陆,nonMainLand:海外加港澳台,all:全球),不传为全球 """, dest='accelerateRegion', required=False)), + (['--filter-by'], dict(help="""(int) 筛选依据(0:根据域名筛选,1:根据回源信息筛选),默认按照域名进行筛选 """, dest='filterBy', type=int, required=False)), + (['--tag-filters'], dict(help="""(array: tagFilter) 标签过滤条件 """, dest='tagFilters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 停止源站监控 ''', + help=''' 通过标签查询加速域名接口 ''', description=''' - 停止源站监控。 + 通过标签查询加速域名接口。 - 示例: jdc cdn stop-monitor --domain xxx + 示例: jdc cdn get-domain-list-by-filter ''', ) - def stop_monitor(self): + def get_domain_list_by_filter(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.StopMonitorRequest import StopMonitorRequest + from jdcloud_sdk.services.cdn.apis.GetDomainListByFilterRequest import GetDomainListByFilterRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopMonitorRequest(params_dict, headers) + req = GetDomainListByFilterRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1049,34 +1187,29 @@ def stop_monitor(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--source-type'], dict(help="""(string) 回源类型只能是[ips,domain,oss]中的一种 """, dest='sourceType', required=False)), - (['--back-source-type'], dict(help="""(string) 回源方式,只能是[https,http]中的一种,默认http """, dest='backSourceType', required=False)), - (['--ip-source'], dict(help="""(array: array) NA """, dest='ipSource', required=False)), - (['--domain-source'], dict(help="""(array: array) NA """, dest='domainSource', required=False)), - (['--oss-source'], dict(help="""(string) oss回源域名 """, dest='ossSource', required=False)), - (['--default-source-host'], dict(help="""(string) 默认回源host """, dest='defaultSourceHost', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置源站信息 ''', + help=''' 查询加速域名详情 ''', description=''' - 设置源站信息。 + 查询加速域名详情。 - 示例: jdc cdn set-source --domain xxx + 示例: jdc cdn get-domain-detail --domain xxx ''', ) - def set_source(self): + def get_domain_detail(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetSourceRequest import SetSourceRequest + from jdcloud_sdk.services.cdn.apis.GetDomainDetailRequest import GetDomainDetailRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetSourceRequest(params_dict, headers) + req = GetDomainDetailRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1087,29 +1220,45 @@ def set_source(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--status'], dict(help="""(string) 共享缓存只能是off或者on """, dest='status', required=False)), + (['--source-type'], dict(help="""(string) 回源类型只能是[ips,domain,oss]中的一种 """, dest='sourceType', required=False)), + (['--cdn-type'], dict(help="""(string) 点播域名的类型只能是[vod,download,web]中的一种 """, dest='cdnType', required=False)), + (['--back-source-type'], dict(help="""(string) 回源方式,只能是[https,http]中的一种,默认http """, dest='backSourceType', required=False)), + (['--daily-band-width'], dict(help="""(int) 日带宽(Mbps) """, dest='dailyBandWidth', type=int, required=False)), + (['--quaility'], dict(help="""(string) 服务质量,只能是[good,general]中的一种,默认为good """, dest='quaility', required=False)), + (['--max-file-size'], dict(help="""(int) NA """, dest='maxFileSize', type=int, required=False)), + (['--min-file-size'], dict(help="""(int) NA """, dest='minFileSize', type=int, required=False)), + (['--sum-file-size'], dict(help="""(int) NA """, dest='sumFileSize', type=int, required=False)), + (['--avg-file-size'], dict(help="""(int) NA """, dest='avgFileSize', type=int, required=False)), + (['--default-source-host'], dict(help="""(string) NA """, dest='defaultSourceHost', required=False)), + (['--http-type'], dict(help="""(string) NA """, dest='httpType', required=False)), + (['--ip-source'], dict(help="""(array: array) NA """, dest='ipSource', required=False)), + (['--domain-source'], dict(help="""(array: array) NA """, dest='domainSource', required=False)), + (['--oss-source'], dict(help="""(string) NA """, dest='ossSource', required=False)), + (['--accelerate-region'], dict(help="""(string) 加速区域:(mainLand:中国大陆,nonMainLand:海外加港澳台,all:全球)默认为中国大陆 """, dest='accelerateRegion', required=False)), + (['--temp-inst-id'], dict(help="""(int) NA """, dest='tempInstId', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 泛域名共享缓存 ''', + help=''' 创建点播加速域名 ''', description=''' - 泛域名共享缓存。 + 创建点播加速域名。 - 示例: jdc cdn operate-share-cache --domain xxx + 示例: jdc cdn create-domain --domain xxx ''', ) - def operate_share_cache(self): + def create_domain(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.OperateShareCacheRequest import OperateShareCacheRequest + from jdcloud_sdk.services.cdn.apis.CreateDomainRequest import CreateDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = OperateShareCacheRequest(params_dict, headers) + req = CreateDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1120,36 +1269,29 @@ def operate_share_cache(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--http-type'], dict(help="""(string) http类型,只能为http或者https,默认为http.当设为https时,需要调用“设置通讯协议”接口上传证书和私钥 """, dest='httpType', required=False)), - (['--certificate'], dict(help="""(string) 用户证书,当Type为https时必须设置 """, dest='certificate', required=False)), - (['--rsa-key'], dict(help="""(string) 证书私钥 """, dest='rsaKey', required=False)), - (['--jump-type'], dict(help="""(string) 有三种类型:default、http、https """, dest='jumpType', required=False)), - (['--cert-from'], dict(help="""(string) 证书来源有两种类型:default,ssl """, dest='certFrom', required=False)), - (['--ssl-cert-id'], dict(help="""(string) ssl证书id """, dest='sslCertId', required=False)), - (['--sync-to-ssl'], dict(help="""(bool) 是否同步到ssl,boolean值,取值true或者false """, dest='syncToSsl', required=False)), - (['--cert-name'], dict(help="""(string) syncToSsl是true时,certName是必填项 """, dest='certName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置http协议 ''', + help=''' 删除加速域名 ''', description=''' - 设置http协议。 + 删除加速域名。 - 示例: jdc cdn set-http-type --domain xxx + 示例: jdc cdn delete-domain --domain xxx ''', ) - def set_http_type(self): + def delete_domain(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetHttpTypeRequest import SetHttpTypeRequest + from jdcloud_sdk.services.cdn.apis.DeleteDomainRequest import DeleteDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetHttpTypeRequest(params_dict, headers) + req = DeleteDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1161,27 +1303,28 @@ def set_http_type(self): arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询回源302跳转信息 ''', + help=''' 启动加速域名 ''', description=''' - 查询回源302跳转信息。 + 启动加速域名。 - 示例: jdc cdn query-follow-redirect --domain xxx + 示例: jdc cdn start-domain --domain xxx ''', ) - def query_follow_redirect(self): + def start_domain(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryFollowRedirectRequest import QueryFollowRedirectRequest + from jdcloud_sdk.services.cdn.apis.StartDomainRequest import StartDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryFollowRedirectRequest(params_dict, headers) + req = StartDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1192,29 +1335,2032 @@ def query_follow_redirect(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--status'], dict(help="""(string) 开关取值[on,off] """, dest='status', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置回源302跳转 ''', + help=''' 停止加速域名 ''', description=''' - 设置回源302跳转。 + 停止加速域名。 - 示例: jdc cdn set-follow-redirect --domain xxx + 示例: jdc cdn stop-domain --domain xxx ''', ) - def set_follow_redirect(self): + def stop_domain(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.StopDomainRequest import StopDomainRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = StopDomainRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询oss存储域名 ''', + description=''' + 查询oss存储域名。 + + 示例: jdc cdn query-oss-buckets + ''', + ) + def query_oss_buckets(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryOssBucketsRequest import QueryOssBucketsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryOssBucketsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domains'], dict(help="""(array) NA """, dest='domains', required=False)), + (['--source-type'], dict(help="""(string) 回源类型只能是[ips,domain,oss]中的一种 """, dest='sourceType', required=False)), + (['--cdn-type'], dict(help="""(string) 点播域名的类型只能是[vod,download,web]中的一种 """, dest='cdnType', required=False)), + (['--back-source-type'], dict(help="""(string) 回源方式,只能是[https,http]中的一种,默认http """, dest='backSourceType', required=False)), + (['--daily-band-width'], dict(help="""(int) 日带宽(Mbps) """, dest='dailyBandWidth', type=int, required=False)), + (['--quaility'], dict(help="""(string) 服务质量,只能是[good,general]中的一种,默认为good """, dest='quaility', required=False)), + (['--max-file-size'], dict(help="""(int) NA """, dest='maxFileSize', type=int, required=False)), + (['--min-file-size'], dict(help="""(int) NA """, dest='minFileSize', type=int, required=False)), + (['--sum-file-size'], dict(help="""(int) NA """, dest='sumFileSize', type=int, required=False)), + (['--avg-file-size'], dict(help="""(int) NA """, dest='avgFileSize', type=int, required=False)), + (['--default-source-host'], dict(help="""(string) NA """, dest='defaultSourceHost', required=False)), + (['--http-type'], dict(help="""(string) NA """, dest='httpType', required=False)), + (['--ip-source'], dict(help="""(array: array) NA """, dest='ipSource', required=False)), + (['--domain-source'], dict(help="""(array: array) NA """, dest='domainSource', required=False)), + (['--oss-source'], dict(help="""(string) NA """, dest='ossSource', required=False)), + (['--accelerate-region'], dict(help="""(string) 加速区域 (mainLand:中国大陆,nonMainLand:海外加港澳台,all:全球)默认为中国大陆 """, dest='accelerateRegion', required=False)), + (['--temp-inst-id'], dict(help="""(int) NA """, dest='tempInstId', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建点播加速域名 ''', + description=''' + 创建点播加速域名。 + + 示例: jdc cdn batch-create + ''', + ) + def batch_create(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.BatchCreateRequest import BatchCreateRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = BatchCreateRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询域名配置信息 ''', + description=''' + 查询域名配置信息。 + + 示例: jdc cdn query-domain-config --domain xxx + ''', + ) + def query_domain_config(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryDomainConfigRequest import QueryDomainConfigRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryDomainConfigRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--id'], dict(help="""(int) id 修改操作必传 """, dest='id', type=int, required=False)), + (['--notice-type'], dict(help="""(string) 通知类型,取值[reportForm],reportForm:报表. """, dest='noticeType', required=False)), + (['--notice-way'], dict(help="""(string) 通知方式,取值[mail],mail:邮件. """, dest='noticeWay', required=False)), + (['--notice-to'], dict(help="""(string) 通知接收人,多个用逗号隔开. """, dest='noticeTo', required=False)), + (['--notice-cc'], dict(help="""(string) 通知抄送人,多个用逗号隔开. """, dest='noticeCC', required=False)), + (['--notice-content'], dict(help="""(string) 通知正文. """, dest='noticeContent', required=False)), + (['--notice-period'], dict(help="""(array) 通知周期,取值[daily,weekly,monthly]. """, dest='noticePeriod', required=False)), + (['--notice-status'], dict(help="""(string) 通知状态,取值[init,start,stop] """, dest='noticeStatus', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 配置服务通知接口 ''', + description=''' + 配置服务通知接口。 + + 示例: jdc cdn config-service-notice + ''', + ) + def config_service_notice(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.ConfigServiceNoticeRequest import ConfigServiceNoticeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ConfigServiceNoticeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--notice-type'], dict(help="""(string) 通知类型,取值[reportForm],reportForm:报表. """, dest='noticeType', required=False)), + (['--notice-way'], dict(help="""(string) 通知方式,取值[mail],mail:邮件. """, dest='noticeWay', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询用户服务通知接口 ''', + description=''' + 查询用户服务通知接口。 + + 示例: jdc cdn query-service-notice + ''', + ) + def query_service_notice(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryServiceNoticeRequest import QueryServiceNoticeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryServiceNoticeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置线上计费方式 ''', + description=''' + 设置线上计费方式。 + + 示例: jdc cdn query-online-billing-type + ''', + ) + def query_online_billing_type(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryOnlineBillingTypeRequest import QueryOnlineBillingTypeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryOnlineBillingTypeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--all-type'], dict(help="""(int) 计费方式,取值[0,1],0:日流量计费,1:日峰值带宽计费. """, dest='allType', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置线上计费方式 ''', + description=''' + 设置线上计费方式。 + + 示例: jdc cdn set-online-billing-type + ''', + ) + def set_online_billing_type(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.SetOnlineBillingTypeRequest import SetOnlineBillingTypeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = SetOnlineBillingTypeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--task-id'], dict(help="""(string) 任务ID """, dest='taskId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询域名配置状态 ''', + description=''' + 查询域名配置状态。 + + 示例: jdc cdn query-domain-config-status --task-id xxx + ''', + ) + def query_domain_config_status(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryDomainConfigStatusRequest import QueryDomainConfigStatusRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryDomainConfigStatusRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--ips'], dict(help="""(array) NA """, dest='ips', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询IP归属,适用于查询边缘节点,仅支持中国境内IP地址查询 ''', + description=''' + 查询IP归属,适用于查询边缘节点,仅支持中国境内IP地址查询。 + + 示例: jdc cdn check-whether-ip-belong-to-jcloud + ''', + ) + def check_whether_ip_belong_to_jcloud(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.CheckWhetherIpBelongToJCloudRequest import CheckWhetherIpBelongToJCloudRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CheckWhetherIpBelongToJCloudRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain-list'], dict(help="""(array) NA """, dest='domainList', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询一个域名的全部调度ip ''', + description=''' + 查询一个域名的全部调度ip。 + + 示例: jdc cdn query-service-ip + ''', + ) + def query_service_ip(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryServiceIpRequest import QueryServiceIpRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryServiceIpRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取所有上层节点的ip ''', + description=''' + 获取所有上层节点的ip。 + + 示例: jdc cdn get-all-upper-node-ip-list + ''', + ) + def get_all_upper_node_ip_list(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.GetAllUpperNodeIpListRequest import GetAllUpperNodeIpListRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = GetAllUpperNodeIpListRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--share-cache'], dict(help="""(string) 根据是否共享内存筛选 """, dest='shareCache', required=False)), + (['--page-number'], dict(help="""(int) pageNumber """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) pageSize """, dest='pageSize', type=int, required=False)), + (['--primary-domain'], dict(help="""(string) 根据主域名模糊查询 """, dest='primaryDomain', required=False)), + (['--domain-group-name'], dict(help="""(string) 根据域名组模糊查询 """, dest='domainGroupName', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询域名组接口 ''', + description=''' + 查询域名组接口。 + + 示例: jdc cdn query-domain-group-list + ''', + ) + def query_domain_group_list(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryDomainGroupListRequest import QueryDomainGroupListRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryDomainGroupListRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--id'], dict(help="""(int) 域名组id """, dest='id', type=int, required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询域名组详情 ''', + description=''' + 查询域名组详情。 + + 示例: jdc cdn query-domain-group-detail --id 5 + ''', + ) + def query_domain_group_detail(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryDomainGroupDetailRequest import QueryDomainGroupDetailRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryDomainGroupDetailRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询未分组域名 ''', + description=''' + 查询未分组域名。 + + 示例: jdc cdn query-domains-not-in-group + ''', + ) + def query_domains_not_in_group(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryDomainsNotInGroupRequest import QueryDomainsNotInGroupRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryDomainsNotInGroupRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--id'], dict(help="""(int) 域名组id """, dest='id', type=int, required=True)), + (['--domains'], dict(help="""(array) 域名组内域名,包含主域名 """, dest='domains', required=False)), + (['--primary-domain'], dict(help="""(string) 主域名,开启共享缓存时必传 """, dest='primaryDomain', required=False)), + (['--share-cache'], dict(help="""(string) 是否共享内存,共享缓存仅对中国境内加速域名生效 """, dest='shareCache', required=False)), + (['--domain-group-name'], dict(help="""(string) NA """, dest='domainGroupName', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 更新域名组 ''', + description=''' + 更新域名组。 + + 示例: jdc cdn update-domain-group --id 5 + ''', + ) + def update_domain_group(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.UpdateDomainGroupRequest import UpdateDomainGroupRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateDomainGroupRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--share-cache'], dict(help="""(string) 是否共享内存,共享缓存仅对中国境内加速域名生效 """, dest='shareCache', required=False)), + (['--primary-domain'], dict(help="""(string) 主域名,开启共享缓存时必传 """, dest='primaryDomain', required=False)), + (['--domain-group-name'], dict(help="""(string) 域名组名称 """, dest='domainGroupName', required=False)), + (['--domains'], dict(help="""(array) 域名组内域名包含主域名 """, dest='domains', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建域名组 ''', + description=''' + 创建域名组。 + + 示例: jdc cdn create-domain-group + ''', + ) + def create_domain_group(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.CreateDomainGroupRequest import CreateDomainGroupRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateDomainGroupRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--ids'], dict(help="""(array: int) NA """, dest='ids', type=int, required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 批量删除域名组 ''', + description=''' + 批量删除域名组。 + + 示例: jdc cdn batch-delete-domain-group --ids [5] + ''', + ) + def batch_delete_domain_group(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.BatchDeleteDomainGroupRequest import BatchDeleteDomainGroupRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = BatchDeleteDomainGroupRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询WAF总开关 ''', + description=''' + 查询WAF总开关。 + + 示例: jdc cdn query-waf-switch --domain xxx + ''', + ) + def query_waf_switch(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryWafSwitchRequest import QueryWafSwitchRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryWafSwitchRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--switch-status'], dict(help="""(string) 开关状态, on:开启,off:关闭 """, dest='switchStatus', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置WAF总开关 ''', + description=''' + 设置WAF总开关。 + + 示例: jdc cdn set-waf-switch --domain xxx + ''', + ) + def set_waf_switch(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.SetWafSwitchRequest import SetWafSwitchRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = SetWafSwitchRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询WAF总开关 ''', + description=''' + 查询WAF总开关。 + + 示例: jdc cdn query-waf-white-rule-switch --domain xxx + ''', + ) + def query_waf_white_rule_switch(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryWafWhiteRuleSwitchRequest import QueryWafWhiteRuleSwitchRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryWafWhiteRuleSwitchRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--switch-status'], dict(help="""(string) 开关状态, on:开启,off:关闭 """, dest='switchStatus', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置WAF白名单开关 ''', + description=''' + 设置WAF白名单开关。 + + 示例: jdc cdn set-waf-white-rule-switch --domain xxx + ''', + ) + def set_waf_white_rule_switch(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.SetWafWhiteRuleSwitchRequest import SetWafWhiteRuleSwitchRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = SetWafWhiteRuleSwitchRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--rule-type'], dict(help="""(string) ruleType, valid values [ip, geo, uri] """, dest='ruleType', required=True)), + (['--id'], dict(help="""(string) ruleId, defalut empty """, dest='id', required=False)), + (['--page-size'], dict(help="""(int) page size , default 0 to query all """, dest='pageSize', type=int, required=False)), + (['--page-index'], dict(help="""(int) page index , default 0 to query all """, dest='pageIndex', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询WAF白名单规则列表 ''', + description=''' + 查询WAF白名单规则列表。 + + 示例: jdc cdn querywaf-white-rules --domain xxx --rule-type xxx + ''', + ) + def querywaf_white_rules(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QuerywafWhiteRulesRequest import QuerywafWhiteRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QuerywafWhiteRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--rule-type'], dict(help="""(string) 白名单类型, uri ip geo """, dest='ruleType', required=False)), + (['--match-op'], dict(help="""(int) 匹配模式,uri类型有效,0=完全匹配 1=前缀匹配 2=包含 3=正则 4=大于 5=后缀 """, dest='matchOp', type=int, required=False)), + (['--val'], dict(help="""(string) 匹配值 """, dest='val', required=False)), + (['--actions'], dict(help="""(array) 后续处理 "waf" "cc" "deny"自由组合,空表示跳过后续所有阶段 """, dest='actions', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 新增一条白名单规则 ''', + description=''' + 新增一条白名单规则。 + + 示例: jdc cdn create-waf-white-rule --domain xxx + ''', + ) + def create_waf_white_rule(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.CreateWafWhiteRuleRequest import CreateWafWhiteRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateWafWhiteRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--id'], dict(help="""(string) 需要修改的白名单ID """, dest='id', required=True)), + (['--rule-type'], dict(help="""(string) 白名单类型, uri ip geo """, dest='ruleType', required=False)), + (['--match-op'], dict(help="""(int) 匹配模式,uri类型有效,0=完全匹配 1=前缀匹配 2=包含 3=正则 4=大于 5=后缀 """, dest='matchOp', type=int, required=False)), + (['--val'], dict(help="""(string) 匹配值 """, dest='val', required=False)), + (['--actions'], dict(help="""(array) 后续处理 "waf" "cc" "deny"自由组合,空表示跳过后续所有阶段 """, dest='actions', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改指定的白名单规则 ''', + description=''' + 修改指定的白名单规则。 + + 示例: jdc cdn update-waf-white-rule --domain xxx --id xxx + ''', + ) + def update_waf_white_rule(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.UpdateWafWhiteRuleRequest import UpdateWafWhiteRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateWafWhiteRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--ids'], dict(help="""(array) NA """, dest='ids', required=False)), + (['--rule-type'], dict(help="""(string) NA """, dest='ruleType', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 启用WAF白名单 ''', + description=''' + 启用WAF白名单。 + + 示例: jdc cdn enable-waf-white-rules --domain xxx + ''', + ) + def enable_waf_white_rules(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.EnableWafWhiteRulesRequest import EnableWafWhiteRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = EnableWafWhiteRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--ids'], dict(help="""(array) NA """, dest='ids', required=False)), + (['--rule-type'], dict(help="""(string) NA """, dest='ruleType', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 禁用WAF白名单 ''', + description=''' + 禁用WAF白名单。 + + 示例: jdc cdn disable-waf-white-rules --domain xxx + ''', + ) + def disable_waf_white_rules(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.DisableWafWhiteRulesRequest import DisableWafWhiteRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DisableWafWhiteRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--ids'], dict(help="""(string) NA """, dest='ids', required=True)), + (['--rule-type'], dict(help="""(string) NA """, dest='ruleType', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除WAF白名单 ''', + description=''' + 删除WAF白名单。 + + 示例: jdc cdn delete-waf-white-rules --domain xxx --ids xxx --rule-type xxx + ''', + ) + def delete_waf_white_rules(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.DeleteWafWhiteRulesRequest import DeleteWafWhiteRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteWafWhiteRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询WAF黑名单开关 ''', + description=''' + 查询WAF黑名单开关。 + + 示例: jdc cdn query-waf-black-rule-switch --domain xxx + ''', + ) + def query_waf_black_rule_switch(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryWafBlackRuleSwitchRequest import QueryWafBlackRuleSwitchRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryWafBlackRuleSwitchRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--switch-status'], dict(help="""(string) 开关状态, on:开启,off:关闭 """, dest='switchStatus', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置WAF黑名单开关 ''', + description=''' + 设置WAF黑名单开关。 + + 示例: jdc cdn set-waf-black-rule-switch --domain xxx + ''', + ) + def set_waf_black_rule_switch(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.SetWafBlackRuleSwitchRequest import SetWafBlackRuleSwitchRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = SetWafBlackRuleSwitchRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--rule-type'], dict(help="""(string) ruleType, valid values [ip, geo, uri] """, dest='ruleType', required=True)), + (['--id'], dict(help="""(string) ruleId, defalut empty """, dest='id', required=False)), + (['--page-size'], dict(help="""(int) page size , default 0 to query all """, dest='pageSize', type=int, required=False)), + (['--page-index'], dict(help="""(int) page index , default 0 to query all """, dest='pageIndex', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询WAF黑名单规则列表 ''', + description=''' + 查询WAF黑名单规则列表。 + + 示例: jdc cdn querywaf-black-rules --domain xxx --rule-type xxx + ''', + ) + def querywaf_black_rules(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QuerywafBlackRulesRequest import QuerywafBlackRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QuerywafBlackRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--rule-type'], dict(help="""(string) 黑名单类型, uri ip geo """, dest='ruleType', required=False)), + (['--match-op'], dict(help="""(int) 匹配模式,uri类型有效,0=完全匹配 1=前缀匹配 2=包含 3=正则 4=大于 5=后缀 """, dest='matchOp', type=int, required=False)), + (['--val'], dict(help="""(string) 匹配值 """, dest='val', required=False)), + (['--at-op'], dict(help="""(int) 1:forbidden,493封禁并返回自定义页面 2:redirect,302跳转 3: verify@captcha 4: verify@jscookie """, dest='atOp', type=int, required=False)), + (['--at-val'], dict(help="""(string) action为1时为自定义页面名称,空值或缺省值default为默认页面,2时为跳转url,其他时无效 """, dest='atVal', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 新增一条黑名单规则 ''', + description=''' + 新增一条黑名单规则。 + + 示例: jdc cdn create-waf-black-rule --domain xxx + ''', + ) + def create_waf_black_rule(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.CreateWafBlackRuleRequest import CreateWafBlackRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateWafBlackRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--id'], dict(help="""(string) 需要修改的黑名单ID """, dest='id', required=True)), + (['--rule-type'], dict(help="""(string) 黑名单类型, uri ip geo """, dest='ruleType', required=False)), + (['--match-op'], dict(help="""(int) 匹配模式,uri类型有效,0=完全匹配 1=前缀匹配 2=包含 3=正则 4=大于 5=后缀 """, dest='matchOp', type=int, required=False)), + (['--val'], dict(help="""(string) 匹配值 """, dest='val', required=False)), + (['--at-op'], dict(help="""(int) 1:forbidden,493封禁并返回自定义页面 2:redirect,302跳转 3: verify@captcha 4: verify@jscookie """, dest='atOp', type=int, required=False)), + (['--at-val'], dict(help="""(string) action为1时为自定义页面名称,空值或缺省值default为默认页面,2时为跳转url,其他时无效 """, dest='atVal', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改指定的黑名单规则 ''', + description=''' + 修改指定的黑名单规则。 + + 示例: jdc cdn update-waf-black-rule --domain xxx --id xxx + ''', + ) + def update_waf_black_rule(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.UpdateWafBlackRuleRequest import UpdateWafBlackRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateWafBlackRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--ids'], dict(help="""(array) NA """, dest='ids', required=False)), + (['--rule-type'], dict(help="""(string) NA """, dest='ruleType', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 启用WAF黑名单 ''', + description=''' + 启用WAF黑名单。 + + 示例: jdc cdn enable-waf-black-rules --domain xxx + ''', + ) + def enable_waf_black_rules(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.EnableWafBlackRulesRequest import EnableWafBlackRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = EnableWafBlackRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--ids'], dict(help="""(array) NA """, dest='ids', required=False)), + (['--rule-type'], dict(help="""(string) NA """, dest='ruleType', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 禁用WAF黑名单 ''', + description=''' + 禁用WAF黑名单。 + + 示例: jdc cdn disable-waf-black-rules --domain xxx + ''', + ) + def disable_waf_black_rules(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.DisableWafBlackRulesRequest import DisableWafBlackRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DisableWafBlackRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--ids'], dict(help="""(string) NA """, dest='ids', required=True)), + (['--rule-type'], dict(help="""(string) NA """, dest='ruleType', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除WAF黑名单 ''', + description=''' + 删除WAF黑名单。 + + 示例: jdc cdn delete-waf-black-rules --domain xxx --ids xxx --rule-type xxx + ''', + ) + def delete_waf_black_rules(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.DeleteWafBlackRulesRequest import DeleteWafBlackRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteWafBlackRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询CC 防护开关 ''', + description=''' + 查询CC 防护开关。 + + 示例: jdc cdn query-ccprotect-switch --domain xxx + ''', + ) + def query_ccprotect_switch(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryCCProtectSwitchRequest import QueryCCProtectSwitchRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryCCProtectSwitchRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--switch-status'], dict(help="""(string) 开关状态, on:开启,off:关闭 """, dest='switchStatus', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置CC 防护开关 ''', + description=''' + 设置CC 防护开关。 + + 示例: jdc cdn set-ccprotect-switch --domain xxx + ''', + ) + def set_ccprotect_switch(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.SetCCProtectSwitchRequest import SetCCProtectSwitchRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = SetCCProtectSwitchRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--id'], dict(help="""(string) ruleId, defalut empty """, dest='id', required=False)), + (['--page-size'], dict(help="""(int) page size , default 0 to query all """, dest='pageSize', type=int, required=False)), + (['--page-index'], dict(help="""(int) page index , default 0 to query all """, dest='pageIndex', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询CC防护规则列表 ''', + description=''' + 查询CC防护规则列表。 + + 示例: jdc cdn query-ccprotect-rules --domain xxx + ''', + ) + def query_ccprotect_rules(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryCCProtectRulesRequest import QueryCCProtectRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryCCProtectRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--uri'], dict(help="""(string) null """, dest='uri', required=False)), + (['--detect-period'], dict(help="""(int) null """, dest='detectPeriod', type=int, required=False)), + (['--single-ip-limit'], dict(help="""(int) null """, dest='singleIpLimit', type=int, required=False)), + (['--block-type'], dict(help="""(int) null """, dest='blockType', type=int, required=False)), + (['--block-time'], dict(help="""(int) null """, dest='blockTime', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 新增一条CC防护规则 ''', + description=''' + 新增一条CC防护规则。 + + 示例: jdc cdn create-ccprotect-rule --domain xxx + ''', + ) + def create_ccprotect_rule(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.CreateCCProtectRuleRequest import CreateCCProtectRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateCCProtectRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--id'], dict(help="""(string) 需要修改的规则ID """, dest='id', required=True)), + (['--uri'], dict(help="""(string) null """, dest='uri', required=False)), + (['--detect-period'], dict(help="""(int) null """, dest='detectPeriod', type=int, required=False)), + (['--single-ip-limit'], dict(help="""(int) null """, dest='singleIpLimit', type=int, required=False)), + (['--block-type'], dict(help="""(int) null """, dest='blockType', type=int, required=False)), + (['--block-time'], dict(help="""(int) null """, dest='blockTime', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改CC防护规则 ''', + description=''' + 修改CC防护规则。 + + 示例: jdc cdn update-ccprotect-rule --domain xxx --id xxx + ''', + ) + def update_ccprotect_rule(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.UpdateCCProtectRuleRequest import UpdateCCProtectRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateCCProtectRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--ids'], dict(help="""(array) NA """, dest='ids', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 启用CC防护规则 ''', + description=''' + 启用CC防护规则。 + + 示例: jdc cdn enable-ccprotect-rule --domain xxx + ''', + ) + def enable_ccprotect_rule(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.EnableCCProtectRuleRequest import EnableCCProtectRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = EnableCCProtectRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--ids'], dict(help="""(array) NA """, dest='ids', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 禁用CC防护规则 ''', + description=''' + 禁用CC防护规则。 + + 示例: jdc cdn disable-ccprotect-rule --domain xxx + ''', + ) + def disable_ccprotect_rule(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.DisableCCProtectRuleRequest import DisableCCProtectRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DisableCCProtectRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--ids'], dict(help="""(string) NA """, dest='ids', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除ccProtectRule ''', + description=''' + 删除ccProtectRule。 + + 示例: jdc cdn delete-ccprotect-rule --domain xxx --ids xxx + ''', + ) + def delete_ccprotect_rule(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.DeleteCCProtectRuleRequest import DeleteCCProtectRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteCCProtectRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询web防护开关 ''', + description=''' + 查询web防护开关。 + + 示例: jdc cdn query-web-protect-switch --domain xxx + ''', + ) + def query_web_protect_switch(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryWebProtectSwitchRequest import QueryWebProtectSwitchRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryWebProtectSwitchRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--switch-status'], dict(help="""(string) 开关状态, on:开启,off:关闭 """, dest='switchStatus', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置web防护开关 ''', + description=''' + 设置web防护开关。 + + 示例: jdc cdn set-web-protect-switch --domain xxx + ''', + ) + def set_web_protect_switch(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.SetWebProtectSwitchRequest import SetWebProtectSwitchRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = SetWebProtectSwitchRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询web防护开关 ''', + description=''' + 查询web防护开关。 + + 示例: jdc cdn query-web-protect-settings --domain xxx + ''', + ) + def query_web_protect_settings(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryWebProtectSettingsRequest import QueryWebProtectSettingsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryWebProtectSettingsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--waf-mode'], dict(help="""(string) 0:拦截模式 (阻断forbidden 493跳到自定义页面) ,1-检测模式(观察notice) """, dest='wafMode', required=False)), + (['--waf-level'], dict(help="""(int) 规则策略等级 0为宽松, 1为正常, 2为严格 """, dest='wafLevel', type=int, required=False)), + (['--redirection'], dict(help="""(string) 拦截模式跳转的自定义页面名称, 缺省或default返回默认页面 """, dest='redirection', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置web防护开关 ''', + description=''' + 设置web防护开关。 + + 示例: jdc cdn update-web-protect-settings --domain xxx + ''', + ) + def update_web_protect_settings(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.UpdateWebProtectSettingsRequest import UpdateWebProtectSettingsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateWebProtectSettingsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--skip-type'], dict(help="""(string) skipType, valid values [skip, deny] """, dest='skipType', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询waf地域信息 ''', + description=''' + 查询waf地域信息。 + + 示例: jdc cdn query-waf-regions --skip-type xxx + ''', + ) + def query_waf_regions(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryWafRegionsRequest import QueryWafRegionsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryWafRegionsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询waf ip黑名单配置状态 ''', + description=''' + 查询waf ip黑名单配置状态。 + + 示例: jdc cdn query-ip-black-setting-status --domain xxx + ''', + ) + def query_ip_black_setting_status(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryIpBlackSettingStatusRequest import QueryIpBlackSettingStatusRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryIpBlackSettingStatusRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--tasks'], dict(help="""(array: array) NA """, dest='tasks', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建预热任务接口 ''', + description=''' + 创建预热任务接口。 + + 示例: jdc cdn bat-create-prefetch-task + ''', + ) + def bat_create_prefetch_task(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.BatCreatePrefetchTaskRequest import BatCreatePrefetchTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = BatCreatePrefetchTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--url'], dict(help="""(string) url """, dest='url', required=False)), + (['--region'], dict(help="""(string) 地区[huabei huadong dongbei huazhong huanan xinan xibei gangaotai]中的一个 """, dest='region', required=False)), + (['--isp'], dict(help="""(string) 运营商[ct uni cm]中的一个,分别代表电信 联通 移动 """, dest='isp', required=False)), + (['--copy-num'], dict(help="""(int) 副本数,介于1-1000之间 """, dest='copyNum', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 更新预热任务接口 ''', + description=''' + 更新预热任务接口。 + + 示例: jdc cdn update-prefetch-task + ''', + ) + def update_prefetch_task(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.UpdatePrefetchTaskRequest import UpdatePrefetchTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdatePrefetchTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--url'], dict(help="""(string) url """, dest='url', required=False)), + (['--region'], dict(help="""(string) 地区[huabei huadong dongbei huazhong huanan xinan xibei gangaotai]中的一个 """, dest='region', required=False)), + (['--isp'], dict(help="""(string) 运营商[ct uni cm]中的一个,分别代表电信 联通 移动 """, dest='isp', required=False)), + (['--status'], dict(help="""(int) 查询状态 1:active维护预热中,2:表示purge中暂时停止预热 """, dest='status', type=int, required=False)), + (['--file-id'], dict(help="""(string) 同url,系统内部url对应id(url和file_id同时存在时以url为准) """, dest='fileId', required=False)), + (['--page-number'], dict(help="""(int) 页码数,最小为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页大小,默认10 """, dest='pageSize', type=int, required=False)), + (['--task-type'], dict(help="""(int) 1:代表控制台下发的预热任务2:代表热度计算下发的预热任务3:代表控制台、热度计算共同下发的任务 """, dest='taskType', type=int, required=False)), + (['--domain'], dict(help="""(string) 域名 """, dest='domain', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询预热任务接口 ''', + description=''' + 查询预热任务接口。 + + 示例: jdc cdn query-prefetch-task + ''', + ) + def query_prefetch_task(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryPrefetchTaskRequest import QueryPrefetchTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryPrefetchTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--urls'], dict(help="""(array) 待停止预热的url """, dest='urls', required=False)), + (['--region'], dict(help="""(string) 地区[huabei huadong dongbei huazhong huanan xinan xibei gangaotai]中的一个 """, dest='region', required=False)), + (['--isp'], dict(help="""(string) 运营商[ct uni cm]中的一个,分别代表电信 联通 移动 """, dest='isp', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 停止预热任务接口 ''', + description=''' + 停止预热任务接口。 + + 示例: jdc cdn stop-prefetch-task + ''', + ) + def stop_prefetch_task(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.StopPrefetchTaskRequest import StopPrefetchTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = StopPrefetchTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--urls'], dict(help="""(array) 待刷新的url """, dest='urls', required=False)), + (['--opt-type'], dict(help="""(string) 操作类型:add代表创建刷新任务,stop代表停止刷新任务 """, dest='optType', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 操作刷新任务接口(包含创建、停止刷新任务) ''', + description=''' + 操作刷新任务接口(包含创建、停止刷新任务)。 + + 示例: jdc cdn operate-purge-task + ''', + ) + def operate_purge_task(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.OperatePurgeTaskRequest import OperatePurgeTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = OperatePurgeTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--url'], dict(help="""(string) url """, dest='url', required=False)), + (['--status'], dict(help="""(int) 查询状态 1:进行中 2:已完成 """, dest='status', type=int, required=False)), + (['--file-id'], dict(help="""(string) 同url,系统内部url对应id(url和file_id同时存在时以url为准) """, dest='fileId', required=False)), + (['--page-number'], dict(help="""(int) 页码数,最小为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页大小,默认10 """, dest='pageSize', type=int, required=False)), + (['--domain'], dict(help="""(string) 域名 """, dest='domain', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询刷新任务接口 ''', + description=''' + 查询刷新任务接口。 + + 示例: jdc cdn query-purge-task + ''', + ) + def query_purge_task(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryPurgeTaskRequest import QueryPurgeTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryPurgeTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询网络防护层规则接口 ''', + description=''' + 查询网络防护层规则接口。 + + 示例: jdc cdn query-net-protection-rules + ''', + ) + def query_net_protection_rules(self): + client_factory = ClientFactory('cdn') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cdn.apis.QueryNetProtectionRulesRequest import QueryNetProtectionRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryNetProtectionRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--src-new-conn-limit-enable'], dict(help="""(string) 源新建连接限速,取值on,off,其中on开启,off关闭 """, dest='srcNewConnLimitEnable', required=False)), + (['--dst-new-conn-limit-enable'], dict(help="""(string) 目的新建连接,取值on,off,其中on开启,off关闭 """, dest='dstNewConnLimitEnable', required=False)), + (['--datagram-range-min'], dict(help="""(int) 报文最小长度(包最小长度),取值:1-1500 """, dest='datagramRangeMin', type=int, required=False)), + (['--datagram-range-max'], dict(help="""(int) 报文最大长度(包最大长度),取值:1-1500 """, dest='datagramRangeMax', type=int, required=False)), + (['--dst-new-conn-limit-value'], dict(help="""(int) 目的新建连接限速值,取值:0-4294967295 """, dest='dstNewConnLimitValue', type=int, required=False)), + (['--src-new-conn-limit-value'], dict(help="""(int) 源新建连接限速值,取值:0-4294967295 """, dest='srcNewConnLimitValue', type=int, required=False)), + (['--geo-black'], dict(help="""(array) 地域黑名单(GEO IP拦截) """, dest='geoBlack', required=False)), + (['--ip-black'], dict(help="""(array) ip 黑名单 """, dest='ipBlack', required=False)), + (['--ip-white'], dict(help="""(array) ip 白名单 """, dest='ipWhite', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置网络防护层规则 ''', + description=''' + 设置网络防护层规则。 + + 示例: jdc cdn set-net-protection-rules + ''', + ) + def set_net_protection_rules(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetFollowRedirectRequest import SetFollowRedirectRequest + from jdcloud_sdk.services.cdn.apis.SetNetProtectionRulesRequest import SetNetProtectionRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetFollowRedirectRequest(params_dict, headers) + req = SetNetProtectionRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1224,29 +3370,29 @@ def set_follow_redirect(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询协议跟随回源 ''', + help=''' 查询网络防护层规则 ''', description=''' - 查询协议跟随回源。 + 查询网络防护层规则。 - 示例: jdc cdn query-follow-source-protocol --domain xxx + 示例: jdc cdn query-net-protection-rules-switch ''', ) - def query_follow_source_protocol(self): + def query_net_protection_rules_switch(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryFollowSourceProtocolRequest import QueryFollowSourceProtocolRequest + from jdcloud_sdk.services.cdn.apis.QueryNetProtectionRulesSwitchRequest import QueryNetProtectionRulesSwitchRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryFollowSourceProtocolRequest(params_dict, headers) + req = QueryNetProtectionRulesSwitchRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1256,30 +3402,30 @@ def query_follow_source_protocol(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--status'], dict(help="""(string) 开关取值[on,off] """, dest='status', required=False)), + (['--switch-status'], dict(help="""(string) on,off """, dest='switchStatus', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置协议跟随回源 ''', + help=''' 设置网络防护层规则总开关 ''', description=''' - 设置协议跟随回源。 + 设置网络防护层规则总开关。 - 示例: jdc cdn set-follow-source-protocol --domain xxx + 示例: jdc cdn set-net-protection-rules-switch ''', ) - def set_follow_source_protocol(self): + def set_net_protection_rules_switch(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetFollowSourceProtocolRequest import SetFollowSourceProtocolRequest + from jdcloud_sdk.services.cdn.apis.SetNetProtectionRulesSwitchRequest import SetNetProtectionRulesSwitchRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetFollowSourceProtocolRequest(params_dict, headers) + req = SetNetProtectionRulesSwitchRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1289,32 +3435,29 @@ def set_follow_source_protocol(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--http-type'], dict(help="""(string) http类型,只能为http或者https """, dest='httpType', required=False)), - (['--back-source-type'], dict(help="""(string) 回源类型 """, dest='backSourceType', required=False)), - (['--jump-type'], dict(help="""(string) 有三种类型:default、http、https """, dest='jumpType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新域名配置 ''', + help=''' 查询geo地域 ''', description=''' - 更新域名配置。 + 查询geo地域。 - 示例: jdc cdn set-domain-config --domain xxx + 示例: jdc cdn query-geo-areas ''', ) - def set_domain_config(self): + def query_geo_areas(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetDomainConfigRequest import SetDomainConfigRequest + from jdcloud_sdk.services.cdn.apis.QueryGeoAreasRequest import QueryGeoAreasRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetDomainConfigRequest(params_dict, headers) + req = QueryGeoAreasRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1324,29 +3467,31 @@ def set_domain_config(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2019-08-16T06:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2019-08-16T07:00:00Z """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询域名的全部分类配置 ''', + help=''' 攻击类型统计接口 ''', description=''' - 查询域名的全部分类配置。 + 攻击类型统计接口。 - 示例: jdc cdn query-domain-all-config-classify --domain xxx + 示例: jdc cdn query-attack-type-count ''', ) - def query_domain_all_config_classify(self): + def query_attack_type_count(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryDomainAllConfigClassifyRequest import QueryDomainAllConfigClassifyRequest + from jdcloud_sdk.services.cdn.apis.QueryAttackTypeCountRequest import QueryAttackTypeCountRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDomainAllConfigClassifyRequest(params_dict, headers) + req = QueryAttackTypeCountRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1356,31 +3501,31 @@ def query_domain_all_config_classify(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 源域名 """, dest='domain', required=False)), - (['--copy-domains'], dict(help="""(string) 待复制的域名列表,多个以","分隔,且不超过20个 """, dest='copyDomains', required=False)), - (['--config-keys'], dict(help="""(string) 待复制的配置项名字,区分大小写.配置项的含义:originConfig:回源配置信息;refererConfig:referer防盗链;urlAuthConfig:URL鉴权;userAgentConfig:UA访问控制;ipBlackListConfig:IP黑名单;cacheConfig:缓存配置;schemeFollowOriConfig:协议跟随回源;oriFollowRedirectConfig:回源跟随302;filterParamsConfig:过滤参数;rangeConfig:range回源;videoDraftConfig:视频拖拽;httpsConfig:Https配置;httpHeaderConfig:HttpHeader设置;otherConfig:其他配置 """, dest='configKeys', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2019-08-16T06:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2019-08-16T07:00:00Z """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 域名一键复制配置 ''', + help=''' DDOS攻击报表接口 ''', description=''' - 域名一键复制配置。 + DDOS攻击报表接口。 - 示例: jdc cdn execute-domain-copy + 示例: jdc cdn query-ddos-graph ''', ) - def execute_domain_copy(self): + def query_ddos_graph(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.ExecuteDomainCopyRequest import ExecuteDomainCopyRequest + from jdcloud_sdk.services.cdn.apis.QueryDdosGraphRequest import QueryDdosGraphRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ExecuteDomainCopyRequest(params_dict, headers) + req = QueryDdosGraphRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1390,33 +3535,35 @@ def execute_domain_copy(self): @expose( arguments=[ - (['--share-cache'], dict(help="""(string) 根据是否共享内存筛选 """, dest='shareCache', required=False)), - (['--page-number'], dict(help="""(int) pageNumber """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) pageSize """, dest='pageSize', type=int, required=False)), - (['--primary-domain'], dict(help="""(string) 根据主域名模糊查询 """, dest='primaryDomain', required=False)), - (['--domain-group-name'], dict(help="""(string) 根据域名组模糊查询 """, dest='domainGroupName', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2019-08-16T06:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2019-08-16T07:00:00Z """, dest='endTime', required=False)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页条数 """, dest='pageSize', type=int, required=False)), + (['--sort-field'], dict(help="""(string) 排序字段,默认传avgbandwidth """, dest='sortField', required=False)), + (['--sort-rule'], dict(help="""(string) 排序规则,默认是降序排序,传值asc或者desc """, dest='sortRule', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询域名组接口 ''', + help=''' 攻击记录查询 ''', description=''' - 查询域名组接口。 + 攻击记录查询。 - 示例: jdc cdn query-domain-group-list + 示例: jdc cdn search-attack-log ''', ) - def query_domain_group_list(self): + def search_attack_log(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryDomainGroupListRequest import QueryDomainGroupListRequest + from jdcloud_sdk.services.cdn.apis.SearchAttackLogRequest import SearchAttackLogRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDomainGroupListRequest(params_dict, headers) + req = SearchAttackLogRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1426,29 +3573,31 @@ def query_domain_group_list(self): @expose( arguments=[ - (['--id'], dict(help="""(int) 域名组id """, dest='id', type=int, required=True)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--content'], dict(help="""(string) NA """, dest='content', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询域名组详情 ''', + help=''' 预览证书 ''', description=''' - 查询域名组详情。 + 预览证书。 - 示例: jdc cdn query-domain-group-detail --id 5 + 示例: jdc cdn preview-certificate --domain xxx ''', ) - def query_domain_group_detail(self): + def preview_certificate(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryDomainGroupDetailRequest import QueryDomainGroupDetailRequest + from jdcloud_sdk.services.cdn.apis.PreviewCertificateRequest import PreviewCertificateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDomainGroupDetailRequest(params_dict, headers) + req = PreviewCertificateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1459,27 +3608,28 @@ def query_domain_group_detail(self): @expose( arguments=[ (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询未分组域名 ''', + help=''' 查询默认http header头部参数列表 ''', description=''' - 查询未分组域名。 + 查询默认http header头部参数列表。 - 示例: jdc cdn query-domains-not-in-group + 示例: jdc cdn query-default-http-header-key ''', ) - def query_domains_not_in_group(self): + def query_default_http_header_key(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryDomainsNotInGroupRequest import QueryDomainsNotInGroupRequest + from jdcloud_sdk.services.cdn.apis.QueryDefaultHttpHeaderKeyRequest import QueryDefaultHttpHeaderKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDomainsNotInGroupRequest(params_dict, headers) + req = QueryDefaultHttpHeaderKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1489,33 +3639,30 @@ def query_domains_not_in_group(self): @expose( arguments=[ - (['--id'], dict(help="""(int) 域名组id """, dest='id', type=int, required=True)), - (['--domains'], dict(help="""(array) 域名组内域名,包含主域名 """, dest='domains', required=False)), - (['--primary-domain'], dict(help="""(string) 主域名,开启共享缓存时必传 """, dest='primaryDomain', required=False)), - (['--share-cache'], dict(help="""(string) 是否共享内存 """, dest='shareCache', required=False)), - (['--domain-group-name'], dict(help="""(string) NA """, dest='domainGroupName', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新域名组 ''', + help=''' 查询ip黑白名单 ''', description=''' - 更新域名组。 + 查询ip黑白名单。 - 示例: jdc cdn update-domain-group --id 5 + 示例: jdc cdn query-ip-black-list --domain xxx ''', ) - def update_domain_group(self): + def query_ip_black_list(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.UpdateDomainGroupRequest import UpdateDomainGroupRequest + from jdcloud_sdk.services.cdn.apis.QueryIpBlackListRequest import QueryIpBlackListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateDomainGroupRequest(params_dict, headers) + req = QueryIpBlackListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1525,32 +3672,32 @@ def update_domain_group(self): @expose( arguments=[ - (['--share-cache'], dict(help="""(string) 是否共享内存 """, dest='shareCache', required=False)), - (['--primary-domain'], dict(help="""(string) 主域名,开启共享缓存时必传 """, dest='primaryDomain', required=False)), - (['--domain-group-name'], dict(help="""(string) 域名组名称 """, dest='domainGroupName', required=False)), - (['--domains'], dict(help="""(array) 域名组内域名包含主域名 """, dest='domains', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--ips'], dict(help="""(array) ip名单,ips中url不能超过50条,中国境外/全球加速域名暂不支持传IP段 """, dest='ips', required=False)), + (['--ip-list-type'], dict(help="""(string) ip黑白名单类型,black:黑名单,white:白名单 """, dest='ipListType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建域名组 ''', + help=''' 设置ip黑名白单 ''', description=''' - 创建域名组。 + 设置ip黑名白单。 - 示例: jdc cdn create-domain-group + 示例: jdc cdn set-ip-black-list --domain xxx ''', ) - def create_domain_group(self): + def set_ip_black_list(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.CreateDomainGroupRequest import CreateDomainGroupRequest + from jdcloud_sdk.services.cdn.apis.SetIpBlackListRequest import SetIpBlackListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateDomainGroupRequest(params_dict, headers) + req = SetIpBlackListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1560,29 +3707,31 @@ def create_domain_group(self): @expose( arguments=[ - (['--ids'], dict(help="""(array: int) NA """, dest='ids', type=int, required=True)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--status'], dict(help="""(string) ip黑名单状态取值[on,off] """, dest='status', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量删除域名组 ''', + help=''' 设置ip黑名单状态 ''', description=''' - 批量删除域名组。 + 设置ip黑名单状态。 - 示例: jdc cdn batch-delete-domain-group --ids [0] + 示例: jdc cdn operate-ip-black-list --domain xxx ''', ) - def batch_delete_domain_group(self): + def operate_ip_black_list(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.BatchDeleteDomainGroupRequest import BatchDeleteDomainGroupRequest + from jdcloud_sdk.services.cdn.apis.OperateIpBlackListRequest import OperateIpBlackListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BatchDeleteDomainGroupRequest(params_dict, headers) + req = OperateIpBlackListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1592,34 +3741,30 @@ def batch_delete_domain_group(self): @expose( arguments=[ - (['--key-word'], dict(help="""(string) 根据关键字进行模糊匹配 """, dest='keyWord', required=False)), - (['--page-number'], dict(help="""(int) pageNumber,默认值1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) pageSize,最大值50,默认值20 """, dest='pageSize', type=int, required=False)), - (['--status'], dict(help="""(string) 根据域名状态查询, 可选值[offline, online, configuring, auditing, audit_reject] """, dest='status', required=False)), - (['--type'], dict(help="""(string) 域名类型,(web:静态小文件,download:大文件加速,vod:视频加速,live:直播加速),不传查所有 """, dest='type', required=False)), - (['--accelerate-region'], dict(help="""(string) 加速区域,(mainLand:中国大陆,nonMainLand:海外加港澳台,all:全球),不传为全球 """, dest='accelerateRegion', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询加速域名接口 ''', + help=''' 查询自定义错误页面信息 ''', description=''' - 查询加速域名接口。 + 查询自定义错误页面信息。 - 示例: jdc cdn get-domain-list + 示例: jdc cdn query-custom-error-page --domain xxx ''', ) - def get_domain_list(self): + def query_custom_error_page(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.GetDomainListRequest import GetDomainListRequest + from jdcloud_sdk.services.cdn.apis.QueryCustomErrorPageRequest import QueryCustomErrorPageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDomainListRequest(params_dict, headers) + req = QueryCustomErrorPageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1629,35 +3774,31 @@ def get_domain_list(self): @expose( arguments=[ - (['--key-word'], dict(help="""(string) 根据关键字进行模糊匹配 """, dest='keyWord', required=False)), - (['--page-number'], dict(help="""(int) pageNumber,默认值为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) pageSize,默认值为20,最大值为50 """, dest='pageSize', type=int, required=False)), - (['--status'], dict(help="""(string) 根据域名状态查询, 可选值[offline, online, configuring, auditing, audit_reject] """, dest='status', required=False)), - (['--type'], dict(help="""(string) 域名类型,(web:静态小文件,download:大文件加速,vod:视频加速,live:直播加速),不传查所有 """, dest='type', required=False)), - (['--accelerate-region'], dict(help="""(string) 加速区域,(mainLand:中国大陆,nonMainLand:海外加港澳台,all:全球),不传为全球 """, dest='accelerateRegion', required=False)), - (['--tag-filters'], dict(help="""(array: tagFilter) 标签过滤条件 """, dest='tagFilters', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--error-page-configs'], dict(help="""(array: array) 自定义错误页面配置 """, dest='errorPageConfigs', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 通过标签查询加速域名接口 ''', + help=''' 设置自定义错误页面信息 ''', description=''' - 通过标签查询加速域名接口。 + 设置自定义错误页面信息。 - 示例: jdc cdn get-domain-list-by-filter + 示例: jdc cdn set-custom-error-page --domain xxx ''', ) - def get_domain_list_by_filter(self): + def set_custom_error_page(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.GetDomainListByFilterRequest import GetDomainListByFilterRequest + from jdcloud_sdk.services.cdn.apis.SetCustomErrorPageRequest import SetCustomErrorPageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDomainListByFilterRequest(params_dict, headers) + req = SetCustomErrorPageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1668,28 +3809,33 @@ def get_domain_list_by_filter(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--weight'], dict(help="""(int) 此条配置的权重值, 取值范围为1-10,1最大 """, dest='weight', type=int, required=False)), + (['--ttl'], dict(help="""(int) 缓存时间,单位秒,中国境内加速域名最长可配置2年,中国境外/全球加速域名最长可配置1年 """, dest='ttl', type=int, required=False)), + (['--contents'], dict(help="""(string) 规则内容。其他类型只能以/或者.开头,如/a/b或.jpg """, dest='contents', required=False)), + (['--cache-type'], dict(help="""(int) 缓存方式:0、不缓存,1自定义 """, dest='cacheType', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询加速域名详情 ''', + help=''' 添加缓存规则 ''', description=''' - 查询加速域名详情。 + 添加缓存规则。 - 示例: jdc cdn get-domain-detail --domain xxx + 示例: jdc cdn create-cache-rule --domain xxx ''', ) - def get_domain_detail(self): + def create_cache_rule(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.GetDomainDetailRequest import GetDomainDetailRequest + from jdcloud_sdk.services.cdn.apis.CreateCacheRuleRequest import CreateCacheRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDomainDetailRequest(params_dict, headers) + req = CreateCacheRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1700,43 +3846,34 @@ def get_domain_detail(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--source-type'], dict(help="""(string) 回源类型只能是[ips,domain,oss]中的一种 """, dest='sourceType', required=False)), - (['--cdn-type'], dict(help="""(string) 点播域名的类型只能是[vod,download,web]中的一种 """, dest='cdnType', required=False)), - (['--back-source-type'], dict(help="""(string) 回源方式,只能是[https,http]中的一种,默认http """, dest='backSourceType', required=False)), - (['--daily-band-width'], dict(help="""(int) 日带宽(Mbps) """, dest='dailyBandWidth', type=int, required=False)), - (['--quaility'], dict(help="""(string) 服务质量,只能是[good,general]中的一种,默认为good """, dest='quaility', required=False)), - (['--max-file-size'], dict(help="""(int) NA """, dest='maxFileSize', type=int, required=False)), - (['--min-file-size'], dict(help="""(int) NA """, dest='minFileSize', type=int, required=False)), - (['--sum-file-size'], dict(help="""(int) NA """, dest='sumFileSize', type=int, required=False)), - (['--avg-file-size'], dict(help="""(int) NA """, dest='avgFileSize', type=int, required=False)), - (['--default-source-host'], dict(help="""(string) NA """, dest='defaultSourceHost', required=False)), - (['--http-type'], dict(help="""(string) NA """, dest='httpType', required=False)), - (['--ip-source'], dict(help="""(array: array) NA """, dest='ipSource', required=False)), - (['--domain-source'], dict(help="""(array: array) NA """, dest='domainSource', required=False)), - (['--oss-source'], dict(help="""(string) NA """, dest='ossSource', required=False)), - (['--accelerate-region'], dict(help="""(string) 加速区域:(mainLand:中国大陆,nonMainLand:海外加港澳台,all:全球)默认为中国大陆 """, dest='accelerateRegion', required=False)), + (['--weight'], dict(help="""(int) 此条配置的权重值, 取值范围为1-10,1最大 """, dest='weight', type=int, required=False)), + (['--ttl'], dict(help="""(int) 缓存时间,单位秒,中国境内加速域名最长可配置2年,中国境外/全球加速域名最长可配置1年 """, dest='ttl', type=int, required=False)), + (['--contents'], dict(help="""(string) 规则内容。其他类型只能以/或者.开头,如/a/b或.jpg """, dest='contents', required=False)), + (['--cache-type'], dict(help="""(int) 缓存方式:0、不缓存,1自定义 """, dest='cacheType', type=int, required=False)), + (['--config-id'], dict(help="""(int) 缓存规则配置ID """, dest='configId', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建点播加速域名 ''', + help=''' 修改缓存规则 ''', description=''' - 创建点播加速域名。 + 修改缓存规则。 - 示例: jdc cdn create-domain --domain xxx + 示例: jdc cdn update-cache-rule --domain xxx ''', ) - def create_domain(self): + def update_cache_rule(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.CreateDomainRequest import CreateDomainRequest + from jdcloud_sdk.services.cdn.apis.UpdateCacheRuleRequest import UpdateCacheRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateDomainRequest(params_dict, headers) + req = UpdateCacheRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1747,28 +3884,30 @@ def create_domain(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--config-id'], dict(help="""(int) 缓存规则配置ID """, dest='configId', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除加速域名 ''', + help=''' 删除缓存规则 ''', description=''' - 删除加速域名。 + 删除缓存规则。 - 示例: jdc cdn delete-domain --domain xxx + 示例: jdc cdn delete-cache-rule --domain xxx ''', ) - def delete_domain(self): + def delete_cache_rule(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.DeleteDomainRequest import DeleteDomainRequest + from jdcloud_sdk.services.cdn.apis.DeleteCacheRuleRequest import DeleteCacheRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteDomainRequest(params_dict, headers) + req = DeleteCacheRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1779,28 +3918,30 @@ def delete_domain(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--cache-rules'], dict(help="""(array: array) NA """, dest='cacheRules', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启动加速域名 ''', + help=''' 批量添加缓存规则 ''', description=''' - 启动加速域名。 + 批量添加缓存规则。 - 示例: jdc cdn start-domain --domain xxx + 示例: jdc cdn set-cache-rules --domain xxx ''', ) - def start_domain(self): + def set_cache_rules(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.StartDomainRequest import StartDomainRequest + from jdcloud_sdk.services.cdn.apis.SetCacheRulesRequest import SetCacheRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartDomainRequest(params_dict, headers) + req = SetCacheRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1811,28 +3952,30 @@ def start_domain(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--edge-type'], dict(help="""(int) header生效节点,0边缘,1回源,2两者都 """, dest='edgeType', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 停止加速域名 ''', + help=''' 查询http header头 ''', description=''' - 停止加速域名。 + 查询http header头。 - 示例: jdc cdn stop-domain --domain xxx + 示例: jdc cdn query-http-header --domain xxx ''', ) - def stop_domain(self): + def query_http_header(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.StopDomainRequest import StopDomainRequest + from jdcloud_sdk.services.cdn.apis.QueryHttpHeaderRequest import QueryHttpHeaderRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopDomainRequest(params_dict, headers) + req = QueryHttpHeaderRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1842,28 +3985,34 @@ def stop_domain(self): @expose( arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--edge-type'], dict(help="""(int) 0表示header在边缘生效,1表示header回源生效,2表示在边缘和回源都生效,该字段不传时默认header在边缘和回源都生效 """, dest='edgeType', type=int, required=False)), + (['--header-type'], dict(help="""(string) header类型[resp,req],resp:配置响应头,req:配置请求头 """, dest='headerType', required=False)), + (['--header-name'], dict(help="""(string) header名,例如:Content-Disposition,可自定义,长度不能超过256个字符,不能包含中文字符,不能包含$和_,不支持设置如下头名:["Content-Length","Date","Host","Content-Encoding","If-Modified-Since","If-Range","Content-Type","Transfer-Encoding","Cache-Control","Last-Modified","Connection", "Content-Range","ETag","Age","Authentication-Info","Proxy-Authenticate","Retry-After","Set-Cookie","Vary","Content-Location","Meter","Allow","Error","X-Trace", "Proxy-Connection"] """, dest='headerName', required=False)), + (['--header-value'], dict(help="""(string) header值,不能包含($,_,#),不能超过256个字符 """, dest='headerValue', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询oss存储域名 ''', + help=''' 添加httpHeader ''', description=''' - 查询oss存储域名。 + 添加httpHeader。 - 示例: jdc cdn query-oss-buckets + 示例: jdc cdn set-http-header --domain xxx ''', ) - def query_oss_buckets(self): + def set_http_header(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryOssBucketsRequest import QueryOssBucketsRequest + from jdcloud_sdk.services.cdn.apis.SetHttpHeaderRequest import SetHttpHeaderRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryOssBucketsRequest(params_dict, headers) + req = SetHttpHeaderRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1873,44 +4022,33 @@ def query_oss_buckets(self): @expose( arguments=[ - (['--domains'], dict(help="""(array) NA """, dest='domains', required=False)), - (['--source-type'], dict(help="""(string) 回源类型只能是[ips,domain,oss]中的一种 """, dest='sourceType', required=False)), - (['--cdn-type'], dict(help="""(string) 点播域名的类型只能是[vod,download,web]中的一种 """, dest='cdnType', required=False)), - (['--back-source-type'], dict(help="""(string) 回源方式,只能是[https,http]中的一种,默认http """, dest='backSourceType', required=False)), - (['--daily-band-width'], dict(help="""(int) 日带宽(Mbps) """, dest='dailyBandWidth', type=int, required=False)), - (['--quaility'], dict(help="""(string) 服务质量,只能是[good,general]中的一种,默认为good """, dest='quaility', required=False)), - (['--max-file-size'], dict(help="""(int) NA """, dest='maxFileSize', type=int, required=False)), - (['--min-file-size'], dict(help="""(int) NA """, dest='minFileSize', type=int, required=False)), - (['--sum-file-size'], dict(help="""(int) NA """, dest='sumFileSize', type=int, required=False)), - (['--avg-file-size'], dict(help="""(int) NA """, dest='avgFileSize', type=int, required=False)), - (['--default-source-host'], dict(help="""(string) NA """, dest='defaultSourceHost', required=False)), - (['--http-type'], dict(help="""(string) NA """, dest='httpType', required=False)), - (['--ip-source'], dict(help="""(array: array) NA """, dest='ipSource', required=False)), - (['--domain-source'], dict(help="""(array: array) NA """, dest='domainSource', required=False)), - (['--oss-source'], dict(help="""(string) NA """, dest='ossSource', required=False)), - (['--accelerate-region'], dict(help="""(string) 加速区域 (mainLand:中国大陆,nonMainLand:海外加港澳台,all:全球)默认为中国大陆 """, dest='accelerateRegion', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--edge-type'], dict(help="""(int) 0表示header在边缘生效,1表示header回源生效,2表示在边缘和回源都生效,该字段不传时默认header在边缘和回源都生效 """, dest='edgeType', type=int, required=False)), + (['--header-type'], dict(help="""(string) header类型[resp,req] """, dest='headerType', required=False)), + (['--header-name'], dict(help="""(string) header名 """, dest='headerName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建点播加速域名 ''', + help=''' 删除httpHeader ''', description=''' - 创建点播加速域名。 + 删除httpHeader。 - 示例: jdc cdn batch-create + 示例: jdc cdn delete-http-header --domain xxx ''', ) - def batch_create(self): + def delete_http_header(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.BatchCreateRequest import BatchCreateRequest + from jdcloud_sdk.services.cdn.apis.DeleteHttpHeaderRequest import DeleteHttpHeaderRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BatchCreateRequest(params_dict, headers) + req = DeleteHttpHeaderRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1921,28 +4059,30 @@ def batch_create(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--status'], dict(help="""(string) 开关取值[on,off] """, dest='status', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询域名配置信息 ''', + help=''' 设置视频拖拽 ''', description=''' - 查询域名配置信息。 + 设置视频拖拽。 - 示例: jdc cdn query-domain-config --domain xxx + 示例: jdc cdn set-video-draft --domain xxx ''', ) - def query_domain_config(self): + def set_video_draft(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryDomainConfigRequest import QueryDomainConfigRequest + from jdcloud_sdk.services.cdn.apis.SetVideoDraftRequest import SetVideoDraftRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDomainConfigRequest(params_dict, headers) + req = SetVideoDraftRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1952,29 +4092,31 @@ def query_domain_config(self): @expose( arguments=[ - (['--ips'], dict(help="""(array) NA """, dest='ips', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--status'], dict(help="""(string) 开关取值[on,off] """, dest='status', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取所有上层节点的ip ''', + help=''' 设置range参数 ''', description=''' - 获取所有上层节点的ip。 + 设置range参数。 - 示例: jdc cdn check-whether-ip-belong-to-jcloud + 示例: jdc cdn set-range --domain xxx ''', ) - def check_whether_ip_belong_to_jcloud(self): + def set_range(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.CheckWhetherIpBelongToJCloudRequest import CheckWhetherIpBelongToJCloudRequest + from jdcloud_sdk.services.cdn.apis.SetRangeRequest import SetRangeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CheckWhetherIpBelongToJCloudRequest(params_dict, headers) + req = SetRangeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1985,33 +4127,30 @@ def check_whether_ip_belong_to_jcloud(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--source-type'], dict(help="""(string) 回源类型只能为[ips,domain]中的一种 """, dest='sourceType', required=False)), - (['--back-source-type'], dict(help="""(string) NA """, dest='backSourceType', required=False)), - (['--default-source-host'], dict(help="""(string) 默认回源host """, dest='defaultSourceHost', required=False)), - (['--domain-source'], dict(help="""(array: array) NA """, dest='domainSource', required=False)), - (['--ip-source'], dict(help="""(array: array) NA """, dest='ipSource', required=False)), + (['--status'], dict(help="""(string) 开关取值[on,off] """, dest='status', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置直播域名回源信息 ''', + help=''' 设置忽略参数 ''', description=''' - 设置直播域名回源信息。 + 设置忽略参数。 - 示例: jdc cdn set-live-domain-back-source --domain xxx + 示例: jdc cdn set-ignore-query-string --domain xxx ''', ) - def set_live_domain_back_source(self): + def set_ignore_query_string(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetLiveDomainBackSourceRequest import SetLiveDomainBackSourceRequest + from jdcloud_sdk.services.cdn.apis.SetIgnoreQueryStringRequest import SetIgnoreQueryStringRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLiveDomainBackSourceRequest(params_dict, headers) + req = SetIgnoreQueryStringRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2022,29 +4161,31 @@ def set_live_domain_back_source(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--ips'], dict(help="""(array) NA """, dest='ips', required=False)), + (['--retain-args'], dict(help="""(string) 保留参数,多个用;隔开 """, dest='retainArgs', required=False)), + (['--status'], dict(help="""(string) 忽略参数开关,取值:on or off """, dest='status', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置直播域名ip黑名单 ''', + help=''' 设置过滤参数 ''', description=''' - 设置直播域名ip黑名单。 + 设置过滤参数。 - 示例: jdc cdn set-live-domain-ip-black-list --domain xxx + 示例: jdc cdn set-filter-args --domain xxx ''', ) - def set_live_domain_ip_black_list(self): + def set_filter_args(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetLiveDomainIpBlackListRequest import SetLiveDomainIpBlackListRequest + from jdcloud_sdk.services.cdn.apis.SetFilterArgsRequest import SetFilterArgsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLiveDomainIpBlackListRequest(params_dict, headers) + req = SetFilterArgsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2055,32 +4196,29 @@ def set_live_domain_ip_black_list(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--refer-type'], dict(help="""(string) refer类型,取值:block(黑名单),allow(白名单)默认为block """, dest='referType', required=False)), - (['--refer-list'], dict(help="""(array) 逗号隔开的域名列表,如果referList传空则为删除 """, dest='referList', required=False)), - (['--allow-no-refer-header'], dict(help="""(string) 是否允许空refer访问,默认为“on” """, dest='allowNoReferHeader', required=False)), - (['--allow-null-refer-header'], dict(help="""(string) 是否允许无ua访问,默认为“on” """, dest='allowNullReferHeader', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置域名refer防盗链 ''', + help=''' 查询保留参数信息 ''', description=''' - 设置域名refer防盗链。 + 查询保留参数信息。 - 示例: jdc cdn set-live-domain-refer --domain xxx + 示例: jdc cdn query-filter-args --domain xxx ''', ) - def set_live_domain_refer(self): + def query_filter_args(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetLiveDomainReferRequest import SetLiveDomainReferRequest + from jdcloud_sdk.services.cdn.apis.QueryFilterArgsRequest import QueryFilterArgsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLiveDomainReferRequest(params_dict, headers) + req = QueryFilterArgsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2091,29 +4229,29 @@ def set_live_domain_refer(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--black-ips-enable'], dict(help="""(string) NA """, dest='blackIpsEnable', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启或关闭ip黑名单 ''', + help=''' 设置userAgent信息 ''', description=''' - 开启或关闭ip黑名单。 + 设置userAgent信息。 - 示例: jdc cdn operate-live-domain-ip-black-list --domain xxx + 示例: jdc cdn query-user-agent --domain xxx ''', ) - def operate_live_domain_ip_black_list(self): + def query_user_agent(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.OperateLiveDomainIpBlackListRequest import OperateLiveDomainIpBlackListRequest + from jdcloud_sdk.services.cdn.apis.QueryUserAgentRequest import QueryUserAgentRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = OperateLiveDomainIpBlackListRequest(params_dict, headers) + req = QueryUserAgentRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2124,29 +4262,31 @@ def operate_live_domain_ip_black_list(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--source-host'], dict(help="""(string) 默认回源host """, dest='sourceHost', required=False)), + (['--user-agent-type'], dict(help="""(string) userAgent类型,取值:block(黑名单),allow(白名单),默认为block """, dest='userAgentType', required=False)), + (['--user-agent-list'], dict(help="""(array) UA列表,如果userAgentList为空,则为全部删除 """, dest='userAgentList', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置直播域名回源host ''', + help=''' 设置userAgent信息 ''', description=''' - 设置直播域名回源host。 + 设置userAgent信息。 - 示例: jdc cdn set-live-domain-back-source-host --domain xxx + 示例: jdc cdn set-user-agent-config --domain xxx ''', ) - def set_live_domain_back_source_host(self): + def set_user_agent_config(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetLiveDomainBackSourceHostRequest import SetLiveDomainBackSourceHostRequest + from jdcloud_sdk.services.cdn.apis.SetUserAgentConfigRequest import SetUserAgentConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLiveDomainBackSourceHostRequest(params_dict, headers) + req = SetUserAgentConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2157,31 +4297,29 @@ def set_live_domain_back_source_host(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--accesskey-type'], dict(help="""(int) url鉴权开启1关闭0 """, dest='accesskeyType', type=int, required=False)), - (['--accesskey-key'], dict(help="""(string) url鉴权开启时必传 """, dest='accesskeyKey', required=False)), - (['--auth-life-time'], dict(help="""(int) 开启时默认值为300s,关闭时为0 """, dest='authLifeTime', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置URL鉴权 ''', + help=''' 查询url鉴权 ''', description=''' - 设置URL鉴权。 + 查询url鉴权。 - 示例: jdc cdn set-live-domain-access-key --domain xxx + 示例: jdc cdn query-accesskey-config --domain xxx ''', ) - def set_live_domain_access_key(self): + def query_accesskey_config(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetLiveDomainAccessKeyRequest import SetLiveDomainAccessKeyRequest + from jdcloud_sdk.services.cdn.apis.QueryAccesskeyConfigRequest import QueryAccesskeyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLiveDomainAccessKeyRequest(params_dict, headers) + req = QueryAccesskeyConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2192,35 +4330,32 @@ def set_live_domain_access_key(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--certificate'], dict(help="""(string) https证书,转https格式时必传 """, dest='certificate', required=False)), - (['--rsa-key'], dict(help="""(string) https私钥,转https格式时必传 """, dest='rsaKey', required=False)), - (['--cert-from'], dict(help="""(string) 证书来源有两种类型:default,ssl """, dest='certFrom', required=False)), - (['--ssl-cert-id'], dict(help="""(string) ssl证书id """, dest='sslCertId', required=False)), - (['--sync-to-ssl'], dict(help="""(bool) 是否同步到ssl,boolean值,取值true或者false """, dest='syncToSsl', required=False)), - (['--cert-name'], dict(help="""(string) syncToSsl是true时,certName是必填项 """, dest='certName', required=False)), - (['--protocol-converts'], dict(help="""(array: array) NA """, dest='protocolConverts', required=False)), + (['--accesskey-type'], dict(help="""(int) 鉴权类型,0表示无鉴权,1表示参数鉴权,2表示路径鉴权 """, dest='accesskeyType', type=int, required=False)), + (['--accesskey-key'], dict(help="""(string) 密码,长度为8到32 """, dest='accesskeyKey', required=False)), + (['--accesskey-keep'], dict(help="""(int) 是否是回源鉴权 0表示是 1表示否 """, dest='accesskeyKeep', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置转协议 ''', + help=''' 设置url鉴权 ''', description=''' - 设置转协议。 + 设置url鉴权。 - 示例: jdc cdn set-protocol-convert --domain xxx + 示例: jdc cdn set-accesskey-config --domain xxx ''', ) - def set_protocol_convert(self): + def set_accesskey_config(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetProtocolConvertRequest import SetProtocolConvertRequest + from jdcloud_sdk.services.cdn.apis.SetAccesskeyConfigRequest import SetAccesskeyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetProtocolConvertRequest(params_dict, headers) + req = SetAccesskeyConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2231,29 +4366,33 @@ def set_protocol_convert(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--delete-streams'], dict(help="""(array: array) 要删除的禁播流 """, dest='deleteStreams', required=False)), + (['--refer-type'], dict(help="""(string) refer类型,取值:block(黑名单),allow(白名单)默认为block """, dest='referType', required=False)), + (['--refer-list'], dict(help="""(array) 逗号隔开的域名列表,如果referList传空则为删除,中国境内加速域名至多可配置400条,中国境外/全球加速域名至多可配置50条 """, dest='referList', required=False)), + (['--allow-no-refer-header'], dict(help="""(string) 是否允许空refer访问,默认为“on” """, dest='allowNoReferHeader', required=False)), + (['--allow-null-refer-header'], dict(help="""(string) 是否允许无ua访问,默认为“on” """, dest='allowNullReferHeader', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除禁播流 ''', + help=''' 设置域名refer ''', description=''' - 删除禁播流。 + 设置域名refer。 - 示例: jdc cdn delete-forbidden-stream --domain xxx + 示例: jdc cdn set-refer --domain xxx ''', ) - def delete_forbidden_stream(self): + def set_refer(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.DeleteForbiddenStreamRequest import DeleteForbiddenStreamRequest + from jdcloud_sdk.services.cdn.apis.SetReferRequest import SetReferRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteForbiddenStreamRequest(params_dict, headers) + req = SetReferRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2264,72 +4403,65 @@ def delete_forbidden_stream(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--app'], dict(help="""(string) app名,传appName查询流名列表 """, dest='app', required=False)), - (['--stream'], dict(help="""(string) 流名模糊查询 """, dest='stream', required=False)), - (['--limit'], dict(help="""(int) 指定app/流名列表大小,默认50 """, dest='limit', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户推流域名app名/流名 ''', + help=''' 查询源站监控信息 ''', description=''' - 查询用户推流域名app名/流名。 + 查询源站监控信息。 - 示例: jdc cdn query-push-domain-orapp-or-stream --domain xxx + 示例: jdc cdn query-monitor --domain xxx ''', ) - def query_push_domain_orapp_or_stream(self): + def query_monitor(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryPushDomainORAppOrStreamRequest import QueryPushDomainORAppOrStreamRequest + from jdcloud_sdk.services.cdn.apis.QueryMonitorRequest import QueryMonitorRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryPushDomainORAppOrStreamRequest(params_dict, headers) + req = QueryMonitorRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: print('{"error":"This api is not supported, please use the newer version"}') except Exception as e: - print(e) - - @expose( - arguments=[ - (['--play-domain'], dict(help="""(string) 播放域名 """, dest='playDomain', required=False)), - (['--publish-domain'], dict(help="""(string) 创建推流域名时,必传推流域名 """, dest='publishDomain', required=False)), - (['--source-type'], dict(help="""(string) 回源类型只能是[ips,domain]中的一种 """, dest='sourceType', required=False)), - (['--back-http-type'], dict(help="""(string) NA """, dest='backHttpType', required=False)), - (['--default-source-host'], dict(help="""(string) 默认回源host """, dest='defaultSourceHost', required=False)), - (['--site-type'], dict(help="""(string) 站点类型pull(拉流)push(推流) """, dest='siteType', required=False)), - (['--back-source-type'], dict(help="""(string) 回源类型,目前只能为rtmp """, dest='backSourceType', required=False)), - (['--ip-source'], dict(help="""(array: array) NA """, dest='ipSource', required=False)), - (['--domain-source'], dict(help="""(array: array) NA """, dest='domainSource', required=False)), - (['--accelerate-region'], dict(help="""(string) 加速区域(mainLand:中国大陆,nonMainLand:海外加港澳台,all:全球)默认为中国大陆 """, dest='accelerateRegion', required=False)), + print(e) + + @expose( + arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--cycle'], dict(help="""(int) 探测周期,取值1和5,单位为分钟 """, dest='cycle', type=int, required=False)), + (['--monitor-path'], dict(help="""(string) 探测路径 """, dest='monitorPath', required=False)), + (['--http-request-header'], dict(help="""(object) http请求头 """, dest='httpRequestHeader', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建直播域名 ''', + help=''' 设置源站监控信息 ''', description=''' - 创建直播域名。 + 设置源站监控信息。 - 示例: jdc cdn batch-create-live-domain + 示例: jdc cdn set-monitor --domain xxx ''', ) - def batch_create_live_domain(self): + def set_monitor(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.BatchCreateLiveDomainRequest import BatchCreateLiveDomainRequest + from jdcloud_sdk.services.cdn.apis.SetMonitorRequest import SetMonitorRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BatchCreateLiveDomainRequest(params_dict, headers) + req = SetMonitorRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2341,27 +4473,28 @@ def batch_create_live_domain(self): arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播域名详情v1 ''', + help=''' 停止源站监控 ''', description=''' - 查询直播域名详情v1。 + 停止源站监控。 - 示例: jdc cdn query-live-domain-detail --domain xxx + 示例: jdc cdn stop-monitor --domain xxx ''', ) - def query_live_domain_detail(self): + def stop_monitor(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryLiveDomainDetailRequest import QueryLiveDomainDetailRequest + from jdcloud_sdk.services.cdn.apis.StopMonitorRequest import StopMonitorRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryLiveDomainDetailRequest(params_dict, headers) + req = StopMonitorRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2372,28 +4505,36 @@ def query_live_domain_detail(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--source-type'], dict(help="""(string) 回源类型只能是[ips,domain,oss]中的一种 """, dest='sourceType', required=False)), + (['--back-source-type'], dict(help="""(string) 回源方式,只能是[https,http]中的一种,默认http """, dest='backSourceType', required=False)), + (['--accelerate-region'], dict(help="""(string) 加速区域,必须是[mainland,nonMainland,all]中的一种,分别代表大陆,海外+中国港澳台,全球 """, dest='accelerateRegion', required=False)), + (['--ip-source'], dict(help="""(array: array) NA """, dest='ipSource', required=False)), + (['--domain-source'], dict(help="""(array: array) NA """, dest='domainSource', required=False)), + (['--oss-source'], dict(help="""(string) oss回源域名 """, dest='ossSource', required=False)), + (['--default-source-host'], dict(help="""(string) 默认回源host """, dest='defaultSourceHost', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播域名app列表 ''', + help=''' 设置源站信息 ''', description=''' - 查询直播域名app列表。 + 设置源站信息。 - 示例: jdc cdn query-live-domain-apps --domain xxx + 示例: jdc cdn set-source --domain xxx ''', ) - def query_live_domain_apps(self): + def set_source(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryLiveDomainAppsRequest import QueryLiveDomainAppsRequest + from jdcloud_sdk.services.cdn.apis.SetSourceRequest import SetSourceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryLiveDomainAppsRequest(params_dict, headers) + req = SetSourceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2403,31 +4544,31 @@ def query_live_domain_apps(self): @expose( arguments=[ - (['--url-list'], dict(help="""(array) 预热的URL """, dest='urlList', required=False)), - (['--prefetch-time'], dict(help="""(int) 预热时长 """, dest='prefetchTime', type=int, required=False)), - (['--action'], dict(help="""(string) 操作类型只能是[start,stop]中的一种 """, dest='action', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--status'], dict(help="""(string) 共享缓存只能是off或者on """, dest='status', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建直播预热任务 ''', + help=''' 泛域名共享缓存 ''', description=''' - 创建直播预热任务。 + 泛域名共享缓存。 - 示例: jdc cdn create-live-domain-prefecth-task + 示例: jdc cdn operate-share-cache --domain xxx ''', ) - def create_live_domain_prefecth_task(self): + def operate_share_cache(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.CreateLiveDomainPrefecthTaskRequest import CreateLiveDomainPrefecthTaskRequest + from jdcloud_sdk.services.cdn.apis.OperateShareCacheRequest import OperateShareCacheRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateLiveDomainPrefecthTaskRequest(params_dict, headers) + req = OperateShareCacheRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2437,29 +4578,38 @@ def create_live_domain_prefecth_task(self): @expose( arguments=[ - (['--url-list'], dict(help="""(array) 预热的URL """, dest='urlList', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--http-type'], dict(help="""(string) http类型,只能为http或者https,默认为http.当设为https时,需要调用“设置通讯协议”接口上传证书和私钥 """, dest='httpType', required=False)), + (['--certificate'], dict(help="""(string) 用户证书,当Type为https时必须设置 """, dest='certificate', required=False)), + (['--rsa-key'], dict(help="""(string) 证书私钥 """, dest='rsaKey', required=False)), + (['--jump-type'], dict(help="""(string) 有三种类型:default、http、https """, dest='jumpType', required=False)), + (['--cert-from'], dict(help="""(string) 证书来源有两种类型:default,ssl """, dest='certFrom', required=False)), + (['--ssl-cert-id'], dict(help="""(string) ssl证书id """, dest='sslCertId', required=False)), + (['--sync-to-ssl'], dict(help="""(bool) 是否同步到ssl,boolean值,取值true或者false """, dest='syncToSsl', type=bool, required=False)), + (['--cert-name'], dict(help="""(string) syncToSsl是true时,certName是必填项 """, dest='certName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播预热任务 ''', + help=''' 设置http协议 ''', description=''' - 查询直播预热任务。 + 设置http协议。 - 示例: jdc cdn query-live-prefetch-task + 示例: jdc cdn set-http-type --domain xxx ''', ) - def query_live_prefetch_task(self): + def set_http_type(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryLivePrefetchTaskRequest import QueryLivePrefetchTaskRequest + from jdcloud_sdk.services.cdn.apis.SetHttpTypeRequest import SetHttpTypeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryLivePrefetchTaskRequest(params_dict, headers) + req = SetHttpTypeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2469,30 +4619,30 @@ def query_live_prefetch_task(self): @expose( arguments=[ - (['--task-ids'], dict(help="""(array) 查询的任务taskIds列表,最多能查10条 """, dest='taskIds', required=False)), - (['--keyword'], dict(help="""(string) url的模糊查询关键字 """, dest='keyword', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据taskIds查询刷新预热任务 ''', + help=''' 查询回源302跳转信息 ''', description=''' - 根据taskIds查询刷新预热任务。 + 查询回源302跳转信息。 - 示例: jdc cdn query-refresh-task-by-ids + 示例: jdc cdn query-follow-redirect --domain xxx ''', ) - def query_refresh_task_by_ids(self): + def query_follow_redirect(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryRefreshTaskByIdsRequest import QueryRefreshTaskByIdsRequest + from jdcloud_sdk.services.cdn.apis.QueryFollowRedirectRequest import QueryFollowRedirectRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryRefreshTaskByIdsRequest(params_dict, headers) + req = QueryFollowRedirectRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2502,29 +4652,31 @@ def query_refresh_task_by_ids(self): @expose( arguments=[ - (['--task-id'], dict(help="""(string) 域名组id """, dest='taskId', required=True)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--status'], dict(help="""(string) 开关取值[on,off] """, dest='status', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据taskId查询刷新预热任务 ''', + help=''' 设置回源302跳转 ''', description=''' - 根据taskId查询刷新预热任务。 + 设置回源302跳转。 - 示例: jdc cdn query-refresh-task-by-id --task-id xxx + 示例: jdc cdn set-follow-redirect --domain xxx ''', ) - def query_refresh_task_by_id(self): + def set_follow_redirect(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryRefreshTaskByIdRequest import QueryRefreshTaskByIdRequest + from jdcloud_sdk.services.cdn.apis.SetFollowRedirectRequest import SetFollowRedirectRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryRefreshTaskByIdRequest(params_dict, headers) + req = SetFollowRedirectRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2534,30 +4686,30 @@ def query_refresh_task_by_id(self): @expose( arguments=[ - (['--task-type'], dict(help="""(string) 刷新预热类型,(url:url刷新,dir:目录刷新,prefetch:预热) """, dest='taskType', required=False)), - (['--url-items'], dict(help="""(array: array) NA """, dest='urlItems', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建刷新预热回调任务 ''', + help=''' 查询协议跟随回源 ''', description=''' - 创建刷新预热回调任务。 + 查询协议跟随回源。 - 示例: jdc cdn create-refresh-task-for-callback + 示例: jdc cdn query-follow-source-protocol --domain xxx ''', ) - def create_refresh_task_for_callback(self): + def query_follow_source_protocol(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.CreateRefreshTaskForCallbackRequest import CreateRefreshTaskForCallbackRequest + from jdcloud_sdk.services.cdn.apis.QueryFollowSourceProtocolRequest import QueryFollowSourceProtocolRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateRefreshTaskForCallbackRequest(params_dict, headers) + req = QueryFollowSourceProtocolRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2567,30 +4719,31 @@ def create_refresh_task_for_callback(self): @expose( arguments=[ - (['--task-type'], dict(help="""(string) 刷新预热类型,(url:url刷新,dir:目录刷新,prefetch:预热) """, dest='taskType', required=False)), - (['--url-items'], dict(help="""(array: array) NA """, dest='urlItems', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--status'], dict(help="""(string) 开关取值[on,off] """, dest='status', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建刷新预热回调任务 ''', + help=''' 设置协议跟随回源 ''', description=''' - 创建刷新预热回调任务。 + 设置协议跟随回源。 - 示例: jdc cdn create-refresh-task-for-callback-v2 + 示例: jdc cdn set-follow-source-protocol --domain xxx ''', ) - def create_refresh_task_for_callback_v2(self): + def set_follow_source_protocol(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.CreateRefreshTaskForCallbackV2Request import CreateRefreshTaskForCallbackV2Request + from jdcloud_sdk.services.cdn.apis.SetFollowSourceProtocolRequest import SetFollowSourceProtocolRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateRefreshTaskForCallbackV2Request(params_dict, headers) + req = SetFollowSourceProtocolRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2600,36 +4753,36 @@ def create_refresh_task_for_callback_v2(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--keyword'], dict(help="""(string) url或者目录的模糊查询关键字 """, dest='keyword', required=False)), - (['--task-id'], dict(help="""(string) 任务id """, dest='taskId', required=False)), - (['--task-status'], dict(help="""(string) null """, dest='taskStatus', required=False)), - (['--task-type'], dict(help="""(string) null """, dest='taskType', required=False)), - (['--page-number'], dict(help="""(int) 分页页数,默认值1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页页面大小,默认值50 """, dest='pageSize', type=int, required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--http-type'], dict(help="""(string) http类型,只能为http或者https """, dest='httpType', required=False)), + (['--back-source-type'], dict(help="""(string) 回源类型 """, dest='backSourceType', required=False)), + (['--jump-type'], dict(help="""(string) 有三种类型:default、http、https """, dest='jumpType', required=False)), + (['--jcdn-time-anti'], dict(help="""(string) dash鉴权相关配置 """, dest='jcdnTimeAnti', required=False)), + (['--hdr-ctrl'], dict(help="""(string) 回源鉴权相关配置 """, dest='hdrCtrl', required=False)), + (['--toutiao-header'], dict(help="""(string) 头条header配置 """, dest='toutiaoHeader', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询刷新预热任务 ''', + help=''' 更新域名配置 ''', description=''' - 查询刷新预热任务。 + 更新域名配置。 - 示例: jdc cdn query-refresh-task + 示例: jdc cdn set-domain-config --domain xxx ''', ) - def query_refresh_task(self): + def set_domain_config(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryRefreshTaskRequest import QueryRefreshTaskRequest + from jdcloud_sdk.services.cdn.apis.SetDomainConfigRequest import SetDomainConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryRefreshTaskRequest(params_dict, headers) + req = SetDomainConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2639,30 +4792,30 @@ def query_refresh_task(self): @expose( arguments=[ - (['--task-type'], dict(help="""(string) 刷新预热类型,(url:url刷新,dir:目录刷新,prefetch:预热) """, dest='taskType', required=False)), - (['--urls'], dict(help="""(array) NA """, dest='urls', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建刷新预热任务 ''', + help=''' 查询域名的全部分类配置 ''', description=''' - 创建刷新预热任务。 + 查询域名的全部分类配置。 - 示例: jdc cdn create-refresh-task + 示例: jdc cdn query-domain-all-config-classify --domain xxx ''', ) - def create_refresh_task(self): + def query_domain_all_config_classify(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.CreateRefreshTaskRequest import CreateRefreshTaskRequest + from jdcloud_sdk.services.cdn.apis.QueryDomainAllConfigClassifyRequest import QueryDomainAllConfigClassifyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateRefreshTaskRequest(params_dict, headers) + req = QueryDomainAllConfigClassifyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2672,28 +4825,32 @@ def create_refresh_task(self): @expose( arguments=[ + (['--domain'], dict(help="""(string) 源域名 """, dest='domain', required=False)), + (['--copy-domains'], dict(help="""(string) 待复制的域名列表,多个以","分隔,且不超过20个 """, dest='copyDomains', required=False)), + (['--config-keys'], dict(help="""(string) 待复制的配置项名字,区分大小写.配置项的含义:originConfig:回源配置信息;refererConfig:referer防盗链;urlAuthConfig:URL鉴权;userAgentConfig:UA访问控制;ipBlackListConfig:IP黑名单;cacheConfig:缓存配置;schemeFollowOriConfig:协议跟随回源;oriFollowRedirectConfig:回源跟随302;filterParamsConfig:过滤参数;rangeConfig:range回源;videoDraftConfig:视频拖拽;httpsConfig:Https配置;httpHeaderConfig:HttpHeader设置;otherConfig:其他配置 """, dest='configKeys', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询网络防护层规则接口 ''', + help=''' 域名一键复制配置 ''', description=''' - 查询网络防护层规则接口。 + 域名一键复制配置。 - 示例: jdc cdn query-net-protection-rules + 示例: jdc cdn execute-domain-copy ''', ) - def query_net_protection_rules(self): + def execute_domain_copy(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryNetProtectionRulesRequest import QueryNetProtectionRulesRequest + from jdcloud_sdk.services.cdn.apis.ExecuteDomainCopyRequest import ExecuteDomainCopyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryNetProtectionRulesRequest(params_dict, headers) + req = ExecuteDomainCopyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2703,37 +4860,30 @@ def query_net_protection_rules(self): @expose( arguments=[ - (['--src-new-conn-limit-enable'], dict(help="""(string) 源新建连接限速,取值on,off,其中on开启,off关闭 """, dest='srcNewConnLimitEnable', required=False)), - (['--dst-new-conn-limit-enable'], dict(help="""(string) 目的新建连接,取值on,off,其中on开启,off关闭 """, dest='dstNewConnLimitEnable', required=False)), - (['--datagram-range-min'], dict(help="""(int) 报文最小长度(包最小长度),取值:1-1500 """, dest='datagramRangeMin', type=int, required=False)), - (['--datagram-range-max'], dict(help="""(int) 报文最大长度(包最大长度),取值:1-1500 """, dest='datagramRangeMax', type=int, required=False)), - (['--dst-new-conn-limit-value'], dict(help="""(int) 目的新建连接限速值,取值:0-4294967295 """, dest='dstNewConnLimitValue', type=int, required=False)), - (['--src-new-conn-limit-value'], dict(help="""(int) 源新建连接限速值,取值:0-4294967295 """, dest='srcNewConnLimitValue', type=int, required=False)), - (['--geo-black'], dict(help="""(array) 地域黑名单(GEO IP拦截) """, dest='geoBlack', required=False)), - (['--ip-black'], dict(help="""(array) ip 黑名单 """, dest='ipBlack', required=False)), - (['--ip-white'], dict(help="""(array) ip 白名单 """, dest='ipWhite', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置网络防护层规则 ''', + help=''' 查询异常码缓存时间 ''', description=''' - 设置网络防护层规则。 + 查询异常码缓存时间。 - 示例: jdc cdn set-net-protection-rules + 示例: jdc cdn query-extra-cache-time --domain xxx ''', ) - def set_net_protection_rules(self): + def query_extra_cache_time(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetNetProtectionRulesRequest import SetNetProtectionRulesRequest + from jdcloud_sdk.services.cdn.apis.QueryExtraCacheTimeRequest import QueryExtraCacheTimeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetNetProtectionRulesRequest(params_dict, headers) + req = QueryExtraCacheTimeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2743,28 +4893,32 @@ def set_net_protection_rules(self): @expose( arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--http-code'], dict(help="""(string) 异常状态码 ["4xx","400", "401", "402", "404", "405", "406", "407", "408", "409", "410", "411", "412", "413", "414", "415", "416", "417", "5xx","500", "501", "502", "503", "504", "505"]中的其中一个 """, dest='httpCode', required=False)), + (['--cache-time'], dict(help="""(int) 缓存时间(单位:秒) """, dest='cacheTime', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询网络防护层规则 ''', + help=''' 设置异常码缓存时间 ''', description=''' - 查询网络防护层规则。 + 设置异常码缓存时间。 - 示例: jdc cdn query-net-protection-rules-switch + 示例: jdc cdn set-extra-cache-time --domain xxx ''', ) - def query_net_protection_rules_switch(self): + def set_extra_cache_time(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryNetProtectionRulesSwitchRequest import QueryNetProtectionRulesSwitchRequest + from jdcloud_sdk.services.cdn.apis.SetExtraCacheTimeRequest import SetExtraCacheTimeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryNetProtectionRulesSwitchRequest(params_dict, headers) + req = SetExtraCacheTimeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2774,29 +4928,31 @@ def query_net_protection_rules_switch(self): @expose( arguments=[ - (['--switch-status'], dict(help="""(string) on,off """, dest='switchStatus', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--http-code'], dict(help="""(string) 异常状态码 ["4xx","400", "401", "402", "404", "405", "406", "407", "408", "409", "410", "411", "412", "413", "414", "415", "416", "417", "5xx","500", "501", "502", "503", "504", "505"]中的其中一个 """, dest='httpCode', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置网络防护层规则总开关 ''', + help=''' 删除异常码缓存时间 ''', description=''' - 设置网络防护层规则总开关。 + 删除异常码缓存时间。 - 示例: jdc cdn set-net-protection-rules-switch + 示例: jdc cdn delete-extra-cache-time --domain xxx ''', ) - def set_net_protection_rules_switch(self): + def delete_extra_cache_time(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetNetProtectionRulesSwitchRequest import SetNetProtectionRulesSwitchRequest + from jdcloud_sdk.services.cdn.apis.DeleteExtraCacheTimeRequest import DeleteExtraCacheTimeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetNetProtectionRulesSwitchRequest(params_dict, headers) + req = DeleteExtraCacheTimeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2806,28 +4962,31 @@ def set_net_protection_rules_switch(self): @expose( arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--content'], dict(help="""(string) 状态码和过期时间,多个用英文分号分隔,如404:3;500:10;异常状态码 ["4xx","400", "401", "402", "404", "405", "406", "407", "408", "409", "410", "411", "412", "413", "414", "415", "416", "417", "5xx","500", "501", "502", "503", "504", "505"]中的其中一个,缓存时间(单位:秒) """, dest='content', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询geo地域 ''', + help=''' 批量设置异常码缓存时间 ''', description=''' - 查询geo地域。 + 批量设置异常码缓存时间。 - 示例: jdc cdn query-geo-areas + 示例: jdc cdn batch-set-extra-cache-time --domain xxx ''', ) - def query_geo_areas(self): + def batch_set_extra_cache_time(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryGeoAreasRequest import QueryGeoAreasRequest + from jdcloud_sdk.services.cdn.apis.BatchSetExtraCacheTimeRequest import BatchSetExtraCacheTimeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryGeoAreasRequest(params_dict, headers) + req = BatchSetExtraCacheTimeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2837,30 +4996,32 @@ def query_geo_areas(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2019-08-16T06:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2019-08-16T07:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--status'], dict(help="""(string) 开关取值[on,off] """, dest='status', required=False)), + (['--gzip-types'], dict(help="""(string) gzip类型,如application/x-javascript,application/xml """, dest='gzipTypes', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 攻击类型统计接口 ''', + help=''' 设置gzip ''', description=''' - 攻击类型统计接口。 + 设置gzip。 - 示例: jdc cdn query-attack-type-count + 示例: jdc cdn set-gzip --domain xxx ''', ) - def query_attack_type_count(self): + def set_gzip(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryAttackTypeCountRequest import QueryAttackTypeCountRequest + from jdcloud_sdk.services.cdn.apis.SetGzipRequest import SetGzipRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryAttackTypeCountRequest(params_dict, headers) + req = SetGzipRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2870,30 +5031,32 @@ def query_attack_type_count(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2019-08-16T06:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2019-08-16T07:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--before-regex'], dict(help="""(string) 回源改写之前的正则表达式 """, dest='beforeRegex', required=False)), + (['--after-regex'], dict(help="""(string) 回源改写之后的正则表达式 """, dest='afterRegex', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' DDOS攻击报表接口 ''', + help=''' 回源改写配置 ''', description=''' - DDOS攻击报表接口。 + 回源改写配置。 - 示例: jdc cdn query-ddos-graph + 示例: jdc cdn config-back-source-rule --domain xxx ''', ) - def query_ddos_graph(self): + def config_back_source_rule(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryDdosGraphRequest import QueryDdosGraphRequest + from jdcloud_sdk.services.cdn.apis.ConfigBackSourceRuleRequest import ConfigBackSourceRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDdosGraphRequest(params_dict, headers) + req = ConfigBackSourceRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2903,34 +5066,30 @@ def query_ddos_graph(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2019-08-16T06:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2019-08-16T07:00:00Z """, dest='endTime', required=False)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页条数 """, dest='pageSize', type=int, required=False)), - (['--sort-field'], dict(help="""(string) 排序字段,默认传avgbandwidth """, dest='sortField', required=False)), - (['--sort-rule'], dict(help="""(string) 排序规则,默认是降序排序,传值asc或者desc """, dest='sortRule', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 攻击记录查询 ''', + help=''' 查询回源改写配置 ''', description=''' - 攻击记录查询。 + 查询回源改写配置。 - 示例: jdc cdn search-attack-log + 示例: jdc cdn query-back-source-rule --domain xxx ''', ) - def search_attack_log(self): + def query_back_source_rule(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SearchAttackLogRequest import SearchAttackLogRequest + from jdcloud_sdk.services.cdn.apis.QueryBackSourceRuleRequest import QueryBackSourceRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SearchAttackLogRequest(params_dict, headers) + req = QueryBackSourceRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2940,28 +5099,32 @@ def search_attack_log(self): @expose( arguments=[ + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--before-regex'], dict(help="""(string) url改写之前的正则表达式 """, dest='beforeRegex', required=False)), + (['--after-regex'], dict(help="""(string) url改写之后的正则表达式 """, dest='afterRegex', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取所有上层节点的ip ''', + help=''' URL改写配置 ''', description=''' - 获取所有上层节点的ip。 + URL改写配置。 - 示例: jdc cdn get-all-upper-node-ip-list + 示例: jdc cdn config-url-rule --domain xxx ''', ) - def get_all_upper_node_ip_list(self): + def config_url_rule(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.GetAllUpperNodeIpListRequest import GetAllUpperNodeIpListRequest + from jdcloud_sdk.services.cdn.apis.ConfigUrlRuleRequest import ConfigUrlRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetAllUpperNodeIpListRequest(params_dict, headers) + req = ConfigUrlRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2971,31 +5134,30 @@ def get_all_upper_node_ip_list(self): @expose( arguments=[ - (['--page-number'], dict(help="""(int) 第几页,从1开始计数 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数目 """, dest='pageSize', type=int, required=False)), - (['--domain'], dict(help="""(string) 域名,支持按照域名检索证书 """, dest='domain', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看证书列表 ''', + help=''' 查询Url改写配置 ''', description=''' - 查看证书列表。 + 查询Url改写配置。 - 示例: jdc cdn get-ssl-cert-list + 示例: jdc cdn query-url-rule --domain xxx ''', ) - def get_ssl_cert_list(self): + def query_url_rule(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.GetSslCertListRequest import GetSslCertListRequest + from jdcloud_sdk.services.cdn.apis.QueryUrlRuleRequest import QueryUrlRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetSslCertListRequest(params_dict, headers) + req = QueryUrlRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3005,29 +5167,31 @@ def get_ssl_cert_list(self): @expose( arguments=[ - (['--ssl-cert-id'], dict(help="""(string) 证书 Id """, dest='sslCertId', required=True)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--status'], dict(help="""(string) HTTP2功能开关,取值on/off """, dest='status', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看证书详情 ''', + help=''' http2配置,中国境外/全球加速域名暂不支持该配置 ''', description=''' - 查看证书详情。 + http2配置,中国境外/全球加速域名暂不支持该配置。 - 示例: jdc cdn get-ssl-cert-detail --ssl-cert-id xxx + 示例: jdc cdn config-http2 --domain xxx ''', ) - def get_ssl_cert_detail(self): + def config_http2(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.GetSslCertDetailRequest import GetSslCertDetailRequest + from jdcloud_sdk.services.cdn.apis.ConfigHttp2Request import ConfigHttp2Request params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetSslCertDetailRequest(params_dict, headers) + req = ConfigHttp2Request(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3037,32 +5201,30 @@ def get_ssl_cert_detail(self): @expose( arguments=[ - (['--cert-name'], dict(help="""(string) 证书名称 """, dest='certName', required=True)), - (['--key-file'], dict(help="""(string) 私钥 """, dest='keyFile', required=True)), - (['--cert-file'], dict(help="""(string) 证书 """, dest='certFile', required=True)), - (['--alias-name'], dict(help="""(string) 证书别名 """, dest='aliasName', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 上传证书 ''', + help=''' 查询http2配置 ''', description=''' - 上传证书。 + 查询http2配置。 - 示例: jdc cdn upload-cert --cert-name xxx --key-file xxx --cert-file xxx + 示例: jdc cdn query-http2 --domain xxx ''', ) - def upload_cert(self): + def query_http2(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.UploadCertRequest import UploadCertRequest + from jdcloud_sdk.services.cdn.apis.QueryHttp2Request import QueryHttp2Request params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UploadCertRequest(params_dict, headers) + req = QueryHttp2Request(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3072,36 +5234,31 @@ def upload_cert(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), - (['--area'], dict(help="""(string) NA """, dest='area', required=False)), - (['--isp'], dict(help="""(string) NA """, dest='isp', required=False)), - (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), - (['--scheme'], dict(help="""(string) 查询协议,可选值:[http,https,all],传空默认返回全部协议汇总后的数据 """, dest='scheme', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--configs'], dict(help="""(array: array) NA """, dest='configs', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询统计数据 ''', + help=''' 多path回源配置 ''', description=''' - 查询统计数据。 + 多path回源配置。 - 示例: jdc cdn query-mix-statistics-data + 示例: jdc cdn config-back-source-path --domain xxx ''', ) - def query_mix_statistics_data(self): + def config_back_source_path(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryMixStatisticsDataRequest import QueryMixStatisticsDataRequest + from jdcloud_sdk.services.cdn.apis.ConfigBackSourcePathRequest import ConfigBackSourcePathRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryMixStatisticsDataRequest(params_dict, headers) + req = ConfigBackSourcePathRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3111,35 +5268,30 @@ def query_mix_statistics_data(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), - (['--area'], dict(help="""(string) NA """, dest='area', required=False)), - (['--isp'], dict(help="""(string) NA """, dest='isp', required=False)), - (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 分地区及运营商查询统计数据 ''', + help=''' 查询回源path ''', description=''' - 分地区及运营商查询统计数据。 + 查询回源path。 - 示例: jdc cdn query-mix-statistics-with-area-data + 示例: jdc cdn query-back-source-path --domain xxx ''', ) - def query_mix_statistics_with_area_data(self): + def query_back_source_path(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryMixStatisticsWithAreaDataRequest import QueryMixStatisticsWithAreaDataRequest + from jdcloud_sdk.services.cdn.apis.QueryBackSourcePathRequest import QueryBackSourcePathRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryMixStatisticsWithAreaDataRequest(params_dict, headers) + req = QueryBackSourcePathRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3149,36 +5301,31 @@ def query_mix_statistics_with_area_data(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), - (['--area'], dict(help="""(string) NA """, dest='area', required=False)), - (['--isp'], dict(help="""(string) NA """, dest='isp', required=False)), - (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), - (['--group-by'], dict(help="""(string) 分组依据,只能按域名分组 """, dest='groupBy', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--accelerate-region'], dict(help="""(string) 加速区域,取值[mainland,nonMainland,all] """, dest='accelerateRegion', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询统计数据并进行汇总加和 ''', + help=''' 设置加速区域 ''', description=''' - 查询统计数据并进行汇总加和。 + 设置加速区域。 - 示例: jdc cdn query-mix-traffic-group-sum + 示例: jdc cdn set-accelerate-region --domain xxx ''', ) - def query_mix_traffic_group_sum(self): + def set_accelerate_region(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryMixTrafficGroupSumRequest import QueryMixTrafficGroupSumRequest + from jdcloud_sdk.services.cdn.apis.SetAccelerateRegionRequest import SetAccelerateRegionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryMixTrafficGroupSumRequest(params_dict, headers) + req = SetAccelerateRegionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3188,37 +5335,32 @@ def query_mix_traffic_group_sum(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--sub-domain'], dict(help="""(string) 待查询的子域名 """, dest='subDomain', required=False)), - (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), - (['--area'], dict(help="""(string) NA """, dest='area', required=False)), - (['--isp'], dict(help="""(string) NA """, dest='isp', required=False)), - (['--origin'], dict(help="""(string) NA """, dest='origin', required=False)), - (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--status'], dict(help="""(string) on/off,若为off则数组需为空,若为on则数组不可为空 """, dest='status', required=False)), + (['--rules'], dict(help="""(array: array) NA """, dest='rules', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询统计数据 ''', + help=''' 回源改写批量配置 ''', description=''' - 查询统计数据。 + 回源改写批量配置。 - 示例: jdc cdn query-statistics-data + 示例: jdc cdn config-back-source-rules --domain xxx ''', ) - def query_statistics_data(self): + def config_back_source_rules(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryStatisticsDataRequest import QueryStatisticsDataRequest + from jdcloud_sdk.services.cdn.apis.ConfigBackSourceRulesRequest import ConfigBackSourceRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryStatisticsDataRequest(params_dict, headers) + req = ConfigBackSourceRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3228,39 +5370,30 @@ def query_statistics_data(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--sub-domain'], dict(help="""(string) 待查询的子域名 """, dest='subDomain', required=False)), - (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), - (['--area'], dict(help="""(string) NA """, dest='area', required=False)), - (['--isp'], dict(help="""(string) NA """, dest='isp', required=False)), - (['--origin'], dict(help="""(string) NA """, dest='origin', required=False)), - (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), - (['--group-by'], dict(help="""(string) 分组依据 """, dest='groupBy', required=False)), - (['--scheme'], dict(help="""(string) 查询协议,可选值:[http,https,all],传空默认返回全部协议汇总后的数据 """, dest='scheme', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 分地区及运营商查询统计数据 ''', + help=''' 查询回源改写批量配置 ''', description=''' - 分地区及运营商查询统计数据。 + 查询回源改写批量配置。 - 示例: jdc cdn query-statistics-data-group-by-area + 示例: jdc cdn query-back-source-rules --domain xxx ''', ) - def query_statistics_data_group_by_area(self): + def query_back_source_rules(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryStatisticsDataGroupByAreaRequest import QueryStatisticsDataGroupByAreaRequest + from jdcloud_sdk.services.cdn.apis.QueryBackSourceRulesRequest import QueryBackSourceRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryStatisticsDataGroupByAreaRequest(params_dict, headers) + req = QueryBackSourceRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3270,38 +5403,36 @@ def query_statistics_data_group_by_area(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--sub-domain'], dict(help="""(string) 待查询的子域名 """, dest='subDomain', required=False)), - (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), - (['--area'], dict(help="""(string) NA """, dest='area', required=False)), - (['--isp'], dict(help="""(string) NA """, dest='isp', required=False)), - (['--origin'], dict(help="""(string) NA """, dest='origin', required=False)), - (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), - (['--group-by'], dict(help="""(string) 分组依据 """, dest='groupBy', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--status'], dict(help="""(string) on/off,若为on则以下必传参数不可为空[accessKey,secretKey,bucket,domain2],若为off则以下参数均不能有值[accessKey,secretKey,bucket,suffix,domain2] """, dest='status', required=False)), + (['--access-key'], dict(help="""(string) status 为on时必填 """, dest='accessKey', required=False)), + (['--secret-key'], dict(help="""(string) status 为on时必填 """, dest='secretKey', required=False)), + (['--bucket'], dict(help="""(string) oss桶名,status 为on时必填 """, dest='bucket', required=False)), + (['--suffix'], dict(help="""(string) oss后缀,status 为on时选填 """, dest='suffix', required=False)), + (['--domain2'], dict(help="""(string) status 为on时必填 """, dest='domain2', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询统计数据并进行汇总加和 ''', + help=''' 设置回源OSS鉴权 ''', description=''' - 查询统计数据并进行汇总加和。 + 设置回源OSS鉴权。 - 示例: jdc cdn query-statistics-data-group-sum + 示例: jdc cdn config-back-source-oss --domain xxx ''', ) - def query_statistics_data_group_sum(self): + def config_back_source_oss(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryStatisticsDataGroupSumRequest import QueryStatisticsDataGroupSumRequest + from jdcloud_sdk.services.cdn.apis.ConfigBackSourceOssRequest import ConfigBackSourceOssRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryStatisticsDataGroupSumRequest(params_dict, headers) + req = ConfigBackSourceOssRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3311,40 +5442,30 @@ def query_statistics_data_group_sum(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--app-name'], dict(help="""(string) app名 """, dest='appName', required=False)), - (['--stream-name'], dict(help="""(string) 流名 """, dest='streamName', required=False)), - (['--sub-domain'], dict(help="""(string) 子域名 """, dest='subDomain', required=False)), - (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), - (['--area'], dict(help="""(string) NA """, dest='area', required=False)), - (['--isp'], dict(help="""(string) NA """, dest='isp', required=False)), - (['--req-method'], dict(help="""(string) NA """, dest='reqMethod', required=False)), - (['--scheme'], dict(help="""(string) 查询的流协议类型 """, dest='scheme', required=False)), - (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询统计数据 ''', + help=''' 查询回源OSS鉴权配置 ''', description=''' - 查询统计数据。 + 查询回源OSS鉴权配置。 - 示例: jdc cdn query-live-statistics-data + 示例: jdc cdn query-back-source-oss --domain xxx ''', ) - def query_live_statistics_data(self): + def query_back_source_oss(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryLiveStatisticsDataRequest import QueryLiveStatisticsDataRequest + from jdcloud_sdk.services.cdn.apis.QueryBackSourceOssRequest import QueryBackSourceOssRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryLiveStatisticsDataRequest(params_dict, headers) + req = QueryBackSourceOssRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3354,41 +5475,31 @@ def query_live_statistics_data(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--app-name'], dict(help="""(string) app名 """, dest='appName', required=False)), - (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), - (['--area'], dict(help="""(string) NA """, dest='area', required=False)), - (['--isp'], dict(help="""(string) NA """, dest='isp', required=False)), - (['--stream-name'], dict(help="""(string) NA """, dest='streamName', required=False)), - (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), - (['--group-by'], dict(help="""(string) 分组依据 """, dest='groupBy', required=False)), - (['--sub-domain'], dict(help="""(string) NA """, dest='subDomain', required=False)), - (['--scheme'], dict(help="""(string) 查询的流协议 """, dest='scheme', required=False)), - (['--req-method'], dict(help="""(string) NA """, dest='reqMethod', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--limit-rate'], dict(help="""(int) 限速值,单位为KB/s,取值范围[1,20480] """, dest='limitRate', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 分地区及运营商查询统计数据 ''', + help=''' 域名限速 ''', description=''' - 分地区及运营商查询统计数据。 + 域名限速。 - 示例: jdc cdn query-live-statistics-area-data-group-by + 示例: jdc cdn speed-limit --domain xxx ''', ) - def query_live_statistics_area_data_group_by(self): + def speed_limit(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryLiveStatisticsAreaDataGroupByRequest import QueryLiveStatisticsAreaDataGroupByRequest + from jdcloud_sdk.services.cdn.apis.SpeedLimitRequest import SpeedLimitRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryLiveStatisticsAreaDataGroupByRequest(params_dict, headers) + req = SpeedLimitRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3401,38 +5512,32 @@ def query_live_statistics_area_data_group_by(self): (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--sub-domain'], dict(help="""(string) NA """, dest='subDomain', required=False)), - (['--app-name'], dict(help="""(string) app名 """, dest='appName', required=False)), - (['--stream-name'], dict(help="""(string) 流名 """, dest='streamName', required=False)), - (['--fields'], dict(help="""(string) 需要查询的字段 """, dest='fields', required=False)), - (['--area'], dict(help="""(string) NA """, dest='area', required=False)), - (['--isp'], dict(help="""(string) NA """, dest='isp', required=False)), - (['--scheme'], dict(help="""(string) 查询的流协议 """, dest='scheme', required=False)), - (['--period'], dict(help="""(string) 时间粒度,可选值:[oneMin,fiveMin,followTime],followTime只会返回一个汇总后的数据 """, dest='period', required=False)), - (['--group-by'], dict(help="""(string) 分组依据 """, dest='groupBy', required=False)), - (['--req-method'], dict(help="""(string) NA """, dest='reqMethod', required=False)), + (['--area'], dict(help="""(string) 地域 """, dest='area', required=False)), + (['--isp'], dict(help="""(string) 运营商 """, dest='isp', required=False)), + (['--period'], dict(help="""(string) 查询周期 """, dest='period', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询统计数据并进行汇总加和 ''', + help=''' 带宽查询接口 ''', description=''' - 查询统计数据并进行汇总加和。 + 带宽查询接口。 - 示例: jdc cdn query-live-traffic-group-sum + 示例: jdc cdn query-band ''', ) - def query_live_traffic_group_sum(self): + def query_band(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryLiveTrafficGroupSumRequest import QueryLiveTrafficGroupSumRequest + from jdcloud_sdk.services.cdn.apis.QueryBandRequest import QueryBandRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryLiveTrafficGroupSumRequest(params_dict, headers) + req = QueryBandRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3445,31 +5550,32 @@ def query_live_traffic_group_sum(self): (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--sub-domain'], dict(help="""(string) 待查询的子域名 """, dest='subDomain', required=False)), - (['--size'], dict(help="""(int) NA """, dest='size', type=int, required=False)), - (['--top-by'], dict(help="""(string) 排序依据 """, dest='topBy', required=False)), + (['--area'], dict(help="""(string) 地域 """, dest='area', required=False)), + (['--isp'], dict(help="""(string) 运营商 """, dest='isp', required=False)), + (['--period'], dict(help="""(string) 查询周期 """, dest='period', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询TOP IP ''', + help=''' 分地域运营商带宽查询接口 ''', description=''' - 查询TOP IP。 + 分地域运营商带宽查询接口。 - 示例: jdc cdn query-statistics-top-ip + 示例: jdc cdn query-band-with-area ''', ) - def query_statistics_top_ip(self): + def query_band_with_area(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryStatisticsTopIpRequest import QueryStatisticsTopIpRequest + from jdcloud_sdk.services.cdn.apis.QueryBandWithAreaRequest import QueryBandWithAreaRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryStatisticsTopIpRequest(params_dict, headers) + req = QueryBandWithAreaRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3479,34 +5585,29 @@ def query_statistics_top_ip(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--sub-domain'], dict(help="""(string) 待查询的子域名 """, dest='subDomain', required=False)), - (['--size'], dict(help="""(int) NA """, dest='size', type=int, required=False)), - (['--top-by'], dict(help="""(string) 排序依据 """, dest='topBy', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询TOP Url ''', + help=''' 查询用户刷新预热封禁限额 ''', description=''' - 查询TOP Url。 + 查询用户刷新预热封禁限额。 - 示例: jdc cdn query-statistics-top-url + 示例: jdc cdn query-cdn-user-quota ''', ) - def query_statistics_top_url(self): + def query_cdn_user_quota(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryStatisticsTopUrlRequest import QueryStatisticsTopUrlRequest + from jdcloud_sdk.services.cdn.apis.QueryCdnUserQuotaRequest import QueryCdnUserQuotaRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryStatisticsTopUrlRequest(params_dict, headers) + req = QueryCdnUserQuotaRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3516,33 +5617,31 @@ def query_statistics_top_url(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名,该接口仅支持单域名查询 """, dest='domain', required=False)), - (['--dirs'], dict(help="""(string) 需要过滤的目录 """, dest='dirs', required=False)), - (['--regions'], dict(help="""(string) 需要过滤的地区 """, dest='regions', required=False)), + (['--task-ids'], dict(help="""(array) 查询的任务taskIds列表,最多能查10条 """, dest='taskIds', required=False)), + (['--keyword'], dict(help="""(string) url的模糊查询关键字 """, dest='keyword', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询目录带宽,仅有部分用户支持该功能 ''', + help=''' 根据taskIds查询刷新预热任务 ''', description=''' - 查询目录带宽,仅有部分用户支持该功能。 + 根据taskIds查询刷新预热任务。 - 示例: jdc cdn query-dir-bandwidth + 示例: jdc cdn query-refresh-task-by-ids ''', ) - def query_dir_bandwidth(self): + def query_refresh_task_by_ids(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryDirBandwidthRequest import QueryDirBandwidthRequest + from jdcloud_sdk.services.cdn.apis.QueryRefreshTaskByIdsRequest import QueryRefreshTaskByIdsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDirBandwidthRequest(params_dict, headers) + req = QueryRefreshTaskByIdsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3552,29 +5651,33 @@ def query_dir_bandwidth(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--sub-users'], dict(help="""(array) 子账号,只有传值才会设置子账号,其余不传或传空是设置主账号 """, dest='subUsers', required=False)), + (['--refresh-count'], dict(help="""(int) 刷新个数,如果是首次设置,不传默认是2000;已经设置,再次设置是更新,不传表示不进行更新 """, dest='refreshCount', type=int, required=False)), + (['--prefetch-count'], dict(help="""(int) 刷新个数,如果是首次设置,不传默认是2000;已经设置,再次设置是更新,不传表示不进行更新 """, dest='prefetchCount', type=int, required=False)), + (['--dir-count'], dict(help="""(int) 刷新个数,如果是首次设置,不传默认是50;已经设置,再次设置是更新,不传表示不进行更新 """, dest='dirCount', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询WAF总开关 ''', + help=''' 设置用户刷新预热限额 ''', description=''' - 查询WAF总开关。 + 设置用户刷新预热限额。 - 示例: jdc cdn query-waf-switch --domain xxx + 示例: jdc cdn set-refresh-limit ''', ) - def query_waf_switch(self): + def set_refresh_limit(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryWafSwitchRequest import QueryWafSwitchRequest + from jdcloud_sdk.services.cdn.apis.SetRefreshLimitRequest import SetRefreshLimitRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryWafSwitchRequest(params_dict, headers) + req = SetRefreshLimitRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3584,30 +5687,32 @@ def query_waf_switch(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--switch-status'], dict(help="""(string) 开关状态, on:开启,off:关闭 """, dest='switchStatus', required=False)), + (['--sub-users'], dict(help="""(array) 子账号,传哪些子账号就查哪些的,不传或传空默认返回所有子账号的额度 """, dest='subUsers', required=False)), + (['--page-number'], dict(help="""(int) 默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 默认为10,最大100 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置WAF总开关 ''', + help=''' 查询用户刷新预热限额 ''', description=''' - 设置WAF总开关。 + 查询用户刷新预热限额。 - 示例: jdc cdn set-waf-switch --domain xxx + 示例: jdc cdn query-refresh-limit ''', ) - def set_waf_switch(self): + def query_refresh_limit(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetWafSwitchRequest import SetWafSwitchRequest + from jdcloud_sdk.services.cdn.apis.QueryRefreshLimitRequest import QueryRefreshLimitRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetWafSwitchRequest(params_dict, headers) + req = QueryRefreshLimitRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3617,29 +5722,30 @@ def set_waf_switch(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--task-id'], dict(help="""(string) 域名组id """, dest='taskId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询WAF总开关 ''', + help=''' 根据taskId查询刷新预热任务 ''', description=''' - 查询WAF总开关。 + 根据taskId查询刷新预热任务。 - 示例: jdc cdn query-waf-white-rule-switch --domain xxx + 示例: jdc cdn query-refresh-task-by-id --task-id xxx ''', ) - def query_waf_white_rule_switch(self): + def query_refresh_task_by_id(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryWafWhiteRuleSwitchRequest import QueryWafWhiteRuleSwitchRequest + from jdcloud_sdk.services.cdn.apis.QueryRefreshTaskByIdRequest import QueryRefreshTaskByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryWafWhiteRuleSwitchRequest(params_dict, headers) + req = QueryRefreshTaskByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3649,30 +5755,31 @@ def query_waf_white_rule_switch(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--switch-status'], dict(help="""(string) 开关状态, on:开启,off:关闭 """, dest='switchStatus', required=False)), + (['--task-type'], dict(help="""(string) 刷新预热类型,(url:url刷新,dir:目录刷新,prefetch:预热) """, dest='taskType', required=False)), + (['--url-items'], dict(help="""(array: array) NA """, dest='urlItems', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置WAF白名单开关 ''', + help=''' 创建刷新预热回调任务 ''', description=''' - 设置WAF白名单开关。 + 创建刷新预热回调任务。 - 示例: jdc cdn set-waf-white-rule-switch --domain xxx + 示例: jdc cdn create-refresh-task-for-callback ''', ) - def set_waf_white_rule_switch(self): + def create_refresh_task_for_callback(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetWafWhiteRuleSwitchRequest import SetWafWhiteRuleSwitchRequest + from jdcloud_sdk.services.cdn.apis.CreateRefreshTaskForCallbackRequest import CreateRefreshTaskForCallbackRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetWafWhiteRuleSwitchRequest(params_dict, headers) + req = CreateRefreshTaskForCallbackRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3682,33 +5789,31 @@ def set_waf_white_rule_switch(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--rule-type'], dict(help="""(string) ruleType, valid values [ip, geo, uri] """, dest='ruleType', required=True)), - (['--id'], dict(help="""(string) ruleId, defalut empty """, dest='id', required=False)), - (['--page-size'], dict(help="""(int) page size , default 0 to query all """, dest='pageSize', type=int, required=False)), - (['--page-index'], dict(help="""(int) page index , default 0 to query all """, dest='pageIndex', type=int, required=False)), + (['--task-type'], dict(help="""(string) 刷新预热类型,(url:url刷新,dir:目录刷新,prefetch:预热) """, dest='taskType', required=False)), + (['--url-items'], dict(help="""(array: array) NA """, dest='urlItems', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询WAF白名单规则列表 ''', + help=''' 创建刷新预热回调任务 ''', description=''' - 查询WAF白名单规则列表。 + 创建刷新预热回调任务。 - 示例: jdc cdn querywaf-white-rules --domain xxx --rule-type xxx + 示例: jdc cdn create-refresh-task-for-callback-v2 ''', ) - def querywaf_white_rules(self): + def create_refresh_task_for_callback_v2(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QuerywafWhiteRulesRequest import QuerywafWhiteRulesRequest + from jdcloud_sdk.services.cdn.apis.CreateRefreshTaskForCallbackV2Request import CreateRefreshTaskForCallbackV2Request params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QuerywafWhiteRulesRequest(params_dict, headers) + req = CreateRefreshTaskForCallbackV2Request(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3718,33 +5823,39 @@ def querywaf_white_rules(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--rule-type'], dict(help="""(string) 白名单类型, uri ip geo """, dest='ruleType', required=False)), - (['--match-op'], dict(help="""(int) 匹配模式,uri类型有效,0=完全匹配 1=前缀匹配 2=包含 3=正则 4=大于 5=后缀 """, dest='matchOp', type=int, required=False)), - (['--val'], dict(help="""(string) 匹配值 """, dest='val', required=False)), - (['--actions'], dict(help="""(array) 后续处理 "waf" "cc" "deny"自由组合,空表示跳过后续所有阶段 """, dest='actions', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--keyword'], dict(help="""(string) url或者目录的模糊查询关键字 """, dest='keyword', required=False)), + (['--task-id'], dict(help="""(string) 任务id """, dest='taskId', required=False)), + (['--task-status'], dict(help="""(string) null """, dest='taskStatus', required=False)), + (['--task-type'], dict(help="""(string) null """, dest='taskType', required=False)), + (['--page-number'], dict(help="""(int) 分页页数,默认值1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页页面大小,默认值50 """, dest='pageSize', type=int, required=False)), + (['--account-type'], dict(help="""(string) 查询的账号范围 """, dest='accountType', required=False)), + (['--sub-users'], dict(help="""(string) 查询的子账号,多个用逗号隔开 """, dest='subUsers', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 新增一条白名单规则 ''', + help=''' 查询刷新预热任务 ''', description=''' - 新增一条白名单规则。 + 查询刷新预热任务。 - 示例: jdc cdn create-waf-white-rule --domain xxx + 示例: jdc cdn query-refresh-task ''', ) - def create_waf_white_rule(self): + def query_refresh_task(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.CreateWafWhiteRuleRequest import CreateWafWhiteRuleRequest + from jdcloud_sdk.services.cdn.apis.QueryRefreshTaskRequest import QueryRefreshTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateWafWhiteRuleRequest(params_dict, headers) + req = QueryRefreshTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3754,34 +5865,31 @@ def create_waf_white_rule(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--id'], dict(help="""(string) 需要修改的白名单ID """, dest='id', required=True)), - (['--rule-type'], dict(help="""(string) 白名单类型, uri ip geo """, dest='ruleType', required=False)), - (['--match-op'], dict(help="""(int) 匹配模式,uri类型有效,0=完全匹配 1=前缀匹配 2=包含 3=正则 4=大于 5=后缀 """, dest='matchOp', type=int, required=False)), - (['--val'], dict(help="""(string) 匹配值 """, dest='val', required=False)), - (['--actions'], dict(help="""(array) 后续处理 "waf" "cc" "deny"自由组合,空表示跳过后续所有阶段 """, dest='actions', required=False)), + (['--task-type'], dict(help="""(string) 刷新预热类型,(url:url刷新,dir:目录刷新,prefetch:预热),中国境外/全球加速域名暂不支持预热功能 """, dest='taskType', required=False)), + (['--urls'], dict(help="""(array) NA """, dest='urls', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改指定的白名单规则 ''', + help=''' 创建刷新预热任务, ''', description=''' - 修改指定的白名单规则。 + 创建刷新预热任务,。 - 示例: jdc cdn update-waf-white-rule --domain xxx --id xxx + 示例: jdc cdn create-refresh-task ''', ) - def update_waf_white_rule(self): + def create_refresh_task(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.UpdateWafWhiteRuleRequest import UpdateWafWhiteRuleRequest + from jdcloud_sdk.services.cdn.apis.CreateRefreshTaskRequest import CreateRefreshTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateWafWhiteRuleRequest(params_dict, headers) + req = CreateRefreshTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3791,31 +5899,32 @@ def update_waf_white_rule(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--ids'], dict(help="""(array) NA """, dest='ids', required=False)), - (['--rule-type'], dict(help="""(string) NA """, dest='ruleType', required=False)), + (['--page-number'], dict(help="""(int) 第几页,从1开始计数 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数目 """, dest='pageSize', type=int, required=False)), + (['--domain'], dict(help="""(string) 域名,支持按照域名检索证书 """, dest='domain', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启用WAF白名单 ''', + help=''' 查看证书列表 ''', description=''' - 启用WAF白名单。 + 查看证书列表。 - 示例: jdc cdn enable-waf-white-rules --domain xxx + 示例: jdc cdn get-ssl-cert-list ''', ) - def enable_waf_white_rules(self): + def get_ssl_cert_list(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.EnableWafWhiteRulesRequest import EnableWafWhiteRulesRequest + from jdcloud_sdk.services.cdn.apis.GetSslCertListRequest import GetSslCertListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableWafWhiteRulesRequest(params_dict, headers) + req = GetSslCertListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3825,31 +5934,30 @@ def enable_waf_white_rules(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--ids'], dict(help="""(array) NA """, dest='ids', required=False)), - (['--rule-type'], dict(help="""(string) NA """, dest='ruleType', required=False)), + (['--ssl-cert-id'], dict(help="""(string) 证书 Id """, dest='sslCertId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 禁用WAF白名单 ''', + help=''' 查看证书详情 ''', description=''' - 禁用WAF白名单。 + 查看证书详情。 - 示例: jdc cdn disable-waf-white-rules --domain xxx + 示例: jdc cdn get-ssl-cert-detail --ssl-cert-id xxx ''', ) - def disable_waf_white_rules(self): + def get_ssl_cert_detail(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.DisableWafWhiteRulesRequest import DisableWafWhiteRulesRequest + from jdcloud_sdk.services.cdn.apis.GetSslCertDetailRequest import GetSslCertDetailRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisableWafWhiteRulesRequest(params_dict, headers) + req = GetSslCertDetailRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3859,31 +5967,33 @@ def disable_waf_white_rules(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--ids'], dict(help="""(string) NA """, dest='ids', required=True)), - (['--rule-type'], dict(help="""(string) NA """, dest='ruleType', required=True)), + (['--cert-name'], dict(help="""(string) 证书名称 """, dest='certName', required=True)), + (['--key-file'], dict(help="""(string) 私钥 """, dest='keyFile', required=True)), + (['--cert-file'], dict(help="""(string) 证书 """, dest='certFile', required=True)), + (['--alias-name'], dict(help="""(string) 证书别名 """, dest='aliasName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除WAF白名单 ''', + help=''' 上传证书 ''', description=''' - 删除WAF白名单。 + 上传证书。 - 示例: jdc cdn delete-waf-white-rules --domain xxx --ids xxx --rule-type xxx + 示例: jdc cdn upload-cert --cert-name xxx --key-file xxx --cert-file xxx ''', ) - def delete_waf_white_rules(self): + def upload_cert(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.DeleteWafWhiteRulesRequest import DeleteWafWhiteRulesRequest + from jdcloud_sdk.services.cdn.apis.UploadCertRequest import UploadCertRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteWafWhiteRulesRequest(params_dict, headers) + req = UploadCertRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3893,29 +6003,34 @@ def delete_waf_white_rules(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--starttime'], dict(help="""(string) 指定查询开始时间(格式:201906011000),返回数据包含该时间点。 """, dest='starttime', required=True)), + (['--stoptime'], dict(help="""(string) 指定查询结束时间(格式:201906011100),返回数据不包含该时间点 """, dest='stoptime', required=True)), + (['--clientid'], dict(help="""(string) 按照设备ID查询设备带宽。 """, dest='clientid', required=False)), + (['--page'], dict(help="""(int) 用于支持分页查询,默认为1,表示第几页。 """, dest='page', type=int, required=False)), + (['--size'], dict(help="""(int) 用于支持分页查询,表示每页返回多少条数据,默认每页返回10条数据,size必须是10的整数倍,并且最大值是100。 """, dest='size', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询WAF黑名单开关 ''', + help=''' 查询平均带宽 ''', description=''' - 查询WAF黑名单开关。 + 查询平均带宽。 - 示例: jdc cdn query-waf-black-rule-switch --domain xxx + 示例: jdc cdn query-avg-bandwidth-for-pcdn --starttime xxx --stoptime xxx ''', ) - def query_waf_black_rule_switch(self): + def query_avg_bandwidth_for_pcdn(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryWafBlackRuleSwitchRequest import QueryWafBlackRuleSwitchRequest + from jdcloud_sdk.services.cdn.apis.QueryAvgBandwidthForPCdnRequest import QueryAvgBandwidthForPCdnRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryWafBlackRuleSwitchRequest(params_dict, headers) + req = QueryAvgBandwidthForPCdnRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3925,30 +6040,30 @@ def query_waf_black_rule_switch(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--switch-status'], dict(help="""(string) 开关状态, on:开启,off:关闭 """, dest='switchStatus', required=False)), + (['--mac-addr'], dict(help="""(string) 查询dev的mac地址(如DCD87C047117) """, dest='macAddr', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置WAF黑名单开关 ''', + help=''' 查询设备状态 ''', description=''' - 设置WAF黑名单开关。 + 查询设备状态。 - 示例: jdc cdn set-waf-black-rule-switch --domain xxx + 示例: jdc cdn query-device-status-for-pcdn --mac-addr xxx ''', ) - def set_waf_black_rule_switch(self): + def query_device_status_for_pcdn(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetWafBlackRuleSwitchRequest import SetWafBlackRuleSwitchRequest + from jdcloud_sdk.services.cdn.apis.QueryDeviceStatusForPCdnRequest import QueryDeviceStatusForPCdnRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetWafBlackRuleSwitchRequest(params_dict, headers) + req = QueryDeviceStatusForPCdnRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3958,33 +6073,38 @@ def set_waf_black_rule_switch(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--rule-type'], dict(help="""(string) ruleType, valid values [ip, geo, uri] """, dest='ruleType', required=True)), - (['--id'], dict(help="""(string) ruleId, defalut empty """, dest='id', required=False)), - (['--page-size'], dict(help="""(int) page size , default 0 to query all """, dest='pageSize', type=int, required=False)), - (['--page-index'], dict(help="""(int) page index , default 0 to query all """, dest='pageIndex', type=int, required=False)), + (['--start-time'], dict(help="""(int) 查询起始时间,时间戳 """, dest='startTime', type=int, required=False)), + (['--end-time'], dict(help="""(int) 查询截止时间,时间戳 """, dest='endTime', type=int, required=False)), + (['--fields'], dict(help="""(string) 查询的字段,取值范围(avgbandwidth,pv,flow)。多个用逗号分隔。默认为空,表示查询带宽流量 """, dest='fields', required=False)), + (['--area'], dict(help="""(string) NA """, dest='area', required=False)), + (['--isp'], dict(help="""(string) NA """, dest='isp', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin”,分别表示1min,5min。默认为空,表示fiveMin """, dest='period', required=False)), + (['--category'], dict(help="""(string) 业务类型 """, dest='category', required=False)), + (['--mac-addr'], dict(help="""(string) 设备id """, dest='macAddr', required=False)), + (['--plugin-pin'], dict(help="""(string) 插件pin """, dest='pluginPin', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询WAF黑名单规则列表 ''', + help=''' 无线宝按条件查询的统计接口 ''', description=''' - 查询WAF黑名单规则列表。 + 无线宝按条件查询的统计接口。 - 示例: jdc cdn querywaf-black-rules --domain xxx --rule-type xxx + 示例: jdc cdn query-jdbox-statistics-data ''', ) - def querywaf_black_rules(self): + def query_jdbox_statistics_data(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QuerywafBlackRulesRequest import QuerywafBlackRulesRequest + from jdcloud_sdk.services.cdn.apis.QueryJDBoxStatisticsDataRequest import QueryJDBoxStatisticsDataRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QuerywafBlackRulesRequest(params_dict, headers) + req = QueryJDBoxStatisticsDataRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3994,34 +6114,39 @@ def querywaf_black_rules(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--rule-type'], dict(help="""(string) 黑名单类型, uri ip geo """, dest='ruleType', required=False)), - (['--match-op'], dict(help="""(int) 匹配模式,uri类型有效,0=完全匹配 1=前缀匹配 2=包含 3=正则 4=大于 5=后缀 """, dest='matchOp', type=int, required=False)), - (['--val'], dict(help="""(string) 匹配值 """, dest='val', required=False)), - (['--at-op'], dict(help="""(int) 1:forbidden,493封禁并返回自定义页面 2:redirect,302跳转 3: verify@captcha 4: verify@jscookie """, dest='atOp', type=int, required=False)), - (['--at-val'], dict(help="""(string) action为1时为自定义页面名称,空值或缺省值default为默认页面,2时为跳转url,其他时无效 """, dest='atVal', required=False)), + (['--start-time'], dict(help="""(int) 查询起始时间,时间戳 """, dest='startTime', type=int, required=False)), + (['--end-time'], dict(help="""(int) 查询截止时间,时间戳 """, dest='endTime', type=int, required=False)), + (['--group-by'], dict(help="""(string) 取值范围:area,isp,pin ,mac_addr,category,多个用,隔开,多个维度的查询,必须要限制较短的时间间隔 """, dest='groupBy', required=False)), + (['--fields'], dict(help="""(string) 查询的字段,取值范围(avgbandwidth,pv,flow)。多个用逗号分隔。默认为空,表示查询带宽流量 """, dest='fields', required=False)), + (['--area'], dict(help="""(string) 区域 """, dest='area', required=False)), + (['--isp'], dict(help="""(string) 运营商 """, dest='isp', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin”,分别表示1min,5min。默认为空,表示fiveMin """, dest='period', required=False)), + (['--category'], dict(help="""(string) 业务类型 """, dest='category', required=False)), + (['--mac-addr'], dict(help="""(string) 设备id """, dest='macAddr', required=False)), + (['--plugin-pin'], dict(help="""(string) 插件pin """, dest='pluginPin', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 新增一条黑名单规则 ''', + help=''' 无线宝按group查询的统计接口 ''', description=''' - 新增一条黑名单规则。 + 无线宝按group查询的统计接口。 - 示例: jdc cdn create-waf-black-rule --domain xxx + 示例: jdc cdn query-jdbox-statistics-data-with-group ''', ) - def create_waf_black_rule(self): + def query_jdbox_statistics_data_with_group(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.CreateWafBlackRuleRequest import CreateWafBlackRuleRequest + from jdcloud_sdk.services.cdn.apis.QueryJDBoxStatisticsDataWithGroupRequest import QueryJDBoxStatisticsDataWithGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateWafBlackRuleRequest(params_dict, headers) + req = QueryJDBoxStatisticsDataWithGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4031,35 +6156,35 @@ def create_waf_black_rule(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--id'], dict(help="""(string) 需要修改的黑名单ID """, dest='id', required=True)), - (['--rule-type'], dict(help="""(string) 黑名单类型, uri ip geo """, dest='ruleType', required=False)), - (['--match-op'], dict(help="""(int) 匹配模式,uri类型有效,0=完全匹配 1=前缀匹配 2=包含 3=正则 4=大于 5=后缀 """, dest='matchOp', type=int, required=False)), - (['--val'], dict(help="""(string) 匹配值 """, dest='val', required=False)), - (['--at-op'], dict(help="""(int) 1:forbidden,493封禁并返回自定义页面 2:redirect,302跳转 3: verify@captcha 4: verify@jscookie """, dest='atOp', type=int, required=False)), - (['--at-val'], dict(help="""(string) action为1时为自定义页面名称,空值或缺省值default为默认页面,2时为跳转url,其他时无效 """, dest='atVal', required=False)), + (['--starttime'], dict(help="""(string) 指定查询开始时间(格式:201906011000),返回数据包含该时间点。 """, dest='starttime', required=True)), + (['--stoptime'], dict(help="""(string) 指定查询结束时间(格式:201906011100),返回数据不包含该时间点 """, dest='stoptime', required=True)), + (['--plugin-pin'], dict(help="""(string) 插件pin,多个用,隔开 """, dest='pluginPin', required=True)), + (['--clientid'], dict(help="""(string) 按照设备ID查询设备带宽,即macaddr,多个用,隔开 """, dest='clientid', required=False)), + (['--page'], dict(help="""(int) 用于支持分页查询,默认为1,表示第几页。 """, dest='page', type=int, required=False)), + (['--size'], dict(help="""(int) 用于支持分页查询,表示每页返回多少条数据,默认每页返回10条数据,size必须是10的整数倍,并且最大值是100。 """, dest='size', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改指定的黑名单规则 ''', + help=''' 查询平均带宽 ''', description=''' - 修改指定的黑名单规则。 + 查询平均带宽。 - 示例: jdc cdn update-waf-black-rule --domain xxx --id xxx + 示例: jdc cdn query-jbox-avg-bandwidth --starttime xxx --stoptime xxx --plugin-pin xxx ''', ) - def update_waf_black_rule(self): + def query_jbox_avg_bandwidth(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.UpdateWafBlackRuleRequest import UpdateWafBlackRuleRequest + from jdcloud_sdk.services.cdn.apis.QueryJBoxAvgBandwidthRequest import QueryJBoxAvgBandwidthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateWafBlackRuleRequest(params_dict, headers) + req = QueryJBoxAvgBandwidthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4069,31 +6194,34 @@ def update_waf_black_rule(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--ids'], dict(help="""(array) NA """, dest='ids', required=False)), - (['--rule-type'], dict(help="""(string) NA """, dest='ruleType', required=False)), + (['--domains'], dict(help="""(array) NA """, dest='domains', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--interval'], dict(help="""(string) 时间间隔,取值(hour,day,fiveMin),不传默认小时。 """, dest='interval', required=False)), + (['--log-type'], dict(help="""(string) 日志类型,取值(log,zip,gz),不传默认gz。 """, dest='logType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启用WAF黑名单 ''', + help=''' 批量域名查询日志 ''', description=''' - 启用WAF黑名单。 + 批量域名查询日志。 - 示例: jdc cdn enable-waf-black-rules --domain xxx + 示例: jdc cdn query-domains-log ''', ) - def enable_waf_black_rules(self): + def query_domains_log(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.EnableWafBlackRulesRequest import EnableWafBlackRulesRequest + from jdcloud_sdk.services.cdn.apis.QueryDomainsLogRequest import QueryDomainsLogRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableWafBlackRulesRequest(params_dict, headers) + req = QueryDomainsLogRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4104,30 +6232,35 @@ def enable_waf_black_rules(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--ids'], dict(help="""(array) NA """, dest='ids', required=False)), - (['--rule-type'], dict(help="""(string) NA """, dest='ruleType', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--interval'], dict(help="""(string) 时间间隔,取值(hour,day,fiveMin),不传默认小时。 """, dest='interval', required=False)), + (['--log-type'], dict(help="""(string) 日志类型,取值(log,zip,gz),不传默认gz。 """, dest='logType', required=False)), + (['--page-size'], dict(help="""(int) 页面大小,默认值10 """, dest='pageSize', type=int, required=False)), + (['--page-number'], dict(help="""(int) 分页页数,默认值1 """, dest='pageNumber', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 禁用WAF黑名单 ''', + help=''' 查询日志 ''', description=''' - 禁用WAF黑名单。 + 查询日志。 - 示例: jdc cdn disable-waf-black-rules --domain xxx + 示例: jdc cdn query-domain-log --domain xxx ''', ) - def disable_waf_black_rules(self): + def query_domain_log(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.DisableWafBlackRulesRequest import DisableWafBlackRulesRequest + from jdcloud_sdk.services.cdn.apis.QueryDomainLogRequest import QueryDomainLogRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisableWafBlackRulesRequest(params_dict, headers) + req = QueryDomainLogRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4137,31 +6270,32 @@ def disable_waf_black_rules(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--ids'], dict(help="""(string) NA """, dest='ids', required=True)), - (['--rule-type'], dict(help="""(string) NA """, dest='ruleType', required=True)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除WAF黑名单 ''', + help=''' 查询攻击来源 ''', description=''' - 删除WAF黑名单。 + 查询攻击来源。 - 示例: jdc cdn delete-waf-black-rules --domain xxx --ids xxx --rule-type xxx + 示例: jdc cdn waf-query-pv-for-area-and-ip ''', ) - def delete_waf_black_rules(self): + def waf_query_pv_for_area_and_ip(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.DeleteWafBlackRulesRequest import DeleteWafBlackRulesRequest + from jdcloud_sdk.services.cdn.apis.WafQueryPvForAreaAndIpRequest import WafQueryPvForAreaAndIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteWafBlackRulesRequest(params_dict, headers) + req = WafQueryPvForAreaAndIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4171,29 +6305,32 @@ def delete_waf_black_rules(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询CC 防护开关 ''', + help=''' 查询总请求量与攻击请求量 ''', description=''' - 查询CC 防护开关。 + 查询总请求量与攻击请求量。 - 示例: jdc cdn query-ccprotect-switch --domain xxx + 示例: jdc cdn waf-query-pv ''', ) - def query_ccprotect_switch(self): + def waf_query_pv(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryCCProtectSwitchRequest import QueryCCProtectSwitchRequest + from jdcloud_sdk.services.cdn.apis.WafQueryPvRequest import WafQueryPvRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryCCProtectSwitchRequest(params_dict, headers) + req = WafQueryPvRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4203,30 +6340,36 @@ def query_ccprotect_switch(self): @expose( arguments=[ - (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--switch-status'], dict(help="""(string) 开关状态, on:开启,off:关闭 """, dest='switchStatus', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), + (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--sort-field'], dict(help="""(string) 排序字段 """, dest='sortField', required=False)), + (['--sort-rule'], dict(help="""(string) 排序规则:desc,asc """, dest='sortRule', required=False)), + (['--page-number'], dict(help="""(int) 页码,从1开始 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 页大小,默认20 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置CC 防护开关 ''', + help=''' 查询攻击记录详情 ''', description=''' - 设置CC 防护开关。 + 查询攻击记录详情。 - 示例: jdc cdn set-ccprotect-switch --domain xxx + 示例: jdc cdn waf-query-attack-details ''', ) - def set_ccprotect_switch(self): + def waf_query_attack_details(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetCCProtectSwitchRequest import SetCCProtectSwitchRequest + from jdcloud_sdk.services.cdn.apis.WafQueryAttackDetailsRequest import WafQueryAttackDetailsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetCCProtectSwitchRequest(params_dict, headers) + req = WafQueryAttackDetailsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4237,31 +6380,36 @@ def set_ccprotect_switch(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--id'], dict(help="""(string) ruleId, defalut empty """, dest='id', required=False)), - (['--page-size'], dict(help="""(int) page size , default 0 to query all """, dest='pageSize', type=int, required=False)), - (['--page-index'], dict(help="""(int) page index , default 0 to query all """, dest='pageIndex', type=int, required=False)), + (['--enable-url-auth'], dict(help="""(string) 是否开启鉴权[on,off] """, dest='enableUrlAuth', required=False)), + (['--auth-key'], dict(help="""(string) 鉴权key """, dest='authKey', required=False)), + (['--age'], dict(help="""(int) 鉴权时间戳过期时间,默认为0 """, dest='age', type=int, required=False)), + (['--enc-algorithm'], dict(help="""(string) 鉴权参数加密算法,默认为md5且只支持md5 """, dest='encAlgorithm', required=False)), + (['--time-format'], dict(help="""(string) 时间戳格式[hex,dec] """, dest='timeFormat', required=False)), + (['--uri-type'], dict(help="""(string) 加密算法版本[dash,dashv2,video],默认dashv2 """, dest='uriType', required=False)), + (['--rule'], dict(help="""(string) 鉴权key生成顺序 """, dest='rule', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询CC防护规则列表 ''', + help=''' dash鉴权设置 ''', description=''' - 查询CC防护规则列表。 + dash鉴权设置。 - 示例: jdc cdn query-ccprotect-rules --domain xxx + 示例: jdc cdn set-auth-config --domain xxx ''', ) - def query_ccprotect_rules(self): + def set_auth_config(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryCCProtectRulesRequest import QueryCCProtectRulesRequest + from jdcloud_sdk.services.cdn.apis.SetAuthConfigRequest import SetAuthConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryCCProtectRulesRequest(params_dict, headers) + req = SetAuthConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4272,33 +6420,34 @@ def query_ccprotect_rules(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--uri'], dict(help="""(string) null """, dest='uri', required=False)), - (['--detect-period'], dict(help="""(int) null """, dest='detectPeriod', type=int, required=False)), - (['--single-ip-limit'], dict(help="""(int) null """, dest='singleIpLimit', type=int, required=False)), - (['--block-type'], dict(help="""(int) null """, dest='blockType', type=int, required=False)), - (['--block-time'], dict(help="""(int) null """, dest='blockTime', type=int, required=False)), + (['--enable'], dict(help="""(string) 是否开启鉴权[on,off] """, dest='enable', required=False)), + (['--origin-role'], dict(help="""(string) 回源为主/备[master,slave] """, dest='originRole', required=False)), + (['--auth-type'], dict(help="""(string) 鉴权类型[oss,aws,tos],aws暂不支持 """, dest='authType', required=False)), + (['--tos-auth-info'], dict(help="""(tOSAuthInfo) tos类型鉴权参数,authType为tos是不能为空 """, dest='tosAuthInfo', required=False)), + (['--oss-auth-info'], dict(help="""(oSSAuthInfo) oss类型鉴权参数,authType为oss是不能为空 """, dest='ossAuthInfo', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 新增一条CC防护规则 ''', + help=''' 回源鉴权设置 ''', description=''' - 新增一条CC防护规则。 + 回源鉴权设置。 - 示例: jdc cdn create-ccprotect-rule --domain xxx + 示例: jdc cdn set-source-auth-config --domain xxx ''', ) - def create_ccprotect_rule(self): + def set_source_auth_config(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.CreateCCProtectRuleRequest import CreateCCProtectRuleRequest + from jdcloud_sdk.services.cdn.apis.SetSourceAuthConfigRequest import SetSourceAuthConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateCCProtectRuleRequest(params_dict, headers) + req = SetSourceAuthConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4309,34 +6458,34 @@ def create_ccprotect_rule(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--id'], dict(help="""(string) 需要修改的规则ID """, dest='id', required=True)), - (['--uri'], dict(help="""(string) null """, dest='uri', required=False)), - (['--detect-period'], dict(help="""(int) null """, dest='detectPeriod', type=int, required=False)), - (['--single-ip-limit'], dict(help="""(int) null """, dest='singleIpLimit', type=int, required=False)), - (['--block-type'], dict(help="""(int) null """, dest='blockType', type=int, required=False)), - (['--block-time'], dict(help="""(int) null """, dest='blockTime', type=int, required=False)), + (['--source-type'], dict(help="""(string) 回源类型只能为[ips,domain]中的一种 """, dest='sourceType', required=False)), + (['--back-source-type'], dict(help="""(string) NA """, dest='backSourceType', required=False)), + (['--default-source-host'], dict(help="""(string) 默认回源host """, dest='defaultSourceHost', required=False)), + (['--domain-source'], dict(help="""(array: array) NA """, dest='domainSource', required=False)), + (['--ip-source'], dict(help="""(array: array) NA """, dest='ipSource', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改CC防护规则 ''', + help=''' 设置直播域名回源信息 ''', description=''' - 修改CC防护规则。 + 设置直播域名回源信息。 - 示例: jdc cdn update-ccprotect-rule --domain xxx --id xxx + 示例: jdc cdn set-live-domain-back-source --domain xxx ''', ) - def update_ccprotect_rule(self): + def set_live_domain_back_source(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.UpdateCCProtectRuleRequest import UpdateCCProtectRuleRequest + from jdcloud_sdk.services.cdn.apis.SetLiveDomainBackSourceRequest import SetLiveDomainBackSourceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateCCProtectRuleRequest(params_dict, headers) + req = SetLiveDomainBackSourceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4347,29 +6496,31 @@ def update_ccprotect_rule(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--ids'], dict(help="""(array) NA """, dest='ids', required=False)), + (['--ips'], dict(help="""(array) ip名单,ips中url不能超过50条 """, dest='ips', required=False)), + (['--ip-list-type'], dict(help="""(string) ip黑白名单类型,black:黑名单,white:白名单 """, dest='ipListType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启用CC防护规则 ''', + help=''' 设置直播域名ip黑白名单 ''', description=''' - 启用CC防护规则。 + 设置直播域名ip黑白名单。 - 示例: jdc cdn enable-ccprotect-rule --domain xxx + 示例: jdc cdn set-live-domain-ip-black-list --domain xxx ''', ) - def enable_ccprotect_rule(self): + def set_live_domain_ip_black_list(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.EnableCCProtectRuleRequest import EnableCCProtectRuleRequest + from jdcloud_sdk.services.cdn.apis.SetLiveDomainIpBlackListRequest import SetLiveDomainIpBlackListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableCCProtectRuleRequest(params_dict, headers) + req = SetLiveDomainIpBlackListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4380,29 +6531,33 @@ def enable_ccprotect_rule(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--ids'], dict(help="""(array) NA """, dest='ids', required=False)), + (['--refer-type'], dict(help="""(string) refer类型,取值:block(黑名单),allow(白名单)默认为block """, dest='referType', required=False)), + (['--refer-list'], dict(help="""(array) 逗号隔开的域名列表,如果referList传空则为删除 """, dest='referList', required=False)), + (['--allow-no-refer-header'], dict(help="""(string) 是否允许空refer访问,默认为“on” """, dest='allowNoReferHeader', required=False)), + (['--allow-null-refer-header'], dict(help="""(string) 是否允许无ua访问,默认为“on” """, dest='allowNullReferHeader', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 禁用CC防护规则 ''', + help=''' 设置域名refer防盗链 ''', description=''' - 禁用CC防护规则。 + 设置域名refer防盗链。 - 示例: jdc cdn disable-ccprotect-rule --domain xxx + 示例: jdc cdn set-live-domain-refer --domain xxx ''', ) - def disable_ccprotect_rule(self): + def set_live_domain_refer(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.DisableCCProtectRuleRequest import DisableCCProtectRuleRequest + from jdcloud_sdk.services.cdn.apis.SetLiveDomainReferRequest import SetLiveDomainReferRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisableCCProtectRuleRequest(params_dict, headers) + req = SetLiveDomainReferRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4413,29 +6568,30 @@ def disable_ccprotect_rule(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--ids'], dict(help="""(string) NA """, dest='ids', required=True)), + (['--black-ips-enable'], dict(help="""(string) NA """, dest='blackIpsEnable', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除ccProtectRule ''', + help=''' 开启或关闭ip黑名单 ''', description=''' - 删除ccProtectRule。 + 开启或关闭ip黑名单。 - 示例: jdc cdn delete-ccprotect-rule --domain xxx --ids xxx + 示例: jdc cdn operate-live-domain-ip-black-list --domain xxx ''', ) - def delete_ccprotect_rule(self): + def operate_live_domain_ip_black_list(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.DeleteCCProtectRuleRequest import DeleteCCProtectRuleRequest + from jdcloud_sdk.services.cdn.apis.OperateLiveDomainIpBlackListRequest import OperateLiveDomainIpBlackListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteCCProtectRuleRequest(params_dict, headers) + req = OperateLiveDomainIpBlackListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4446,28 +6602,30 @@ def delete_ccprotect_rule(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--source-host'], dict(help="""(string) 默认回源host """, dest='sourceHost', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询web防护开关 ''', + help=''' 设置直播域名回源host ''', description=''' - 查询web防护开关。 + 设置直播域名回源host。 - 示例: jdc cdn query-web-protect-switch --domain xxx + 示例: jdc cdn set-live-domain-back-source-host --domain xxx ''', ) - def query_web_protect_switch(self): + def set_live_domain_back_source_host(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryWebProtectSwitchRequest import QueryWebProtectSwitchRequest + from jdcloud_sdk.services.cdn.apis.SetLiveDomainBackSourceHostRequest import SetLiveDomainBackSourceHostRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryWebProtectSwitchRequest(params_dict, headers) + req = SetLiveDomainBackSourceHostRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4478,29 +6636,32 @@ def query_web_protect_switch(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--switch-status'], dict(help="""(string) 开关状态, on:开启,off:关闭 """, dest='switchStatus', required=False)), + (['--accesskey-type'], dict(help="""(int) url鉴权开启1关闭0 """, dest='accesskeyType', type=int, required=False)), + (['--accesskey-key'], dict(help="""(string) url鉴权开启时必传 """, dest='accesskeyKey', required=False)), + (['--auth-life-time'], dict(help="""(int) 开启时默认值为300s,关闭时为0 """, dest='authLifeTime', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置web防护开关 ''', + help=''' 设置URL鉴权 ''', description=''' - 设置web防护开关。 + 设置URL鉴权。 - 示例: jdc cdn set-web-protect-switch --domain xxx + 示例: jdc cdn set-live-domain-access-key --domain xxx ''', ) - def set_web_protect_switch(self): + def set_live_domain_access_key(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.SetWebProtectSwitchRequest import SetWebProtectSwitchRequest + from jdcloud_sdk.services.cdn.apis.SetLiveDomainAccessKeyRequest import SetLiveDomainAccessKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetWebProtectSwitchRequest(params_dict, headers) + req = SetLiveDomainAccessKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4511,28 +6672,36 @@ def set_web_protect_switch(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--certificate'], dict(help="""(string) https证书,转https格式时必传 """, dest='certificate', required=False)), + (['--rsa-key'], dict(help="""(string) https私钥,转https格式时必传 """, dest='rsaKey', required=False)), + (['--cert-from'], dict(help="""(string) 证书来源有两种类型:default,ssl """, dest='certFrom', required=False)), + (['--ssl-cert-id'], dict(help="""(string) ssl证书id """, dest='sslCertId', required=False)), + (['--sync-to-ssl'], dict(help="""(bool) 是否同步到ssl,boolean值,取值true或者false """, dest='syncToSsl', type=bool, required=False)), + (['--cert-name'], dict(help="""(string) syncToSsl是true时,certName是必填项 """, dest='certName', required=False)), + (['--protocol-converts'], dict(help="""(array: array) NA """, dest='protocolConverts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询web防护开关 ''', + help=''' 设置转协议 ''', description=''' - 查询web防护开关。 + 设置转协议。 - 示例: jdc cdn query-web-protect-settings --domain xxx + 示例: jdc cdn set-protocol-convert --domain xxx ''', ) - def query_web_protect_settings(self): + def set_protocol_convert(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryWebProtectSettingsRequest import QueryWebProtectSettingsRequest + from jdcloud_sdk.services.cdn.apis.SetProtocolConvertRequest import SetProtocolConvertRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryWebProtectSettingsRequest(params_dict, headers) + req = SetProtocolConvertRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4543,31 +6712,30 @@ def query_web_protect_settings(self): @expose( arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), - (['--waf-mode'], dict(help="""(string) 0:拦截模式 (阻断forbidden 493跳到自定义页面) ,1-检测模式(观察notice) """, dest='wafMode', required=False)), - (['--waf-level'], dict(help="""(int) 规则策略等级 0为宽松, 1为正常, 2为严格 """, dest='wafLevel', type=int, required=False)), - (['--redirection'], dict(help="""(string) 拦截模式跳转的自定义页面名称, 缺省或default返回默认页面 """, dest='redirection', required=False)), + (['--delete-streams'], dict(help="""(array: array) 要删除的禁播流 """, dest='deleteStreams', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置web防护开关 ''', + help=''' 删除禁播流 ''', description=''' - 设置web防护开关。 + 删除禁播流。 - 示例: jdc cdn update-web-protect-settings --domain xxx + 示例: jdc cdn delete-forbidden-stream --domain xxx ''', ) - def update_web_protect_settings(self): + def delete_forbidden_stream(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.UpdateWebProtectSettingsRequest import UpdateWebProtectSettingsRequest + from jdcloud_sdk.services.cdn.apis.DeleteForbiddenStreamRequest import DeleteForbiddenStreamRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateWebProtectSettingsRequest(params_dict, headers) + req = DeleteForbiddenStreamRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4577,29 +6745,33 @@ def update_web_protect_settings(self): @expose( arguments=[ - (['--skip-type'], dict(help="""(string) skipType, valid values [skip, deny] """, dest='skipType', required=True)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), + (['--app'], dict(help="""(string) app名,传appName查询流名列表 """, dest='app', required=False)), + (['--stream'], dict(help="""(string) 流名模糊查询 """, dest='stream', required=False)), + (['--limit'], dict(help="""(int) 指定app/流名列表大小,默认50 """, dest='limit', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询waf地域信息 ''', + help=''' 查询用户推流域名app名/流名 ''', description=''' - 查询waf地域信息。 + 查询用户推流域名app名/流名。 - 示例: jdc cdn query-waf-regions --skip-type xxx + 示例: jdc cdn query-push-domain-orapp-or-stream --domain xxx ''', ) - def query_waf_regions(self): + def query_push_domain_orapp_or_stream(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryWafRegionsRequest import QueryWafRegionsRequest + from jdcloud_sdk.services.cdn.apis.QueryPushDomainORAppOrStreamRequest import QueryPushDomainORAppOrStreamRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryWafRegionsRequest(params_dict, headers) + req = QueryPushDomainORAppOrStreamRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4611,27 +6783,28 @@ def query_waf_regions(self): arguments=[ (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询waf ip黑名单配置状态 ''', + help=''' 查询ip黑白名单 ''', description=''' - 查询waf ip黑名单配置状态。 + 查询ip黑白名单。 - 示例: jdc cdn query-ip-black-setting-status --domain xxx + 示例: jdc cdn query-live-domain-ip-black-white-list --domain xxx ''', ) - def query_ip_black_setting_status(self): + def query_live_domain_ip_black_white_list(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.QueryIpBlackSettingStatusRequest import QueryIpBlackSettingStatusRequest + from jdcloud_sdk.services.cdn.apis.QueryLiveDomainIpBlackWhiteListRequest import QueryLiveDomainIpBlackWhiteListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryIpBlackSettingStatusRequest(params_dict, headers) + req = QueryLiveDomainIpBlackWhiteListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4641,31 +6814,39 @@ def query_ip_black_setting_status(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--play-domain'], dict(help="""(string) 播放域名 """, dest='playDomain', required=False)), + (['--publish-domain'], dict(help="""(string) 创建推流域名时,必传推流域名 """, dest='publishDomain', required=False)), + (['--source-type'], dict(help="""(string) 回源类型只能是[ips,domain]中的一种 """, dest='sourceType', required=False)), + (['--back-http-type'], dict(help="""(string) NA """, dest='backHttpType', required=False)), + (['--default-source-host'], dict(help="""(string) 默认回源host """, dest='defaultSourceHost', required=False)), + (['--site-type'], dict(help="""(string) 站点类型pull(拉流)push(推流) """, dest='siteType', required=False)), + (['--back-source-type'], dict(help="""(string) 回源类型,目前只能为rtmp """, dest='backSourceType', required=False)), + (['--ip-source'], dict(help="""(array: array) NA """, dest='ipSource', required=False)), + (['--domain-source'], dict(help="""(array: array) NA """, dest='domainSource', required=False)), + (['--accelerate-region'], dict(help="""(string) 加速区域(mainLand:中国大陆,nonMainLand:海外加港澳台,all:全球)默认为中国大陆 """, dest='accelerateRegion', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询攻击来源 ''', + help=''' 创建直播域名 ''', description=''' - 查询攻击来源。 + 创建直播域名。 - 示例: jdc cdn waf-query-pv-for-area-and-ip + 示例: jdc cdn batch-create-live-domain ''', ) - def waf_query_pv_for_area_and_ip(self): + def batch_create_live_domain(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.WafQueryPvForAreaAndIpRequest import WafQueryPvForAreaAndIpRequest + from jdcloud_sdk.services.cdn.apis.BatchCreateLiveDomainRequest import BatchCreateLiveDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = WafQueryPvForAreaAndIpRequest(params_dict, headers) + req = BatchCreateLiveDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4675,31 +6856,30 @@ def waf_query_pv_for_area_and_ip(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询总请求量与攻击请求量 ''', + help=''' 查询直播域名详情v1 ''', description=''' - 查询总请求量与攻击请求量。 + 查询直播域名详情v1。 - 示例: jdc cdn waf-query-pv + 示例: jdc cdn query-live-domain-detail --domain xxx ''', ) - def waf_query_pv(self): + def query_live_domain_detail(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.WafQueryPvRequest import WafQueryPvRequest + from jdcloud_sdk.services.cdn.apis.QueryLiveDomainDetailRequest import QueryLiveDomainDetailRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = WafQueryPvRequest(params_dict, headers) + req = QueryLiveDomainDetailRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4709,35 +6889,30 @@ def waf_query_pv(self): @expose( arguments=[ - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询截止时间,UTC时间,格式为:yyyy-MM-dd'T'HH:mm:ss'Z',示例:2018-10-21T10:00:00Z """, dest='endTime', required=False)), - (['--domain'], dict(help="""(string) 需要查询的域名, 必须为用户pin下有权限的域名 """, dest='domain', required=False)), - (['--sort-field'], dict(help="""(string) 排序字段 """, dest='sortField', required=False)), - (['--sort-rule'], dict(help="""(string) 排序规则:desc,asc """, dest='sortRule', required=False)), - (['--page-number'], dict(help="""(int) 页码,从1开始 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 页大小,默认20 """, dest='pageSize', type=int, required=False)), + (['--domain'], dict(help="""(string) 用户域名 """, dest='domain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询攻击记录详情 ''', + help=''' 查询直播域名app列表 ''', description=''' - 查询攻击记录详情。 + 查询直播域名app列表。 - 示例: jdc cdn waf-query-attack-details + 示例: jdc cdn query-live-domain-apps --domain xxx ''', ) - def waf_query_attack_details(self): + def query_live_domain_apps(self): client_factory = ClientFactory('cdn') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cdn.apis.WafQueryAttackDetailsRequest import WafQueryAttackDetailsRequest + from jdcloud_sdk.services.cdn.apis.QueryLiveDomainAppsRequest import QueryLiveDomainAppsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = WafQueryAttackDetailsRequest(params_dict, headers) + req = QueryLiveDomainAppsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4747,7 +6922,7 @@ def waf_query_attack_details(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['query-domains-log','query-domain-log','query-online-billing-type','set-online-billing-type','query-band','query-band-with-area','query-domain-config-status','query-area-isp-list','preview-certificate','query-default-http-header-key','query-ip-black-list','set-ip-black-list','operate-ip-black-list','create-cache-rule','update-cache-rule','delete-cache-rule','query-http-header','set-http-header','delete-http-header','set-video-draft','set-range','set-ignore-query-string','query-user-agent','set-user-agent-config','query-accesskey-config','set-accesskey-config','set-refer','query-monitor','set-monitor','stop-monitor','set-source','operate-share-cache','set-http-type','query-follow-redirect','set-follow-redirect','query-follow-source-protocol','set-follow-source-protocol','set-domain-config','query-domain-all-config-classify','execute-domain-copy','query-domain-group-list','query-domain-group-detail','query-domains-not-in-group','update-domain-group','create-domain-group','batch-delete-domain-group','get-domain-list','get-domain-list-by-filter','get-domain-detail','create-domain','delete-domain','start-domain','stop-domain','query-oss-buckets','batch-create','query-domain-config','check-whether-ip-belong-to-jcloud','set-live-domain-back-source','set-live-domain-ip-black-list','set-live-domain-refer','operate-live-domain-ip-black-list','set-live-domain-back-source-host','set-live-domain-access-key','set-protocol-convert','delete-forbidden-stream','query-push-domain-orapp-or-stream','batch-create-live-domain','query-live-domain-detail','query-live-domain-apps','create-live-domain-prefecth-task','query-live-prefetch-task','query-refresh-task-by-ids','query-refresh-task-by-id','create-refresh-task-for-callback','create-refresh-task-for-callback-v2','query-refresh-task','create-refresh-task','query-net-protection-rules','set-net-protection-rules','query-net-protection-rules-switch','set-net-protection-rules-switch','query-geo-areas','query-attack-type-count','query-ddos-graph','search-attack-log','get-all-upper-node-ip-list','get-ssl-cert-list','get-ssl-cert-detail','upload-cert','query-mix-statistics-data','query-mix-statistics-with-area-data','query-mix-traffic-group-sum','query-statistics-data','query-statistics-data-group-by-area','query-statistics-data-group-sum','query-live-statistics-data','query-live-statistics-area-data-group-by','query-live-traffic-group-sum','query-statistics-top-ip','query-statistics-top-url','query-dir-bandwidth','query-waf-switch','set-waf-switch','query-waf-white-rule-switch','set-waf-white-rule-switch','querywaf-white-rules','create-waf-white-rule','update-waf-white-rule','enable-waf-white-rules','disable-waf-white-rules','delete-waf-white-rules','query-waf-black-rule-switch','set-waf-black-rule-switch','querywaf-black-rules','create-waf-black-rule','update-waf-black-rule','enable-waf-black-rules','disable-waf-black-rules','delete-waf-black-rules','query-ccprotect-switch','set-ccprotect-switch','query-ccprotect-rules','create-ccprotect-rule','update-ccprotect-rule','enable-ccprotect-rule','disable-ccprotect-rule','delete-ccprotect-rule','query-web-protect-switch','set-web-protect-switch','query-web-protect-settings','update-web-protect-settings','query-waf-regions','query-ip-black-setting-status','waf-query-pv-for-area-and-ip','waf-query-pv','waf-query-attack-details',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['query-forbidden-info-list','create-forbidden-info','delete-forbidden-info','query-un-forbidden-status','create-live-domain-prefecth-task','query-live-prefetch-task','query-area-isp-list','query-area-isp-list-v2','query-mix-statistics-data','query-mix-statistics-with-area-data','query-mix-traffic-group-sum','query-statistics-data','query-statistics-data-group-by-area','query-statistics-data-group-sum','query-live-statistics-data','query-live-statistics-area-data-group-by','query-live-traffic-group-sum','query-statistics-top-ip','query-statistics-top-url','query-dir-bandwidth','query-dir-stats-data','query-customized-dir-band-width','query-stream-info','query-domain-temp-inst-list','query-domain-temp-pro-keys','modify-domain-temp-inst','query-domain-temp-inst','del-domain-temp-instance','get-domain-list','get-domain-list-by-filter','get-domain-detail','create-domain','delete-domain','start-domain','stop-domain','query-oss-buckets','batch-create','query-domain-config','config-service-notice','query-service-notice','query-online-billing-type','set-online-billing-type','query-domain-config-status','check-whether-ip-belong-to-jcloud','query-service-ip','get-all-upper-node-ip-list','query-domain-group-list','query-domain-group-detail','query-domains-not-in-group','update-domain-group','create-domain-group','batch-delete-domain-group','query-waf-switch','set-waf-switch','query-waf-white-rule-switch','set-waf-white-rule-switch','querywaf-white-rules','create-waf-white-rule','update-waf-white-rule','enable-waf-white-rules','disable-waf-white-rules','delete-waf-white-rules','query-waf-black-rule-switch','set-waf-black-rule-switch','querywaf-black-rules','create-waf-black-rule','update-waf-black-rule','enable-waf-black-rules','disable-waf-black-rules','delete-waf-black-rules','query-ccprotect-switch','set-ccprotect-switch','query-ccprotect-rules','create-ccprotect-rule','update-ccprotect-rule','enable-ccprotect-rule','disable-ccprotect-rule','delete-ccprotect-rule','query-web-protect-switch','set-web-protect-switch','query-web-protect-settings','update-web-protect-settings','query-waf-regions','query-ip-black-setting-status','bat-create-prefetch-task','update-prefetch-task','query-prefetch-task','stop-prefetch-task','operate-purge-task','query-purge-task','query-net-protection-rules','set-net-protection-rules','query-net-protection-rules-switch','set-net-protection-rules-switch','query-geo-areas','query-attack-type-count','query-ddos-graph','search-attack-log','preview-certificate','query-default-http-header-key','query-ip-black-list','set-ip-black-list','operate-ip-black-list','query-custom-error-page','set-custom-error-page','create-cache-rule','update-cache-rule','delete-cache-rule','set-cache-rules','query-http-header','set-http-header','delete-http-header','set-video-draft','set-range','set-ignore-query-string','set-filter-args','query-filter-args','query-user-agent','set-user-agent-config','query-accesskey-config','set-accesskey-config','set-refer','query-monitor','set-monitor','stop-monitor','set-source','operate-share-cache','set-http-type','query-follow-redirect','set-follow-redirect','query-follow-source-protocol','set-follow-source-protocol','set-domain-config','query-domain-all-config-classify','execute-domain-copy','query-extra-cache-time','set-extra-cache-time','delete-extra-cache-time','batch-set-extra-cache-time','set-gzip','config-back-source-rule','query-back-source-rule','config-url-rule','query-url-rule','config-http2','query-http2','config-back-source-path','query-back-source-path','set-accelerate-region','config-back-source-rules','query-back-source-rules','config-back-source-oss','query-back-source-oss','speed-limit','query-band','query-band-with-area','query-cdn-user-quota','query-refresh-task-by-ids','set-refresh-limit','query-refresh-limit','query-refresh-task-by-id','create-refresh-task-for-callback','create-refresh-task-for-callback-v2','query-refresh-task','create-refresh-task','get-ssl-cert-list','get-ssl-cert-detail','upload-cert','query-avg-bandwidth-for-pcdn','query-device-status-for-pcdn','query-jdbox-statistics-data','query-jdbox-statistics-data-with-group','query-jbox-avg-bandwidth','query-domains-log','query-domain-log','waf-query-pv-for-area-and-ip','waf-query-pv','waf-query-attack-details','set-auth-config','set-source-auth-config','set-live-domain-back-source','set-live-domain-ip-black-list','set-live-domain-refer','operate-live-domain-ip-black-list','set-live-domain-back-source-host','set-live-domain-access-key','set-protocol-convert','delete-forbidden-stream','query-push-domain-orapp-or-stream','query-live-domain-ip-black-white-list','batch-create-live-domain','query-live-domain-detail','query-live-domain-apps',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/clouddnsservice.py b/jdcloud_cli/controllers/services/clouddnsservice.py index e9029e2..d432d48 100644 --- a/jdcloud_cli/controllers/services/clouddnsservice.py +++ b/jdcloud_cli/controllers/services/clouddnsservice.py @@ -38,36 +38,33 @@ class Meta: @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 分页参数,页的序号,默认是1 """, dest='pageNumber', type=int, required=True)), - (['--page-size'], dict(help="""(int) 分页参数,每页含有的结果的数目,默认是10 """, dest='pageSize', type=int, required=True)), - (['--start-time'], dict(help="""(string) 记录的起始时间,格式:UTC时间例如2017-11-10T23:00:00Z """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 记录的终止时间,格式:UTC时间例如2017-11-10T23:00:00Z """, dest='endTime', required=True)), - (['--key-word'], dict(help="""(string) 日志需要匹配的关键词 """, dest='keyWord', required=False)), - (['--success'], dict(help="""(bool) 日志里面的结果是成功还是失败 """, dest='success', required=False)), - (['--type'], dict(help="""(int) 日志的类型 """, dest='type', type=int, required=False)), + (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), + (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), + (['--page-number'], dict(help="""(int) 当前页数,起始值为1,默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数, 默认为10 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看用户在云解析服务下的操作记录 ''', + help=''' 查询主域名的解析记录。 ; 在使用解析记录相关的接口之前,请调用此接口获取解析记录的列表。; ''', description=''' - 查看用户在云解析服务下的操作记录。 + 查询主域名的解析记录。 ; 在使用解析记录相关的接口之前,请调用此接口获取解析记录的列表。; 。 - 示例: jdc clouddnsservice get-action-log --page-number 0 --page-size 0 --start-time xxx --end-time xxx + 示例: jdc clouddnsservice search-rr --domain-id xxx ''', ) - def get_action_log(self): + def search_rr(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.GetActionLogRequest import GetActionLogRequest + from jdcloud_sdk.services.clouddnsservice.apis.SearchRRRequest import SearchRRRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetActionLogRequest(params_dict, headers) + req = SearchRRRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -78,31 +75,33 @@ def get_action_log(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 分页查询时查询的每页的序号,起始值为1,默认为1 """, dest='pageNumber', type=int, required=True)), - (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数,默认为10 """, dest='pageSize', type=int, required=True)), - (['--domain-name'], dict(help="""(string) 关键字,按照”%domainName%”模式匹配主域名 """, dest='domainName', required=False)), + (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), + (['--load-mode'], dict(help="""(int) 展示方式,暂时不使用 """, dest='loadMode', type=int, required=False)), + (['--pack-id'], dict(help="""(int) 套餐ID,0->免费版 1->企业版 2->企业高级版 """, dest='packId', type=int, required=True)), + (['--view-id'], dict(help="""(int) view ID,默认为-1 """, dest='viewId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取用户所属的主域名列表。 ; 请在调用域名相关的接口之前,调用此接口获取相关的domainId和domainName。 ; 主域名的相关概念,请查阅云解析文档; ''', + help=''' 查询云解析所有的基础解析线路。 ; 在使用解析线路的参数之前,请调用此接口获取解析线路的ID。; ''', description=''' - 获取用户所属的主域名列表。 ; 请在调用域名相关的接口之前,调用此接口获取相关的domainId和domainName。 ; 主域名的相关概念,请查阅云解析文档; 。 + 查询云解析所有的基础解析线路。 ; 在使用解析线路的参数之前,请调用此接口获取解析线路的ID。; 。 - 示例: jdc clouddnsservice get-domains --page-number 0 --page-size 0 + 示例: jdc clouddnsservice get-view-tree --domain-id xxx --pack-id 5 --view-id 5 ''', ) - def get_domains(self): + def get_view_tree(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.GetDomainsRequest import GetDomainsRequest + from jdcloud_sdk.services.clouddnsservice.apis.GetViewTreeRequest import GetViewTreeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDomainsRequest(params_dict, headers) + req = GetViewTreeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -113,35 +112,31 @@ def get_domains(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--pack-id'], dict(help="""(int) 主域名的套餐类型, 0->免费 ,1->企业版, 2->高级版 """, dest='packId', type=int, required=True)), - (['--domain-name'], dict(help="""(string) 要添加的主域名 """, dest='domainName', required=True)), - (['--domain-id'], dict(help="""(int) 主域名的ID,升级套餐必填,请使用getDomains获取 """, dest='domainId', type=int, required=False)), - (['--buy-type'], dict(help="""(int) 1->新购买、3->升级,收费套餐的域名必填 """, dest='buyType', type=int, required=False)), - (['--time-span'], dict(help="""(int) 取值1,2,3 ,含义:时长,收费套餐的域名必填 """, dest='timeSpan', type=int, required=False)), - (['--time-unit'], dict(help="""(int) 时间单位,收费套餐的域名必填,1:小时,2:天,3:月,4:年 """, dest='timeUnit', type=int, required=False)), - (['--billing-type'], dict(help="""(int) 计费类型,可以不传此参数。 """, dest='billingType', type=int, required=False)), + (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), + (['--req'], dict(help="""(addRR) RR参数 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加主域名 ; 如何添加免费域名,详细情况请查阅文档; 添加收费域名,请查阅文档,; 添加收费域名前,请确保用户的京东云账户有足够的资金支付,Openapi接口回返回订单号,可以用此订单号向计费系统查阅详情。; ''', + help=''' 添加主域名的解析记录 ''', description=''' - 添加主域名 ; 如何添加免费域名,详细情况请查阅文档; 添加收费域名,请查阅文档,; 添加收费域名前,请确保用户的京东云账户有足够的资金支付,Openapi接口回返回订单号,可以用此订单号向计费系统查阅详情。; 。 + 添加主域名的解析记录。 - 示例: jdc clouddnsservice add-domain --pack-id 0 --domain-name xxx + 示例: jdc clouddnsservice add-rr --domain-id xxx --req '{"":""}' ''', ) - def add_domain(self): + def add_rr(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.AddDomainRequest import AddDomainRequest + from jdcloud_sdk.services.clouddnsservice.apis.AddRRRequest import AddRRRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddDomainRequest(params_dict, headers) + req = AddRRRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -152,29 +147,31 @@ def add_domain(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--domain-id'], dict(help="""(int) 需要删除的主域名ID,请使用getDomains接口获取 """, dest='domainId', type=int, required=True)), + (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), + (['--req'], dict(help="""(updateRR) updateRR参数 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除主域名 ''', + help=''' 修改主域名的某个解析记录 ''', description=''' - 删除主域名。 + 修改主域名的某个解析记录。 - 示例: jdc clouddnsservice del-domain --domain-id 0 + 示例: jdc clouddnsservice update-rr --domain-id xxx --req '{"":""}' ''', ) - def del_domain(self): + def update_rr(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.DelDomainRequest import DelDomainRequest + from jdcloud_sdk.services.clouddnsservice.apis.UpdateRRRequest import UpdateRRRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DelDomainRequest(params_dict, headers) + req = UpdateRRRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -185,30 +182,32 @@ def del_domain(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--domain-name'], dict(help="""(string) 需要修改的主域名,请使用getDomains接口获取 """, dest='domainName', required=True)), - (['--id'], dict(help="""(int) 需要修改的主域名ID,请使用getDomains接口获取 """, dest='id', type=int, required=True)), + (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), + (['--ids'], dict(help="""(array: int) 需要操作的解析记录ID,请使用searchRR接口获取。 """, dest='ids', type=int, required=True)), + (['--action'], dict(help="""(string) 操作类型,on->启用 off->停用 del->删除 """, dest='action', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改主域名 ''', + help=''' 启用、停用、删除主域名下的解析记录 ''', description=''' - 修改主域名。 + 启用、停用、删除主域名下的解析记录。 - 示例: jdc clouddnsservice update-domain --domain-name xxx --id 0 + 示例: jdc clouddnsservice operate-rr --domain-id xxx --ids [5] --action xxx ''', ) - def update_domain(self): + def operate_rr(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.UpdateDomainRequest import UpdateDomainRequest + from jdcloud_sdk.services.clouddnsservice.apis.OperateRRRequest import OperateRRRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateDomainRequest(params_dict, headers) + req = OperateRRRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -219,32 +218,30 @@ def update_domain(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), - (['--domain-name'], dict(help="""(string) 查询的主域名,,请使用getDomains接口获取 """, dest='domainName', required=True)), - (['--start'], dict(help="""(string) 查询时间段的起始时间, UTC时间,例如2017-11-10T23:00:00Z """, dest='start', required=True)), - (['--end'], dict(help="""(string) 查询时间段的终止时间, UTC时间,例如2017-11-10T23:00:00Z """, dest='end', required=True)), + (['--req'], dict(help="""(array: batchSetDNS) 需要设置的解析记录列表 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看主域名的解析次数 ''', + help=''' 同一个主域名下,批量新增或者批量更新导入解析记录。; 如果解析记录的ID为0,是新增解析记录,如果不为0,则是更新解析记录。; ''', description=''' - 查看主域名的解析次数。 + 同一个主域名下,批量新增或者批量更新导入解析记录。; 如果解析记录的ID为0,是新增解析记录,如果不为0,则是更新解析记录。; 。 - 示例: jdc clouddnsservice get-domain-query-count --domain-id xxx --domain-name xxx --start xxx --end xxx + 示例: jdc clouddnsservice batch-set-dns-resolve --req ['{"":""}'] ''', ) - def get_domain_query_count(self): + def batch_set_dns_resolve(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.GetDomainQueryCountRequest import GetDomainQueryCountRequest + from jdcloud_sdk.services.clouddnsservice.apis.BatchSetDnsResolveRequest import BatchSetDnsResolveRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDomainQueryCountRequest(params_dict, headers) + req = BatchSetDnsResolveRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -255,32 +252,32 @@ def get_domain_query_count(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), - (['--domain-name'], dict(help="""(string) 主域名,请使用getDomains接口获取 """, dest='domainName', required=True)), - (['--start'], dict(help="""(string) 时间段的起始时间, UTC时间,例如2017-11-10T23:00:00Z """, dest='start', required=True)), - (['--end'], dict(help="""(string) 时间段的终止时间, UTC时间,例如2017-11-10T23:00:00Z """, dest='end', required=True)), + (['--page-number'], dict(help="""(int) 分页查询时查询的每页的序号,起始值为1,默认为1 """, dest='pageNumber', type=int, required=True)), + (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数,默认为10 """, dest='pageSize', type=int, required=True)), + (['--domain-name'], dict(help="""(string) 关键字,按照”%domainName%”模式匹配主域名 """, dest='domainName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看域名的查询流量 ''', + help=''' 获取用户所属的主域名列表。 ; 请在调用域名相关的接口之前,调用此接口获取相关的domainId和domainName。 ; 主域名的相关概念,请查阅云解析文档; ''', description=''' - 查看域名的查询流量。 + 获取用户所属的主域名列表。 ; 请在调用域名相关的接口之前,调用此接口获取相关的domainId和domainName。 ; 主域名的相关概念,请查阅云解析文档; 。 - 示例: jdc clouddnsservice get-domain-query-traffic --domain-id xxx --domain-name xxx --start xxx --end xxx + 示例: jdc clouddnsservice get-domains --page-number 5 --page-size 5 ''', ) - def get_domain_query_traffic(self): + def get_domains(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.GetDomainQueryTrafficRequest import GetDomainQueryTrafficRequest + from jdcloud_sdk.services.clouddnsservice.apis.GetDomainsRequest import GetDomainsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDomainQueryTrafficRequest(params_dict, headers) + req = GetDomainsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -291,31 +288,36 @@ def get_domain_query_traffic(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), - (['--page-number'], dict(help="""(int) 当前页数,起始值为1,默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数, 默认为10 """, dest='pageSize', type=int, required=False)), + (['--pack-id'], dict(help="""(int) 主域名的套餐类型, 0->免费 ,1->企业版, 2->高级版 """, dest='packId', type=int, required=True)), + (['--domain-name'], dict(help="""(string) 要添加的主域名 """, dest='domainName', required=True)), + (['--domain-id'], dict(help="""(int) 主域名的ID,升级套餐必填,请使用getDomains获取 """, dest='domainId', type=int, required=False)), + (['--buy-type'], dict(help="""(int) 1->新购买、3->升级,收费套餐的域名必填 """, dest='buyType', type=int, required=False)), + (['--time-span'], dict(help="""(int) 取值1,2,3 ,含义:时长,收费套餐的域名必填 """, dest='timeSpan', type=int, required=False)), + (['--time-unit'], dict(help="""(int) 时间单位,收费套餐的域名必填,1:小时,2:天,3:月,4:年 """, dest='timeUnit', type=int, required=False)), + (['--billing-type'], dict(help="""(int) 计费类型,可以不传此参数。 """, dest='billingType', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询主域名的解析记录。 ; 在使用解析记录相关的接口之前,请调用此接口获取解析记录的列表。; ''', + help=''' 添加主域名 ; 如何添加免费域名,详细情况请查阅文档; 添加收费域名,请查阅文档,; 添加收费域名前,请确保用户的京东云账户有足够的资金支付,Openapi接口回返回订单号,可以用此订单号向计费系统查阅详情。; ''', description=''' - 查询主域名的解析记录。 ; 在使用解析记录相关的接口之前,请调用此接口获取解析记录的列表。; 。 + 添加主域名 ; 如何添加免费域名,详细情况请查阅文档; 添加收费域名,请查阅文档,; 添加收费域名前,请确保用户的京东云账户有足够的资金支付,Openapi接口回返回订单号,可以用此订单号向计费系统查阅详情。; 。 - 示例: jdc clouddnsservice search-rr --domain-id xxx + 示例: jdc clouddnsservice add-domain --pack-id 5 --domain-name xxx ''', ) - def search_rr(self): + def add_domain(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.SearchRRRequest import SearchRRRequest + from jdcloud_sdk.services.clouddnsservice.apis.AddDomainRequest import AddDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SearchRRRequest(params_dict, headers) + req = AddDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -326,32 +328,30 @@ def search_rr(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), - (['--load-mode'], dict(help="""(int) 展示方式,暂时不使用 """, dest='loadMode', type=int, required=False)), - (['--pack-id'], dict(help="""(int) 套餐ID,0->免费版 1->企业版 2->企业高级版 """, dest='packId', type=int, required=True)), - (['--view-id'], dict(help="""(int) view ID,默认为-1 """, dest='viewId', type=int, required=True)), + (['--domain-id'], dict(help="""(int) 需要删除的主域名ID,请使用getDomains接口获取 """, dest='domainId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询云解析所有的基础解析线路。 ; 在使用解析线路的参数之前,请调用此接口获取解析线路的ID。; ''', + help=''' 删除主域名 ''', description=''' - 查询云解析所有的基础解析线路。 ; 在使用解析线路的参数之前,请调用此接口获取解析线路的ID。; 。 + 删除主域名。 - 示例: jdc clouddnsservice get-view-tree --domain-id xxx --pack-id 0 --view-id 0 + 示例: jdc clouddnsservice del-domain --domain-id 5 ''', ) - def get_view_tree(self): + def del_domain(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.GetViewTreeRequest import GetViewTreeRequest + from jdcloud_sdk.services.clouddnsservice.apis.DelDomainRequest import DelDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetViewTreeRequest(params_dict, headers) + req = DelDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -362,30 +362,31 @@ def get_view_tree(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), - (['--req'], dict(help="""(addRR) RR参数 """, dest='req', required=True)), + (['--domain-name'], dict(help="""(string) 需要修改的主域名,请使用getDomains接口获取 """, dest='domainName', required=True)), + (['--id'], dict(help="""(int) 需要修改的主域名ID,请使用getDomains接口获取 """, dest='id', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加主域名的解析记录 ''', + help=''' 修改主域名 ''', description=''' - 添加主域名的解析记录。 + 修改主域名。 - 示例: jdc clouddnsservice add-rr --domain-id xxx --req '{"":""}' + 示例: jdc clouddnsservice update-domain --domain-name xxx --id 5 ''', ) - def add_rr(self): + def update_domain(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.AddRRRequest import AddRRRequest + from jdcloud_sdk.services.clouddnsservice.apis.UpdateDomainRequest import UpdateDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddRRRequest(params_dict, headers) + req = UpdateDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -397,29 +398,32 @@ def add_rr(self): arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), - (['--req'], dict(help="""(updateRR) updateRR参数 """, dest='req', required=True)), + (['--domain-name'], dict(help="""(string) 查询的主域名,,请使用getDomains接口获取 """, dest='domainName', required=True)), + (['--start'], dict(help="""(string) 查询时间段的起始时间, UTC时间,例如2017-11-10T23:00:00Z """, dest='start', required=True)), + (['--end'], dict(help="""(string) 查询时间段的终止时间, UTC时间,例如2017-11-10T23:00:00Z """, dest='end', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改主域名的某个解析记录 ''', + help=''' 查看主域名的解析次数 ''', description=''' - 修改主域名的某个解析记录。 + 查看主域名的解析次数。 - 示例: jdc clouddnsservice update-rr --domain-id xxx --req '{"":""}' + 示例: jdc clouddnsservice get-domain-query-count --domain-id xxx --domain-name xxx --start xxx --end xxx ''', ) - def update_rr(self): + def get_domain_query_count(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.UpdateRRRequest import UpdateRRRequest + from jdcloud_sdk.services.clouddnsservice.apis.GetDomainQueryCountRequest import GetDomainQueryCountRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateRRRequest(params_dict, headers) + req = GetDomainQueryCountRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -431,30 +435,32 @@ def update_rr(self): arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), - (['--ids'], dict(help="""(array: int) 需要操作的解析记录ID,请使用searchRR接口获取。 """, dest='ids', type=int, required=True)), - (['--action'], dict(help="""(string) 操作类型,on->启用 off->停用 del->删除 """, dest='action', required=True)), + (['--domain-name'], dict(help="""(string) 主域名,请使用getDomains接口获取 """, dest='domainName', required=True)), + (['--start'], dict(help="""(string) 时间段的起始时间, UTC时间,例如2017-11-10T23:00:00Z """, dest='start', required=True)), + (['--end'], dict(help="""(string) 时间段的终止时间, UTC时间,例如2017-11-10T23:00:00Z """, dest='end', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启用、停用、删除主域名下的解析记录 ''', + help=''' 查看域名的查询流量 ''', description=''' - 启用、停用、删除主域名下的解析记录。 + 查看域名的查询流量。 - 示例: jdc clouddnsservice operate-rr --domain-id xxx --ids [0] --action xxx + 示例: jdc clouddnsservice get-domain-query-traffic --domain-id xxx --domain-name xxx --start xxx --end xxx ''', ) - def operate_rr(self): + def get_domain_query_traffic(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.OperateRRRequest import OperateRRRequest + from jdcloud_sdk.services.clouddnsservice.apis.GetDomainQueryTrafficRequest import GetDomainQueryTrafficRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = OperateRRRequest(params_dict, headers) + req = GetDomainQueryTrafficRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -464,30 +470,37 @@ def operate_rr(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--req'], dict(help="""(array: batchSetDNS) 需要设置的解析记录列表 """, dest='req', required=True)), + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 分页参数,页的序号,默认是1 """, dest='pageNumber', type=int, required=True)), + (['--page-size'], dict(help="""(int) 分页参数,每页含有的结果的数目,默认是10 """, dest='pageSize', type=int, required=True)), + (['--start-time'], dict(help="""(string) 记录的起始时间,格式:UTC时间例如2017-11-10T23:00:00Z """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 记录的终止时间,格式:UTC时间例如2017-11-10T23:00:00Z """, dest='endTime', required=True)), + (['--key-word'], dict(help="""(string) 日志需要匹配的关键词 """, dest='keyWord', required=False)), + (['--success'], dict(help="""(bool) 日志里面的结果是成功还是失败 """, dest='success', type=bool, required=False)), + (['--type'], dict(help="""(int) 日志的类型 """, dest='type', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 同一个主域名下,批量新增或者批量更新导入解析记录。; 如果解析记录的ID为0,是新增解析记录,如果不为0,则是更新解析记录。; ''', + help=''' 查看用户在云解析服务下的操作记录 ''', description=''' - 同一个主域名下,批量新增或者批量更新导入解析记录。; 如果解析记录的ID为0,是新增解析记录,如果不为0,则是更新解析记录。; 。 + 查看用户在云解析服务下的操作记录。 - 示例: jdc clouddnsservice batch-set-dns-resolve --req ['{"":""}'] + 示例: jdc clouddnsservice get-action-log --page-number 5 --page-size 5 --start-time xxx --end-time xxx ''', ) - def batch_set_dns_resolve(self): + def get_action_log(self): client_factory = ClientFactory('clouddnsservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.clouddnsservice.apis.BatchSetDnsResolveRequest import BatchSetDnsResolveRequest + from jdcloud_sdk.services.clouddnsservice.apis.GetActionLogRequest import GetActionLogRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BatchSetDnsResolveRequest(params_dict, headers) + req = GetActionLogRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -500,6 +513,7 @@ def batch_set_dns_resolve(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--req'], dict(help="""(addView) 添加自定义线路的参数 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -533,6 +547,7 @@ def add_user_view(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--req'], dict(help="""(delView) 删除自定义线路的参数 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -570,6 +585,7 @@ def del_user_view(self): (['--page-number'], dict(help="""(int) 分页参数,页的序号 """, dest='pageNumber', type=int, required=True)), (['--page-size'], dict(help="""(int) 分页参数,每页含有的结果的数目 """, dest='pageSize', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -577,7 +593,7 @@ def del_user_view(self): description=''' 查询主域名的自定义解析线路。 - 示例: jdc clouddnsservice get-user-view --domain-id 0 --view-id 0 --page-number 0 --page-size 0 + 示例: jdc clouddnsservice get-user-view --domain-id 5 --view-id 5 --page-number 5 --page-size 5 ''', ) def get_user_view(self): @@ -603,6 +619,7 @@ def get_user_view(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--req'], dict(help="""(addViewIP) 添加域名的自定义解析线路的IP段的参数 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -636,6 +653,7 @@ def add_user_view_ip(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--req'], dict(help="""(delViewIP) 删除域名的自定义解析线路的IP段的参数 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -673,6 +691,7 @@ def del_user_view_ip(self): (['--page-number'], dict(help="""(int) 分页参数,页的序号, 默认为1 """, dest='pageNumber', type=int, required=True)), (['--page-size'], dict(help="""(int) 分页参数,每页含有的结果的数目,默认为10 """, dest='pageSize', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -680,7 +699,7 @@ def del_user_view_ip(self): description=''' 查询主域名的自定义解析线路的IP段。 - 示例: jdc clouddnsservice get-user-view-ip --domain-id 0 --view-id 0 --page-number 0 --page-size 0 + 示例: jdc clouddnsservice get-user-view-ip --domain-id 5 --view-id 5 --page-number 5 --page-size 5 ''', ) def get_user_view_ip(self): @@ -709,6 +728,7 @@ def get_user_view_ip(self): (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数 """, dest='pageSize', type=int, required=False)), (['--search-value'], dict(help="""(string) 查询的值 """, dest='searchValue', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -743,6 +763,7 @@ def get_monitor(self): (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), (['--sub-domain-name'], dict(help="""(string) 子域名 """, dest='subDomainName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -777,6 +798,7 @@ def add_monitor(self): (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), (['--sub-domain-name'], dict(help="""(string) 子域名 """, dest='subDomainName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -812,6 +834,7 @@ def get_targets(self): (['--sub-domain-name'], dict(help="""(string) 子域名 """, dest='subDomainName', required=True)), (['--targets'], dict(help="""(array: string) 子域名可用监控对象的数组 """, dest='targets', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -848,6 +871,7 @@ def add_monitor_target(self): (['--ids'], dict(help="""(array: int) 监控项ID """, dest='ids', type=int, required=True)), (['--switch-target'], dict(help="""(string) 监控项的主机值, 手动切换时必填 """, dest='switchTarget', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -855,7 +879,7 @@ def add_monitor_target(self): description=''' 监控项的操作集合,包括:删除,暂停,启动, 手动恢复, 手动切换。 - 示例: jdc clouddnsservice operate-monitor --domain-id xxx --action xxx --ids [0] + 示例: jdc clouddnsservice operate-monitor --domain-id xxx --action xxx --ids [5] ''', ) def operate_monitor(self): @@ -882,6 +906,7 @@ def operate_monitor(self): (['--domain-id'], dict(help="""(string) 域名ID,请使用getDomains接口获取。 """, dest='domainId', required=True)), (['--update-monitor'], dict(help="""(updateMonitor) 监控项设置信息 """, dest='updateMonitor', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -918,6 +943,7 @@ def update_monitor(self): (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数 """, dest='pageSize', type=int, required=False)), (['--search-value'], dict(help="""(string) 关键字 """, dest='searchValue', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -948,7 +974,7 @@ def get_monitor_alarm_info(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['get-action-log','get-domains','add-domain','del-domain','update-domain','get-domain-query-count','get-domain-query-traffic','search-rr','get-view-tree','add-rr','update-rr','operate-rr','batch-set-dns-resolve','add-user-view','del-user-view','get-user-view','add-user-view-ip','del-user-view-ip','get-user-view-ip','get-monitor','add-monitor','get-targets','add-monitor-target','operate-monitor','update-monitor','get-monitor-alarm-info',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['search-rr','get-view-tree','add-rr','update-rr','operate-rr','batch-set-dns-resolve','get-domains','add-domain','del-domain','update-domain','get-domain-query-count','get-domain-query-traffic','get-action-log','add-user-view','del-user-view','get-user-view','add-user-view-ip','del-user-view-ip','get-user-view-ip','get-monitor','add-monitor','get-targets','add-monitor-target','operate-monitor','update-monitor','get-monitor-alarm-info',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/containerregistry.py b/jdcloud_cli/controllers/services/containerregistry.py index 6fbb3c5..f6a7a66 100644 --- a/jdcloud_cli/controllers/services/containerregistry.py +++ b/jdcloud_cli/controllers/services/containerregistry.py @@ -38,31 +38,33 @@ class Meta: @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--expired-after-hours'], dict(help="""(int) issue新token的过期时间, 可选参数为新生成令牌的过期时间,最大值为24小时,最小值为1小时,为空则默认为12小时过期时间。; """, dest='expiredAfterHours', type=int, required=False)), + (['--repository-name'], dict(help="""(string) 镜像仓库名称。; 可以专有模式如默认命名空间nginx-web-app;或者和命名空间一起将多个仓库聚集在一起如 project-a/nginx-web-app。; """, dest='repositoryName', required=True)), + (['--description'], dict(help="""(string) 注册表描述,参考公共参数规范。; """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help='''

申请12小时有效期的令牌。 使用docker CLI push和pull镜像。

;

authorizationToken为每个registry返回一个base64编码的字符串,解码后docker login命令; 可完成指定registry的鉴权。JCR CLI提供jcr get-login进行认证处理。

; ''', + help=''' 通过参数创建镜像仓库。; 仓库名称可以分解为多个路径名,每个名称必须至少包含一个小写字母数字,考虑URL规范。; 支持包含段划线或者下划线进行分割,但不允许点'.',多个路径名之间通过("/")连接,总长度不超过256个字符,当前只支持二级目录。; ''', description=''' -

申请12小时有效期的令牌。 使用docker CLI push和pull镜像。

;

authorizationToken为每个registry返回一个base64编码的字符串,解码后docker login命令; 可完成指定registry的鉴权。JCR CLI提供jcr get-login进行认证处理。

; 。 + 通过参数创建镜像仓库。; 仓库名称可以分解为多个路径名,每个名称必须至少包含一个小写字母数字,考虑URL规范。; 支持包含段划线或者下划线进行分割,但不允许点'.',多个路径名之间通过("/")连接,总长度不超过256个字符,当前只支持二级目录。; 。 - 示例: jdc containerregistry get-authorization-token --registry-name xxx + 示例: jdc containerregistry create-repository --registry-name xxx --repository-name xxx ''', ) - def get_authorization_token(self): + def create_repository(self): client_factory = ClientFactory('containerregistry') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.containerregistry.apis.GetAuthorizationTokenRequest import GetAuthorizationTokenRequest + from jdcloud_sdk.services.containerregistry.apis.CreateRepositoryRequest import CreateRepositoryRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetAuthorizationTokenRequest(params_dict, headers) + req = CreateRepositoryRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -72,33 +74,34 @@ def get_authorization_token(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--filters'], dict(help="""(array: filter) token - 令牌 ID,支持多个; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--filters'], dict(help="""(array: filter) name - 仓库名称,模糊匹配,支持单个; """, dest='filters', required=False)), + (['--registry-name'], dict(help="""(string) 注册表名 """, dest='registryName', required=False)), (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help='''

批量查询令牌。

;

暂时不支持分页和过滤条件。

; ''', + help=''' 描述用户指定 registry 下的 repository.; ''', description=''' -

批量查询令牌。

;

暂时不支持分页和过滤条件。

; 。 + 描述用户指定 registry 下的 repository.; 。 - 示例: jdc containerregistry describe-authorization-tokens --registry-name xxx + 示例: jdc containerregistry describe-repositories ''', ) - def describe_authorization_tokens(self): + def describe_repositories(self): client_factory = ClientFactory('containerregistry') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.containerregistry.apis.DescribeAuthorizationTokensRequest import DescribeAuthorizationTokensRequest + from jdcloud_sdk.services.containerregistry.apis.DescribeRepositoriesRequest import DescribeRepositoriesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAuthorizationTokensRequest(params_dict, headers) + req = DescribeRepositoriesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -108,32 +111,33 @@ def describe_authorization_tokens(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--authorization-token'], dict(help="""(string) 准备释放的 token ID,功能为指定token释放。 """, dest='authorizationToken', required=False)), - (['--force-all'], dict(help="""(bool) true 表示强制删除用户当前registry下所有有效token的标志;false 表示删除所有有效token。 """, dest='forceAll', required=False)), + (['--repository-name'], dict(help="""(string) 镜像仓库名称 """, dest='repositoryName', required=True)), + (['--force'], dict(help="""(bool) 是否强制删除有镜像的镜像仓库 """, dest='force', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 释放用户 registry 的 token。; ''', + help=''' 删除指定用户下某个镜像仓库.; [MFA enabled] ''', description=''' - 释放用户 registry 的 token。; 。 + 删除指定用户下某个镜像仓库.; [MFA enabled]。 - 示例: jdc containerregistry release-authorization-token --registry-name xxx + 示例: jdc containerregistry delete-repository --registry-name xxx --repository-name xxx ''', ) - def release_authorization_token(self): + def delete_repository(self): client_factory = ClientFactory('containerregistry') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.containerregistry.apis.ReleaseAuthorizationTokenRequest import ReleaseAuthorizationTokenRequest + from jdcloud_sdk.services.containerregistry.apis.DeleteRepositoryRequest import DeleteRepositoryRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ReleaseAuthorizationTokenRequest(params_dict, headers) + req = DeleteRepositoryRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -144,31 +148,31 @@ def release_authorization_token(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--filters'], dict(help="""(array: filter) registryName - 镜像仓储名称 ; repositoryName - 镜像库名称 ; imageDigest - 镜像哈希值 ; imageTag - 镜像标签 ; tagStatus - 打标TAGGED或没打标UNTAGGED ; """, dest='filters', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--registry-name'], dict(help="""(string) 注册表名。 """, dest='registryName', required=True)), + (['--repository-name'], dict(help="""(string) 待验证的镜像仓库名。 """, dest='repositoryName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 返回指定repository中images的元数据,包括image size, image tags和creation date。; ''', + help=''' 查询指定镜像仓库名称是否已经存在以及是否符合命名规范。; ''', description=''' - 返回指定repository中images的元数据,包括image size, image tags和creation date。; 。 + 查询指定镜像仓库名称是否已经存在以及是否符合命名规范。; 。 - 示例: jdc containerregistry describe-images + 示例: jdc containerregistry check-repository-name --registry-name xxx --repository-name xxx ''', ) - def describe_images(self): + def check_repository_name(self): client_factory = ClientFactory('containerregistry') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.containerregistry.apis.DescribeImagesRequest import DescribeImagesRequest + from jdcloud_sdk.services.containerregistry.apis.CheckRepositoryNameRequest import CheckRepositoryNameRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeImagesRequest(params_dict, headers) + req = CheckRepositoryNameRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -179,33 +183,32 @@ def describe_images(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--repository-name'], dict(help="""(string) 镜像仓库表名称 """, dest='repositoryName', required=True)), - (['--image-digest'], dict(help="""(string) sha256哈希,image manifest的digest. """, dest='imageDigest', required=False)), - (['--image-tag'], dict(help="""(string) image使用的tag """, dest='imageTag', required=False)), - (['--image-tag-status'], dict(help="""(string) 枚举中的一个值,如 tagged 和 untagged. """, dest='imageTagStatus', required=False)), + (['--filters'], dict(help="""(array: filter) registryName - 镜像仓储名称 ; repositoryName - 镜像库名称 ; imageDigest - 镜像哈希值 ; imageTag - 镜像标签 ; tagStatus - 打标TAGGED或没打标UNTAGGED ; """, dest='filters', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除镜像; imageDigest imageTag imageTagStatus 三者只能且必须传一个。; 可根据Tag状态删除Image,例如删除所有tagged的镜像。; digest和tag唯一表征单个镜像,其中imageDigest为sha256哈希,image manifest的digest。; 例如 sha256:examplee6d1e504117a17000003d3753086354a38375961f2e665416ef4b1b2f;image使用的tag, 如 "precise" ; [MFA enabled] ''', + help=''' 返回指定repository中images的元数据,包括image size, image tags和creation date。; ''', description=''' - 删除镜像; imageDigest imageTag imageTagStatus 三者只能且必须传一个。; 可根据Tag状态删除Image,例如删除所有tagged的镜像。; digest和tag唯一表征单个镜像,其中imageDigest为sha256哈希,image manifest的digest。; 例如 sha256:examplee6d1e504117a17000003d3753086354a38375961f2e665416ef4b1b2f;image使用的tag, 如 "precise" ; [MFA enabled]。 + 返回指定repository中images的元数据,包括image size, image tags和creation date。; 。 - 示例: jdc containerregistry delete-image --registry-name xxx --repository-name xxx + 示例: jdc containerregistry describe-images ''', ) - def delete_image(self): + def describe_images(self): client_factory = ClientFactory('containerregistry') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.containerregistry.apis.DeleteImageRequest import DeleteImageRequest + from jdcloud_sdk.services.containerregistry.apis.DescribeImagesRequest import DescribeImagesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteImageRequest(params_dict, headers) + req = DescribeImagesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -216,29 +219,34 @@ def delete_image(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--filters'], dict(help="""(array: filter) resourceTypes - 资源类型,暂时只支持 [registry, repository],支持同时查询两种配额。; """, dest='filters', required=False)), + (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), + (['--repository-name'], dict(help="""(string) 镜像仓库表名称 """, dest='repositoryName', required=True)), + (['--image-digest'], dict(help="""(string) sha256哈希,image manifest的digest. """, dest='imageDigest', required=False)), + (['--image-tag'], dict(help="""(string) image使用的tag """, dest='imageTag', required=False)), + (['--image-tag-status'], dict(help="""(string) 枚举中的一个值,如 tagged 和 untagged. """, dest='imageTagStatus', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询配额 ''', + help=''' 删除镜像; imageDigest imageTag imageTagStatus 三者只能且必须传一个。; 可根据Tag状态删除Image,例如删除所有tagged的镜像。; digest和tag唯一表征单个镜像,其中imageDigest为sha256哈希,image manifest的digest。; 例如 sha256:examplee6d1e504117a17000003d3753086354a38375961f2e665416ef4b1b2f;image使用的tag, 如 "precise" ; [MFA enabled] ''', description=''' - 查询配额。 + 删除镜像; imageDigest imageTag imageTagStatus 三者只能且必须传一个。; 可根据Tag状态删除Image,例如删除所有tagged的镜像。; digest和tag唯一表征单个镜像,其中imageDigest为sha256哈希,image manifest的digest。; 例如 sha256:examplee6d1e504117a17000003d3753086354a38375961f2e665416ef4b1b2f;image使用的tag, 如 "precise" ; [MFA enabled]。 - 示例: jdc containerregistry describe-quotas + 示例: jdc containerregistry delete-image --registry-name xxx --repository-name xxx ''', ) - def describe_quotas(self): + def delete_image(self): client_factory = ClientFactory('containerregistry') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.containerregistry.apis.DescribeQuotasRequest import DescribeQuotasRequest + from jdcloud_sdk.services.containerregistry.apis.DeleteImageRequest import DeleteImageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeQuotasRequest(params_dict, headers) + req = DeleteImageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -250,6 +258,7 @@ def describe_quotas(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -284,6 +293,7 @@ def describe_registries(self): (['--registry-name'], dict(help="""(string) 用户定义的registry名称。
DNS兼容registry名称规则如下:;
不可为空,且不能超过32字符
以小写字母开始和结尾,支持使用小写字母、数字、中划线(-); """, dest='registryName', required=True)), (['--description'], dict(help="""(string) 注册表描述,参考公共参数规范。; """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -317,6 +327,7 @@ def create_registry(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -350,6 +361,7 @@ def describe_registry(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -383,6 +395,7 @@ def delete_registry(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--registry-name'], dict(help="""(string) 待验证的注册表名。 """, dest='registryName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -414,31 +427,30 @@ def check_registry_name(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--repository-name'], dict(help="""(string) 镜像仓库名称。; 可以专有模式如默认命名空间nginx-web-app;或者和命名空间一起将多个仓库聚集在一起如 project-a/nginx-web-app。; """, dest='repositoryName', required=True)), - (['--description'], dict(help="""(string) 注册表描述,参考公共参数规范。; """, dest='description', required=False)), + (['--filters'], dict(help="""(array: filter) resourceTypes - 资源类型,暂时只支持 [registry, repository],支持同时查询两种配额。; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 通过参数创建镜像仓库。; 仓库名称可以分解为多个路径名,每个名称必须至少包含一个小写字母数字,考虑URL规范。; 支持包含段划线或者下划线进行分割,但不允许点'.',多个路径名之间通过("/")连接,总长度不超过256个字符,当前只支持二级目录。; ''', + help=''' 查询配额 ''', description=''' - 通过参数创建镜像仓库。; 仓库名称可以分解为多个路径名,每个名称必须至少包含一个小写字母数字,考虑URL规范。; 支持包含段划线或者下划线进行分割,但不允许点'.',多个路径名之间通过("/")连接,总长度不超过256个字符,当前只支持二级目录。; 。 + 查询配额。 - 示例: jdc containerregistry create-repository --registry-name xxx --repository-name xxx + 示例: jdc containerregistry describe-quotas ''', ) - def create_repository(self): + def describe_quotas(self): client_factory = ClientFactory('containerregistry') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.containerregistry.apis.CreateRepositoryRequest import CreateRepositoryRequest + from jdcloud_sdk.services.containerregistry.apis.DescribeQuotasRequest import DescribeQuotasRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateRepositoryRequest(params_dict, headers) + req = DescribeQuotasRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -448,33 +460,32 @@ def create_repository(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--filters'], dict(help="""(array: filter) name - 仓库名称,模糊匹配,支持单个; """, dest='filters', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名 """, dest='registryName', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), + (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), + (['--expired-after-hours'], dict(help="""(int) issue新token的过期时间, 可选参数为新生成令牌的过期时间,最大值为24小时,最小值为1小时,为空则默认为12小时过期时间。; """, dest='expiredAfterHours', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 描述用户指定 registry 下的 repository.; ''', + help='''

申请12小时有效期的令牌。 使用docker CLI push和pull镜像。

;

authorizationToken为每个registry返回一个base64编码的字符串,解码后docker login命令; 可完成指定registry的鉴权。JCR CLI提供jcr get-login进行认证处理。

; ''', description=''' - 描述用户指定 registry 下的 repository.; 。 +

申请12小时有效期的令牌。 使用docker CLI push和pull镜像。

;

authorizationToken为每个registry返回一个base64编码的字符串,解码后docker login命令; 可完成指定registry的鉴权。JCR CLI提供jcr get-login进行认证处理。

; 。 - 示例: jdc containerregistry describe-repositories + 示例: jdc containerregistry get-authorization-token --registry-name xxx ''', ) - def describe_repositories(self): + def get_authorization_token(self): client_factory = ClientFactory('containerregistry') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.containerregistry.apis.DescribeRepositoriesRequest import DescribeRepositoriesRequest + from jdcloud_sdk.services.containerregistry.apis.GetAuthorizationTokenRequest import GetAuthorizationTokenRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeRepositoriesRequest(params_dict, headers) + req = GetAuthorizationTokenRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -484,32 +495,34 @@ def describe_repositories(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--repository-name'], dict(help="""(string) 镜像仓库名称 """, dest='repositoryName', required=True)), - (['--force'], dict(help="""(bool) 是否强制删除有镜像的镜像仓库 """, dest='force', required=False)), + (['--filters'], dict(help="""(array: filter) token - 令牌 ID,支持多个; """, dest='filters', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除指定用户下某个镜像仓库.; [MFA enabled] ''', + help='''

批量查询令牌。

;

暂时不支持分页和过滤条件。

; ''', description=''' - 删除指定用户下某个镜像仓库.; [MFA enabled]。 +

批量查询令牌。

;

暂时不支持分页和过滤条件。

; 。 - 示例: jdc containerregistry delete-repository --registry-name xxx --repository-name xxx + 示例: jdc containerregistry describe-authorization-tokens --registry-name xxx ''', ) - def delete_repository(self): + def describe_authorization_tokens(self): client_factory = ClientFactory('containerregistry') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.containerregistry.apis.DeleteRepositoryRequest import DeleteRepositoryRequest + from jdcloud_sdk.services.containerregistry.apis.DescribeAuthorizationTokensRequest import DescribeAuthorizationTokensRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteRepositoryRequest(params_dict, headers) + req = DescribeAuthorizationTokensRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -519,31 +532,33 @@ def delete_repository(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名。 """, dest='registryName', required=True)), - (['--repository-name'], dict(help="""(string) 待验证的镜像仓库名。 """, dest='repositoryName', required=True)), + (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), + (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), + (['--authorization-token'], dict(help="""(string) 准备释放的 token ID,功能为指定token释放。 """, dest='authorizationToken', required=False)), + (['--force-all'], dict(help="""(bool) true 表示强制删除用户当前registry下所有有效token的标志;false 表示删除所有有效token。 """, dest='forceAll', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询指定镜像仓库名称是否已经存在以及是否符合命名规范。; ''', + help=''' 释放用户 registry 的 token。; ''', description=''' - 查询指定镜像仓库名称是否已经存在以及是否符合命名规范。; 。 + 释放用户 registry 的 token。; 。 - 示例: jdc containerregistry check-repository-name --registry-name xxx --repository-name xxx + 示例: jdc containerregistry release-authorization-token --registry-name xxx ''', ) - def check_repository_name(self): + def release_authorization_token(self): client_factory = ClientFactory('containerregistry') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.containerregistry.apis.CheckRepositoryNameRequest import CheckRepositoryNameRequest + from jdcloud_sdk.services.containerregistry.apis.ReleaseAuthorizationTokenRequest import ReleaseAuthorizationTokenRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CheckRepositoryNameRequest(params_dict, headers) + req = ReleaseAuthorizationTokenRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -553,7 +568,7 @@ def check_repository_name(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['get-authorization-token','describe-authorization-tokens','release-authorization-token','describe-images','delete-image','describe-quotas','describe-registries','create-registry','describe-registry','delete-registry','check-registry-name','create-repository','describe-repositories','delete-repository','check-repository-name',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['create-repository','describe-repositories','delete-repository','check-repository-name','describe-images','delete-image','describe-registries','create-registry','describe-registry','delete-registry','check-registry-name','describe-quotas','get-authorization-token','describe-authorization-tokens','release-authorization-token',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/cps.py b/jdcloud_cli/controllers/services/cps.py index 947007b..59b3308 100644 --- a/jdcloud_cli/controllers/services/cps.py +++ b/jdcloud_cli/controllers/services/cps.py @@ -39,33 +39,30 @@ class Meta: @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), - (['--status'], dict(help="""(string) 弹性公网IP状态,取值范围:associate、disassociate """, dest='status', required=False)), - (['--include-lb'], dict(help="""(string) 是否包含负载均衡 """, dest='includeLB', required=False)), - (['--filters'], dict(help="""(array: filter) elasticIpId - 弹性公网IPID,精确匹配,支持多个
; elasticIp - 弹性公网IP,精确匹配,支持多个; """, dest='filters', required=False)), + (['--ipv6address-id'], dict(help="""(string) IPv6地址ID """, dest='ipv6AddressId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询弹性公网IP列表
; 支持分页查询,默认每页20条
; ''', + help=''' 查询IPv6地址例详情 ''', description=''' - 查询弹性公网IP列表
; 支持分页查询,默认每页20条
; 。 + 查询IPv6地址例详情。 - 示例: jdc cps describe-elastic-ips + 示例: jdc cps describe-ipv6address --ipv6address-id xxx ''', ) - def describe_elastic_ips(self): + def describe_ipv6address(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeElasticIpsRequest import DescribeElasticIpsRequest + from jdcloud_sdk.services.cps.apis.DescribeIpv6AddressRequest import DescribeIpv6AddressRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeElasticIpsRequest(params_dict, headers) + req = DescribeIpv6AddressRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -76,30 +73,35 @@ def describe_elastic_ips(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--elastic-ip-spec'], dict(help="""(elasticIpSpec) 弹性公网IP配置 """, dest='elasticIpSpec', required=True)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--ipv6gateway-id'], dict(help="""(string) IPv6网关ID """, dest='ipv6GatewayId', required=False)), + (['--ipv6address'], dict(help="""(string) IPv6地址 """, dest='ipv6Address', required=False)), + (['--enable-internet'], dict(help="""(bool) 是否已开通公网 """, dest='enableInternet', type=bool, required=False)), + (['--filters'], dict(help="""(array: filter) ipv6AddressId - IPv6地址ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 申请弹性公网IP; ''', + help=''' 查询IPv6地址列表
; 支持分页查询,默认每页20条
; ''', description=''' - 申请弹性公网IP; 。 + 查询IPv6地址列表
; 支持分页查询,默认每页20条
; 。 - 示例: jdc cps apply-elastic-ips --elastic-ip-spec '{"":""}' + 示例: jdc cps describe-ipv6addresses ''', ) - def apply_elastic_ips(self): + def describe_ipv6addresses(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.ApplyElasticIpsRequest import ApplyElasticIpsRequest + from jdcloud_sdk.services.cps.apis.DescribeIpv6AddressesRequest import DescribeIpv6AddressesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ApplyElasticIpsRequest(params_dict, headers) + req = DescribeIpv6AddressesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -110,29 +112,31 @@ def apply_elastic_ips(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--elastic-ip-id'], dict(help="""(string) 弹性公网IPID """, dest='elasticIpId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--ipv6address-spec'], dict(help="""(ipv6AddressSpec) IPv6地址配置 """, dest='ipv6AddressSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询弹性公网IP详情 ''', + help=''' 申请IPv6地址带宽; ''', description=''' - 查询弹性公网IP详情。 + 申请IPv6地址带宽; 。 - 示例: jdc cps describe-elastic-ip --elastic-ip-id xxx + 示例: jdc cps assign-ipv6addresses-bandwidth --ipv6address-spec '{"":""}' ''', ) - def describe_elastic_ip(self): + def assign_ipv6addresses_bandwidth(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeElasticIpRequest import DescribeElasticIpRequest + from jdcloud_sdk.services.cps.apis.AssignIpv6AddressesBandwidthRequest import AssignIpv6AddressesBandwidthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeElasticIpRequest(params_dict, headers) + req = AssignIpv6AddressesBandwidthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -143,31 +147,32 @@ def describe_elastic_ip(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--elastic-ip-id'], dict(help="""(string) 弹性公网IPID """, dest='elasticIpId', required=True)), + (['--ipv6address-id'], dict(help="""(string) IPv6地址ID """, dest='ipv6AddressId', required=True)), (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), (['--bandwidth'], dict(help="""(int) 带宽,单位Mbps,取值范围[1,200] """, dest='bandwidth', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改弹性公网IP带宽; ''', + help=''' 修改IPv6公网带宽; ''', description=''' - 修改弹性公网IP带宽; 。 + 修改IPv6公网带宽; 。 - 示例: jdc cps modify-elastic-ip-bandwidth --elastic-ip-id xxx --bandwidth 0 + 示例: jdc cps modify-ipv6address-bandwidth --ipv6address-id xxx --bandwidth 5 ''', ) - def modify_elastic_ip_bandwidth(self): + def modify_ipv6address_bandwidth(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.ModifyElasticIpBandwidthRequest import ModifyElasticIpBandwidthRequest + from jdcloud_sdk.services.cps.apis.ModifyIpv6AddressBandwidthRequest import ModifyIpv6AddressBandwidthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyElasticIpBandwidthRequest(params_dict, headers) + req = ModifyIpv6AddressBandwidthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -178,29 +183,33 @@ def modify_elastic_ip_bandwidth(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--az'], dict(help="""(string) 可用区,精确匹配 """, dest='az', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--name'], dict(help="""(string) 证书名称 """, dest='name', required=False)), + (['--filters'], dict(help="""(array: filter) certId - 证书ID,精确匹配,支持多个
; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询云物理服务器实例类型 ''', + help=''' 查询证书列表
; 支持分页查询,默认每页20条
; ''', description=''' - 查询云物理服务器实例类型。 + 查询证书列表
; 支持分页查询,默认每页20条
; 。 - 示例: jdc cps describe-device-types + 示例: jdc cps describe-certs ''', ) - def describe_device_types(self): + def describe_certs(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeDeviceTypesRequest import DescribeDeviceTypesRequest + from jdcloud_sdk.services.cps.apis.DescribeCertsRequest import DescribeCertsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDeviceTypesRequest(params_dict, headers) + req = DescribeCertsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -211,30 +220,31 @@ def describe_device_types(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--device-type'], dict(help="""(string) 实例类型,可调用接口(describeDeviceTypes)获取指定地域的实例类型,例如:cps.c.normal """, dest='deviceType', required=True)), - (['--os-type'], dict(help="""(string) 操作系统类型,取值范围:CentOS、Ubuntu """, dest='osType', required=False)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--cert-spec'], dict(help="""(certSpec) 弹性公网IP配置 """, dest='certSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询云物理服务器支持的操作系统 ''', + help=''' 创建证书; ''', description=''' - 查询云物理服务器支持的操作系统。 + 创建证书; 。 - 示例: jdc cps describe-os --device-type xxx + 示例: jdc cps create-cert --cert-spec '{"":""}' ''', ) - def describe_os(self): + def create_cert(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeOSRequest import DescribeOSRequest + from jdcloud_sdk.services.cps.apis.CreateCertRequest import CreateCertRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeOSRequest(params_dict, headers) + req = CreateCertRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -245,30 +255,30 @@ def describe_os(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--device-type'], dict(help="""(string) 实例类型,可调用(describeDeviceTypes)接口获取指定地域的实例类型,例如:cps.c.normal """, dest='deviceType', required=True)), - (['--volume-type'], dict(help="""(string) 磁盘类型,取值范围:system、data """, dest='volumeType', required=False)), + (['--cert-id'], dict(help="""(string) 证书ID """, dest='certId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询某种实例类型的云物理服务器支持的RAID类型,可查询系统盘RAID类型和数据盘RAID类型 ''', + help=''' 查询证书详情 ''', description=''' - 查询某种实例类型的云物理服务器支持的RAID类型,可查询系统盘RAID类型和数据盘RAID类型。 + 查询证书详情。 - 示例: jdc cps describe-device-raids --device-type xxx + 示例: jdc cps describe-cert --cert-id xxx ''', ) - def describe_device_raids(self): + def describe_cert(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeDeviceRaidsRequest import DescribeDeviceRaidsRequest + from jdcloud_sdk.services.cps.apis.DescribeCertRequest import DescribeCertRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDeviceRaidsRequest(params_dict, headers) + req = DescribeCertRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -279,29 +289,30 @@ def describe_device_raids(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--cert-id'], dict(help="""(string) 证书ID """, dest='certId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单台云物理服务器详细信息 ''', + help=''' 删除证书 ''', description=''' - 查询单台云物理服务器详细信息。 + 删除证书。 - 示例: jdc cps describe-instance --instance-id xxx + 示例: jdc cps remove-cert --cert-id xxx ''', ) - def describe_instance(self): + def remove_cert(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeInstanceRequest import DescribeInstanceRequest + from jdcloud_sdk.services.cps.apis.RemoveCertRequest import RemoveCertRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceRequest(params_dict, headers) + req = RemoveCertRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -312,39 +323,31 @@ def describe_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), - (['--az'], dict(help="""(string) 可用区,精确匹配 """, dest='az', required=False)), - (['--name'], dict(help="""(string) 云物理服务器名称,支持模糊匹配 """, dest='name', required=False)), - (['--network-type'], dict(help="""(string) 网络类型,精确匹配,支持basic,vpc """, dest='networkType', required=False)), - (['--device-type'], dict(help="""(string) 实例类型,精确匹配,调用接口(describeDeviceTypes)获取实例类型 """, dest='deviceType', required=False)), - (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=False)), - (['--keypair-id'], dict(help="""(string) 密钥对ID """, dest='keypairId', required=False)), - (['--enable-internet'], dict(help="""(string) 是否启用外网, yes/no """, dest='enableInternet', required=False)), - (['--private-ip'], dict(help="""(string) 内网ip """, dest='privateIp', required=False)), - (['--filters'], dict(help="""(array: filter) instanceId - 云物理服务器ID,精确匹配,支持多个
; status - 云物理服务器状态,参考云物理服务器状态,精确匹配,支持多个; """, dest='filters', required=False)), + (['--cert-id'], dict(help="""(string) 证书ID """, dest='certId', required=True)), + (['--name'], dict(help="""(string) 证书名称 """, dest='name', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量查询云物理服务器详细信息
; 支持分页查询,默认每页20条
; ''', + help=''' 修改证书名称 ''', description=''' - 批量查询云物理服务器详细信息
; 支持分页查询,默认每页20条
; 。 + 修改证书名称。 - 示例: jdc cps describe-instances + 示例: jdc cps modify-cert --cert-id xxx ''', ) - def describe_instances(self): + def modify_cert(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeInstancesRequest import DescribeInstancesRequest + from jdcloud_sdk.services.cps.apis.ModifyCertRequest import ModifyCertRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstancesRequest(params_dict, headers) + req = ModifyCertRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -354,31 +357,36 @@ def describe_instances(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--instance-spec'], dict(help="""(instanceSpec) 描述云物理服务器配置 """, dest='instanceSpec', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=False)), + (['--instance-id'], dict(help="""(string) 实例ID """, dest='instanceId', required=False)), + (['--cidr'], dict(help="""(string) CIDR段,模糊搜索 """, dest='cidr', required=False)), + (['--filters'], dict(help="""(array: filter) aliasIpId - 别名IP id
; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一台或多台指定配置的云物理服务器
; - 地域与可用区
; - 调用接口(describeRegiones)获取云物理服务器支持的地域与可用区
; - 实例类型
; - 调用接口(describeDeviceTypes)获取物理实例类型列表
; - 不能使用已下线、或已售馨的实例类型
; - 操作系统
; - 可调用接口(describeOS)获取云物理服务器支持的操作系统列表
; - 存储
; - 数据盘多种RAID可选,可调用接口(describeDeviceRaids)获取服务器支持的RAID列表
; - 网络
; - 网络类型目前支持basic、vpc
; - 线路目前只支持bgp
; - 支持不启用外网,如果启用外网,带宽范围[1,200] 单位Mbps
; - 其他
; - 购买时长,可按年或月购买:月取值范围[1,9], 年取值范围[1,3]
; - 密码设置参考公共参数规范
; ''', + help=''' 查询别名IP列表 ''', description=''' - 创建一台或多台指定配置的云物理服务器
; - 地域与可用区
; - 调用接口(describeRegiones)获取云物理服务器支持的地域与可用区
; - 实例类型
; - 调用接口(describeDeviceTypes)获取物理实例类型列表
; - 不能使用已下线、或已售馨的实例类型
; - 操作系统
; - 可调用接口(describeOS)获取云物理服务器支持的操作系统列表
; - 存储
; - 数据盘多种RAID可选,可调用接口(describeDeviceRaids)获取服务器支持的RAID列表
; - 网络
; - 网络类型目前支持basic、vpc
; - 线路目前只支持bgp
; - 支持不启用外网,如果启用外网,带宽范围[1,200] 单位Mbps
; - 其他
; - 购买时长,可按年或月购买:月取值范围[1,9], 年取值范围[1,3]
; - 密码设置参考公共参数规范
; 。 + 查询别名IP列表。 - 示例: jdc cps create-instances --instance-spec '{"":""}' + 示例: jdc cps describe-alias-ips ''', ) - def create_instances(self): + def describe_alias_ips(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.CreateInstancesRequest import CreateInstancesRequest + from jdcloud_sdk.services.cps.apis.DescribeAliasIpsRequest import DescribeAliasIpsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateInstancesRequest(params_dict, headers) + req = DescribeAliasIpsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -388,30 +396,32 @@ def create_instances(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--alias-ip-spec'], dict(help="""(aliasIpSpec) 别名IP配置 """, dest='aliasIpSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询云物理服务器名称 ''', + help=''' 添加别名IP ''', description=''' - 查询云物理服务器名称。 + 添加别名IP。 - 示例: jdc cps describe-instance-name --instance-id xxx + 示例: jdc cps create-alias-ip --alias-ip-spec '{"":""}' ''', ) - def describe_instance_name(self): + def create_alias_ip(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeInstanceNameRequest import DescribeInstanceNameRequest + from jdcloud_sdk.services.cps.apis.CreateAliasIpRequest import CreateAliasIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceNameRequest(params_dict, headers) + req = CreateAliasIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -421,32 +431,32 @@ def describe_instance_name(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), - (['--name'], dict(help="""(string) 云物理服务器名称 """, dest='name', required=False)), - (['--description'], dict(help="""(string) 云物理服务器描述 """, dest='description', required=False)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--alias-ip-id'], dict(help="""(string) 别名IP ID """, dest='aliasIpId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改云物理服务器部分信息,包括名称、描述 ''', + help=''' 删除别名IP ''', description=''' - 修改云物理服务器部分信息,包括名称、描述。 + 删除别名IP。 - 示例: jdc cps modify-instance --instance-id xxx + 示例: jdc cps delete-alias-ip --alias-ip-id xxx ''', ) - def modify_instance(self): + def delete_alias_ip(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.ModifyInstanceRequest import ModifyInstanceRequest + from jdcloud_sdk.services.cps.apis.DeleteAliasIpRequest import DeleteAliasIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyInstanceRequest(params_dict, headers) + req = DeleteAliasIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -456,30 +466,31 @@ def modify_instance(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个云物理服务器已安装的RAID信息,包括系统盘RAID信息和数据盘RAID信息 ''', + help=''' 查询次要CIDR列表 ''', description=''' - 查询单个云物理服务器已安装的RAID信息,包括系统盘RAID信息和数据盘RAID信息。 + 查询次要CIDR列表。 - 示例: jdc cps describe-instance-raid --instance-id xxx + 示例: jdc cps describe-secondary-cidrs --subnet-id xxx ''', ) - def describe_instance_raid(self): + def describe_secondary_cidrs(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeInstanceRaidRequest import DescribeInstanceRaidRequest + from jdcloud_sdk.services.cps.apis.DescribeSecondaryCidrsRequest import DescribeSecondaryCidrsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceRaidRequest(params_dict, headers) + req = DescribeSecondaryCidrsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -489,30 +500,32 @@ def describe_instance_raid(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--secondary-cidr-spec'], dict(help="""(secondaryCidrSpec) 次要cidr配置 """, dest='secondaryCidrSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个云物理服务器硬件监控信息 ''', + help=''' 添加次要CIDR ''', description=''' - 查询单个云物理服务器硬件监控信息。 + 添加次要CIDR。 - 示例: jdc cps describe-instance-status --instance-id xxx + 示例: jdc cps create-secondary-cidr --secondary-cidr-spec '{"":""}' ''', ) - def describe_instance_status(self): + def create_secondary_cidr(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeInstanceStatusRequest import DescribeInstanceStatusRequest + from jdcloud_sdk.services.cps.apis.CreateSecondaryCidrRequest import CreateSecondaryCidrRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceStatusRequest(params_dict, headers) + req = CreateSecondaryCidrRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -522,31 +535,32 @@ def describe_instance_status(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--secondary-cidr-id'], dict(help="""(string) 次要CIDR ID """, dest='secondaryCidrId', required=True)), (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 重启单台云物理服务器,只能重启running状态的服务器 [MFA enabled] ''', + help=''' 删除次要CIDR ''', description=''' - 重启单台云物理服务器,只能重启running状态的服务器 [MFA enabled]。 + 删除次要CIDR。 - 示例: jdc cps restart-instance --instance-id xxx + 示例: jdc cps delete-secondary-cidr --secondary-cidr-id xxx ''', ) - def restart_instance(self): + def delete_secondary_cidr(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.RestartInstanceRequest import RestartInstanceRequest + from jdcloud_sdk.services.cps.apis.DeleteSecondaryCidrRequest import DeleteSecondaryCidrRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RestartInstanceRequest(params_dict, headers) + req = DeleteSecondaryCidrRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -557,30 +571,37 @@ def restart_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--status'], dict(help="""(string) 弹性公网IP状态,取值范围:associate、disassociate """, dest='status', required=False)), + (['--include-lb'], dict(help="""(string) 是否包含负载均衡 """, dest='includeLB', required=False)), + (['--charge-mode'], dict(help="""(string) 支付模式,取值为:prepaid_by_duration表示预付费,postpaid_by_duration表示按配置后付费 """, dest='chargeMode', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=False)), + (['--subnet-id'], dict(help="""(string) 子网Id """, dest='subnetId', required=False)), + (['--filters'], dict(help="""(array: filter) elasticIpId - 弹性公网IPID,精确匹配,支持多个
; elasticIp - 弹性公网IP,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 对单台云物理服务器执行关机操作,只能停止running状态的服务器 [MFA enabled] ''', + help=''' 查询弹性公网IP列表
; 支持分页查询,默认每页20条
; ''', description=''' - 对单台云物理服务器执行关机操作,只能停止running状态的服务器 [MFA enabled]。 + 查询弹性公网IP列表
; 支持分页查询,默认每页20条
; 。 - 示例: jdc cps stop-instance --instance-id xxx + 示例: jdc cps describe-elastic-ips ''', ) - def stop_instance(self): + def describe_elastic_ips(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.StopInstanceRequest import StopInstanceRequest + from jdcloud_sdk.services.cps.apis.DescribeElasticIpsRequest import DescribeElasticIpsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopInstanceRequest(params_dict, headers) + req = DescribeElasticIpsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -591,30 +612,31 @@ def stop_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--elastic-ip-spec'], dict(help="""(elasticIpSpec) 弹性公网IP配置 """, dest='elasticIpSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 对单台云物理服务器执行开机操作,只能启动stopped状态的服务器 ''', + help=''' 申请弹性公网IP; ''', description=''' - 对单台云物理服务器执行开机操作,只能启动stopped状态的服务器。 + 申请弹性公网IP; 。 - 示例: jdc cps start-instance --instance-id xxx + 示例: jdc cps apply-elastic-ips --elastic-ip-spec '{"":""}' ''', ) - def start_instance(self): + def apply_elastic_ips(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.StartInstanceRequest import StartInstanceRequest + from jdcloud_sdk.services.cps.apis.ApplyElasticIpsRequest import ApplyElasticIpsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartInstanceRequest(params_dict, headers) + req = ApplyElasticIpsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -625,31 +647,30 @@ def start_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--instance-spec'], dict(help="""(reinstallInstanceSpec) 云物理服务器配置 """, dest='instanceSpec', required=True)), + (['--elastic-ip-id'], dict(help="""(string) 弹性公网IPID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 重装云物理服务器,只能重装stopped状态的服务器
; - 可调用接口(describeOS)获取云物理服务器支持的操作系统列表; [MFA enabled] ''', + help=''' 查询弹性公网IP详情 ''', description=''' - 重装云物理服务器,只能重装stopped状态的服务器
; - 可调用接口(describeOS)获取云物理服务器支持的操作系统列表; [MFA enabled]。 + 查询弹性公网IP详情。 - 示例: jdc cps reinstall-instance --instance-id xxx --instance-spec '{"":""}' + 示例: jdc cps describe-elastic-ip --elastic-ip-id xxx ''', ) - def reinstall_instance(self): + def describe_elastic_ip(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.ReinstallInstanceRequest import ReinstallInstanceRequest + from jdcloud_sdk.services.cps.apis.DescribeElasticIpRequest import DescribeElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ReinstallInstanceRequest(params_dict, headers) + req = DescribeElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -660,31 +681,32 @@ def reinstall_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--elastic-ip-id'], dict(help="""(string) 弹性公网IPID """, dest='elasticIpId', required=True)), (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--bandwidth'], dict(help="""(int) 外网带宽,单位Mbps,取值范围[1,200] """, dest='bandwidth', type=int, required=True)), + (['--bandwidth'], dict(help="""(int) 带宽,单位Mbps,取值范围[1,200] """, dest='bandwidth', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 升级云物理服务器外网带宽,只能操作running或者stopped状态的服务器
; - 不支持未启用外网的服务器升级带宽; - 外网带宽不支持降级; ''', + help=''' 修改弹性公网IP带宽; ''', description=''' - 升级云物理服务器外网带宽,只能操作running或者stopped状态的服务器
; - 不支持未启用外网的服务器升级带宽; - 外网带宽不支持降级; 。 + 修改弹性公网IP带宽; 。 - 示例: jdc cps modify-bandwidth --instance-id xxx --bandwidth 0 + 示例: jdc cps modify-elastic-ip-bandwidth --elastic-ip-id xxx --bandwidth 5 ''', ) - def modify_bandwidth(self): + def modify_elastic_ip_bandwidth(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.ModifyBandwidthRequest import ModifyBandwidthRequest + from jdcloud_sdk.services.cps.apis.ModifyElasticIpBandwidthRequest import ModifyElasticIpBandwidthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyBandwidthRequest(params_dict, headers) + req = ModifyElasticIpBandwidthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -695,31 +717,30 @@ def modify_bandwidth(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), (['--elastic-ip-id'], dict(help="""(string) 弹性公网IPID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 绑定弹性公网IP; ''', + help=''' 查询EIP名称 ''', description=''' - 绑定弹性公网IP; 。 + 查询EIP名称。 - 示例: jdc cps associate-elastic-ip --instance-id xxx --elastic-ip-id xxx + 示例: jdc cps describe-elastic-ip-name --elastic-ip-id xxx ''', ) - def associate_elastic_ip(self): + def describe_elastic_ip_name(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.AssociateElasticIpRequest import AssociateElasticIpRequest + from jdcloud_sdk.services.cps.apis.DescribeElasticIpNameRequest import DescribeElasticIpNameRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AssociateElasticIpRequest(params_dict, headers) + req = DescribeElasticIpNameRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -729,32 +750,35 @@ def associate_elastic_ip(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--elastic-ip-id'], dict(help="""(string) 弹性公网IPId """, dest='elasticIpId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), + (['--load-balancer-id'], dict(help="""(string) 负载均衡ID """, dest='loadBalancerId', required=False)), + (['--filters'], dict(help="""(array: filter) serverGroupId - 虚拟服务器组ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 解绑弹性公网IP; ''', + help=''' 查询虚拟服务器组列表 ''', description=''' - 解绑弹性公网IP; 。 + 查询虚拟服务器组列表。 - 示例: jdc cps disassociate-elastic-ip --instance-id xxx --elastic-ip-id xxx + 示例: jdc cps describe-server-groups ''', ) - def disassociate_elastic_ip(self): + def describe_server_groups(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DisassociateElasticIpRequest import DisassociateElasticIpRequest + from jdcloud_sdk.services.cps.apis.DescribeServerGroupsRequest import DescribeServerGroupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisassociateElasticIpRequest(params_dict, headers) + req = DescribeServerGroupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -764,32 +788,32 @@ def disassociate_elastic_ip(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--password'], dict(help="""(string) 密码 """, dest='password', required=True)), + (['--server-group-spec'], dict(help="""(serverGroupSpec) 虚拟服务器组配置 """, dest='serverGroupSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 重置云物理服务器密码; ''', + help=''' 创建虚拟服务器组 ''', description=''' - 重置云物理服务器密码; 。 + 创建虚拟服务器组。 - 示例: jdc cps reset-password --instance-id xxx --password xxx + 示例: jdc cps create-server-group --server-group-spec '{"":""}' ''', ) - def reset_password(self): + def create_server_group(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.ResetPasswordRequest import ResetPasswordRequest + from jdcloud_sdk.services.cps.apis.CreateServerGroupRequest import CreateServerGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ResetPasswordRequest(params_dict, headers) + req = CreateServerGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -799,33 +823,100 @@ def reset_password(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), - (['--start-time'], dict(help="""(int) 开始时间的时间戳,格式:1562915166551 """, dest='startTime', type=int, required=False)), - (['--end-time'], dict(help="""(int) 结束时间的时间戳,格式:1562915166551 """, dest='endTime', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) metric - 监控指标,精确匹配,支持多个,具体如下
; cps.cpu.util - CPU使用率
; cps.memory.util - 内存使用率
; cps.memory.used - 内存使用量
; cps.disk.used - 磁盘使用量
; cps.disk.util - 磁盘使用率
; cps.disk.bytes.read - 磁盘读流量
; cps.disk.bytes.write - 磁盘写流量
; cps.disk.counts.read - 磁盘读IOPS
; cps.disk.counts.write - 磁盘写IOPS
; cps.network.bytes.ingress - 网卡进流量
; cps.network.bytes.egress - 网卡出流量
; cps.network.packets.ingress - 网络进包量
; cps.network.packets.egress - 网络出包量
; cps.avg.load1 - CPU平均负载1min
; cps.avg.load5 - CPU平均负载5min
; cps.avg.load15 - CPU平均负载15min
; cps.tcp.connect.total - TCP总连接数
; cps.tcp.connect.established - TCP正常连接数
; cps.process.total - 总进程数; """, dest='filters', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询云物理服务器监控信息 ''', + help=''' 查询虚拟服务器组 ''', description=''' - 查询云物理服务器监控信息。 + 查询虚拟服务器组。 - 示例: jdc cps describe-instance-monitor-info --instance-id xxx + 示例: jdc cps describe-server-group --server-group-id xxx ''', ) - def describe_instance_monitor_info(self): + def describe_server_group(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeInstanceMonitorInfoRequest import DescribeInstanceMonitorInfoRequest + from jdcloud_sdk.services.cps.apis.DescribeServerGroupRequest import DescribeServerGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceMonitorInfoRequest(params_dict, headers) + req = DescribeServerGroupRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), + (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改虚拟服务器组 ''', + description=''' + 修改虚拟服务器组。 + + 示例: jdc cps modify-server-group --server-group-id xxx + ''', + ) + def modify_server_group(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.ModifyServerGroupRequest import ModifyServerGroupRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyServerGroupRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除虚拟服务器组 ''', + description=''' + 删除虚拟服务器组。 + + 示例: jdc cps delete-server-group --server-group-id xxx + ''', + ) + def delete_server_group(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DeleteServerGroupRequest import DeleteServerGroupRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteServerGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -841,6 +932,7 @@ def describe_instance_monitor_info(self): (['--name'], dict(help="""(string) 密钥对名称 """, dest='name', required=False)), (['--filters'], dict(help="""(array: filter) keypairId - 密钥对ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -875,6 +967,7 @@ def describe_keypairs(self): (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), (['--name'], dict(help="""(string) 密钥对名称 """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -910,6 +1003,7 @@ def create_keypairs(self): (['--name'], dict(help="""(string) 密钥对名称 """, dest='name', required=True)), (['--public-key'], dict(help="""(string) 公钥 """, dest='publicKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -943,6 +1037,7 @@ def import_keypairs(self): (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), (['--keypair-id'], dict(help="""(string) 密钥对ID """, dest='keypairId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -976,6 +1071,7 @@ def describe_keypair(self): (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), (['--keypair-id'], dict(help="""(string) 密钥对ID """, dest='keypairId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1009,31 +1105,34 @@ def delete_keypairs(self): (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--status'], dict(help="""(string) 状态 """, dest='status', required=False)), (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), - (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID,精确匹配 """, dest='loadBalancerId', required=False)), - (['--filters'], dict(help="""(array: filter) listenerId - 监听器ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--vpc-id'], dict(help="""(string) 私有网络ID,精确匹配 """, dest='vpcId', required=False)), + (['--bind-eip'], dict(help="""(bool) 是否绑定eip """, dest='bindEip', type=bool, required=False)), + (['--filters'], dict(help="""(array: filter) loadBalancerId - 负载均衡实例ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询监听器 ''', + help=''' 查询负载均衡实例列表 ''', description=''' - 查询监听器。 + 查询负载均衡实例列表。 - 示例: jdc cps describe-listeners + 示例: jdc cps describe-load-balancers ''', ) - def describe_listeners(self): + def describe_load_balancers(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeListenersRequest import DescribeListenersRequest + from jdcloud_sdk.services.cps.apis.DescribeLoadBalancersRequest import DescribeLoadBalancersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeListenersRequest(params_dict, headers) + req = DescribeLoadBalancersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1045,29 +1144,30 @@ def describe_listeners(self): arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--listener-spec'], dict(help="""(listenerSpec) 监听器配置 """, dest='listenerSpec', required=True)), + (['--load-balancer-spec'], dict(help="""(loadBalancerSpec) 负载均衡配置 """, dest='loadBalancerSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建监听器 ''', + help=''' 创建负载均衡实例 ''', description=''' - 创建监听器。 + 创建负载均衡实例。 - 示例: jdc cps create-listener --listener-spec '{"":""}' + 示例: jdc cps create-load-balancer --load-balancer-spec '{"":""}' ''', ) - def create_listener(self): + def create_load_balancer(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.CreateListenerRequest import CreateListenerRequest + from jdcloud_sdk.services.cps.apis.CreateLoadBalancerRequest import CreateLoadBalancerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateListenerRequest(params_dict, headers) + req = CreateLoadBalancerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1078,40 +1178,32 @@ def create_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), - (['--algorithm'], dict(help="""(string) 调度算法 """, dest='algorithm', required=False)), - (['--sticky-session'], dict(help="""(string) 会话保持 """, dest='stickySession', required=False)), - (['--real-ip'], dict(help="""(string) 是否获取真实ip,取值范围on|off """, dest='realIp', required=False)), + (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), - (['--health-check'], dict(help="""(string) 健康检查 """, dest='healthCheck', required=False)), - (['--health-check-timeout'], dict(help="""(int) 健康检查响应的最大超时时间 """, dest='healthCheckTimeout', type=int, required=False)), - (['--health-check-interval'], dict(help="""(int) 健康检查响应的最大间隔时间 """, dest='healthCheckInterval', type=int, required=False)), - (['--healthy-threshold'], dict(help="""(int) 健康检查结果为success的阈值 """, dest='healthyThreshold', type=int, required=False)), - (['--unhealthy-threshold'], dict(help="""(int) 健康检查结果为fail的阈值 """, dest='unhealthyThreshold', type=int, required=False)), - (['--server-group-id'], dict(help="""(string) 服务器组id """, dest='serverGroupId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改监听器 ''', + help=''' 修改负载均衡实例 ''', description=''' - 修改监听器。 + 修改负载均衡实例。 - 示例: jdc cps modify-listener --listener-id xxx + 示例: jdc cps modify-load-balancer --load-balancer-id xxx ''', ) - def modify_listener(self): + def modify_load_balancer(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.ModifyListenerRequest import ModifyListenerRequest + from jdcloud_sdk.services.cps.apis.ModifyLoadBalancerRequest import ModifyLoadBalancerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyListenerRequest(params_dict, headers) + req = ModifyLoadBalancerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1122,29 +1214,30 @@ def modify_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询监听器详情 ''', + help=''' 查询负载均衡实例详情 ''', description=''' - 查询监听器详情。 + 查询负载均衡实例详情。 - 示例: jdc cps describe-listener --listener-id xxx + 示例: jdc cps describe-load-balancer --load-balancer-id xxx ''', ) - def describe_listener(self): + def describe_load_balancer(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeListenerRequest import DescribeListenerRequest + from jdcloud_sdk.services.cps.apis.DescribeLoadBalancerRequest import DescribeLoadBalancerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeListenerRequest(params_dict, headers) + req = DescribeLoadBalancerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1155,29 +1248,31 @@ def describe_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除监听器 ''', + help=''' 开启负载均衡实例 ''', description=''' - 删除监听器。 + 开启负载均衡实例。 - 示例: jdc cps delete-listener --listener-id xxx + 示例: jdc cps start-load-balancer --load-balancer-id xxx ''', ) - def delete_listener(self): + def start_load_balancer(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DeleteListenerRequest import DeleteListenerRequest + from jdcloud_sdk.services.cps.apis.StartLoadBalancerRequest import StartLoadBalancerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteListenerRequest(params_dict, headers) + req = StartLoadBalancerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1188,30 +1283,31 @@ def delete_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启监听器 ''', + help=''' 关闭负载均衡实例 ''', description=''' - 开启监听器。 + 关闭负载均衡实例。 - 示例: jdc cps start-listener --listener-id xxx + 示例: jdc cps stop-load-balancer --load-balancer-id xxx ''', ) - def start_listener(self): + def stop_load_balancer(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.StartListenerRequest import StartListenerRequest + from jdcloud_sdk.services.cps.apis.StopLoadBalancerRequest import StopLoadBalancerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartListenerRequest(params_dict, headers) + req = StopLoadBalancerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1222,30 +1318,32 @@ def start_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--elastic-ip-id'], dict(help="""(string) 弹性公网IPId """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 关闭监听器 ''', + help=''' 绑定弹性公网IP ''', description=''' - 关闭监听器。 + 绑定弹性公网IP。 - 示例: jdc cps stop-listener --listener-id xxx + 示例: jdc cps associate-elastic-ip-lb --load-balancer-id xxx --elastic-ip-id xxx ''', ) - def stop_listener(self): + def associate_elastic_ip_lb(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.StopListenerRequest import StopListenerRequest + from jdcloud_sdk.services.cps.apis.AssociateElasticIpLBRequest import AssociateElasticIpLBRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopListenerRequest(params_dict, headers) + req = AssociateElasticIpLBRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1256,35 +1354,32 @@ def stop_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), - (['--status'], dict(help="""(string) 状态 """, dest='status', required=False)), - (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), - (['--vpc-id'], dict(help="""(string) 私有网络ID,精确匹配 """, dest='vpcId', required=False)), - (['--bind-eip'], dict(help="""(bool) 是否绑定eip """, dest='bindEip', required=False)), - (['--filters'], dict(help="""(array: filter) loadBalancerId - 负载均衡实例ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--elastic-ip-id'], dict(help="""(string) 弹性公网IPId """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询负载均衡实例列表 ''', + help=''' 解绑弹性公网IP ''', description=''' - 查询负载均衡实例列表。 + 解绑弹性公网IP。 - 示例: jdc cps describe-load-balancers + 示例: jdc cps disassociate-elastic-ip-lb --load-balancer-id xxx --elastic-ip-id xxx ''', ) - def describe_load_balancers(self): + def disassociate_elastic_ip_lb(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeLoadBalancersRequest import DescribeLoadBalancersRequest + from jdcloud_sdk.services.cps.apis.DisassociateElasticIpLBRequest import DisassociateElasticIpLBRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLoadBalancersRequest(params_dict, headers) + req = DisassociateElasticIpLBRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1295,30 +1390,30 @@ def describe_load_balancers(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--load-balancer-spec'], dict(help="""(loadBalancerSpec) 负载均衡配置 """, dest='loadBalancerSpec', required=True)), + (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建负载均衡实例 ''', + help=''' 查询SLB名称 ''', description=''' - 创建负载均衡实例。 + 查询SLB名称。 - 示例: jdc cps create-load-balancer --load-balancer-spec '{"":""}' + 示例: jdc cps describe-slbs-name --load-balancer-id xxx ''', ) - def create_load_balancer(self): + def describe_slbs_name(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.CreateLoadBalancerRequest import CreateLoadBalancerRequest + from jdcloud_sdk.services.cps.apis.DescribeSlbsNameRequest import DescribeSlbsNameRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateLoadBalancerRequest(params_dict, headers) + req = DescribeSlbsNameRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1329,31 +1424,34 @@ def create_load_balancer(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), - (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), - (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--listener-id'], dict(help="""(string) 监听器Id """, dest='listenerId', required=False)), + (['--filters'], dict(help="""(array: filter) serverId - 后端服务器ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改负载均衡实例 ''', + help=''' 查询后端服务器列表 ''', description=''' - 修改负载均衡实例。 + 查询后端服务器列表。 - 示例: jdc cps modify-load-balancer --load-balancer-id xxx + 示例: jdc cps describe-servers --server-group-id xxx ''', ) - def modify_load_balancer(self): + def describe_servers(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.ModifyLoadBalancerRequest import ModifyLoadBalancerRequest + from jdcloud_sdk.services.cps.apis.DescribeServersRequest import DescribeServersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyLoadBalancerRequest(params_dict, headers) + req = DescribeServersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1364,29 +1462,32 @@ def modify_load_balancer(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), + (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--server-spec'], dict(help="""(array: serverSpec) 后端服务器配置 """, dest='serverSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询负载均衡实例详情 ''', + help=''' 添加后端服务器 ''', description=''' - 查询负载均衡实例详情。 + 添加后端服务器。 - 示例: jdc cps describe-load-balancer --load-balancer-id xxx + 示例: jdc cps add-servers --server-group-id xxx --server-spec ['{"":""}'] ''', ) - def describe_load_balancer(self): + def add_servers(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeLoadBalancerRequest import DescribeLoadBalancerRequest + from jdcloud_sdk.services.cps.apis.AddServersRequest import AddServersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLoadBalancerRequest(params_dict, headers) + req = AddServersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1397,30 +1498,32 @@ def describe_load_balancer(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), + (['--server-id'], dict(help="""(string) 后端服务器ID """, dest='serverId', required=True)), + (['--weight'], dict(help="""(int) 权重 """, dest='weight', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启负载均衡实例 ''', + help=''' 修改后端服务器 ''', description=''' - 开启负载均衡实例。 + 修改后端服务器。 - 示例: jdc cps start-load-balancer --load-balancer-id xxx + 示例: jdc cps modify-server --server-group-id xxx --server-id xxx ''', ) - def start_load_balancer(self): + def modify_server(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.StartLoadBalancerRequest import StartLoadBalancerRequest + from jdcloud_sdk.services.cps.apis.ModifyServerRequest import ModifyServerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartLoadBalancerRequest(params_dict, headers) + req = ModifyServerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1431,30 +1534,31 @@ def start_load_balancer(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), + (['--server-id'], dict(help="""(string) 后端服务器ID """, dest='serverId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 关闭负载均衡实例 ''', + help=''' 移除后端服务器 ''', description=''' - 关闭负载均衡实例。 + 移除后端服务器。 - 示例: jdc cps stop-load-balancer --load-balancer-id xxx + 示例: jdc cps remove-server --server-group-id xxx --server-id xxx ''', ) - def stop_load_balancer(self): + def remove_server(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.StopLoadBalancerRequest import StopLoadBalancerRequest + from jdcloud_sdk.services.cps.apis.RemoveServerRequest import RemoveServerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopLoadBalancerRequest(params_dict, headers) + req = RemoveServerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1464,32 +1568,34 @@ def stop_load_balancer(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--elastic-ip-id'], dict(help="""(string) 弹性公网IPId """, dest='elasticIpId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--ipv6gateway-name'], dict(help="""(string) IPv6网关名称 """, dest='ipv6GatewayName', required=False)), + (['--filters'], dict(help="""(array: filter) ipv6GatewayId - IPv6网关实例ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 绑定弹性公网IP ''', + help=''' 查询IPv6网关实例列表 ''', description=''' - 绑定弹性公网IP。 + 查询IPv6网关实例列表。 - 示例: jdc cps associate-elastic-ip-lb --load-balancer-id xxx --elastic-ip-id xxx + 示例: jdc cps describe-ipv6gateways ''', ) - def associate_elastic_ip_lb(self): + def describe_ipv6gateways(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.AssociateElasticIpLBRequest import AssociateElasticIpLBRequest + from jdcloud_sdk.services.cps.apis.DescribeIpv6GatewaysRequest import DescribeIpv6GatewaysRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AssociateElasticIpLBRequest(params_dict, headers) + req = DescribeIpv6GatewaysRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1499,32 +1605,67 @@ def associate_elastic_ip_lb(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID """, dest='loadBalancerId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--ipv6gateway-id'], dict(help="""(string) IPv6网关ID """, dest='ipv6GatewayId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询IPv6网关实例详情 ''', + description=''' + 查询IPv6网关实例详情。 + + 示例: jdc cps describe-ipv6gateway --ipv6gateway-id xxx + ''', + ) + def describe_ipv6gateway(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DescribeIpv6GatewayRequest import DescribeIpv6GatewayRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeIpv6GatewayRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--ipv6gateway-id'], dict(help="""(string) IPv6网关ID """, dest='ipv6GatewayId', required=True)), (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--elastic-ip-id'], dict(help="""(string) 弹性公网IPId """, dest='elasticIpId', required=True)), + (['--ipv6gateway-name'], dict(help="""(string) IPv6网关实例名称 """, dest='ipv6GatewayName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 解绑弹性公网IP ''', + help=''' 修改IPv6网关实例 ''', description=''' - 解绑弹性公网IP。 + 修改IPv6网关实例。 - 示例: jdc cps disassociate-elastic-ip-lb --load-balancer-id xxx --elastic-ip-id xxx + 示例: jdc cps modify-ipv6gateway --ipv6gateway-id xxx ''', ) - def disassociate_elastic_ip_lb(self): + def modify_ipv6gateway(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DisassociateElasticIpLBRequest import DisassociateElasticIpLBRequest + from jdcloud_sdk.services.cps.apis.ModifyIpv6GatewayRequest import ModifyIpv6GatewayRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisassociateElasticIpLBRequest(params_dict, headers) + req = ModifyIpv6GatewayRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1534,29 +1675,31 @@ def disassociate_elastic_ip_lb(self): @expose( arguments=[ - (['--network-type'], dict(help="""(string) 网络类型basic/vpc, 默认basic """, dest='networkType', required=False)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--az'], dict(help="""(string) 可用区, 如cn-east-1a;可调用接口(describeRegiones)获取云物理服务器在该地域支持的可用区 """, dest='az', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询云物理服务器地域列表 ''', + help=''' 查询基础网络子网 ''', description=''' - 查询云物理服务器地域列表。 + 查询基础网络子网。 - 示例: jdc cps describe-regiones + 示例: jdc cps describe-basic-subnet --az xxx ''', ) - def describe_regiones(self): + def describe_basic_subnet(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeRegionesRequest import DescribeRegionesRequest + from jdcloud_sdk.services.cps.apis.DescribeBasicSubnetRequest import DescribeBasicSubnetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeRegionesRequest(params_dict, headers) + req = DescribeBasicSubnetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1566,28 +1709,36 @@ def describe_regiones(self): @expose( arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--az'], dict(help="""(string) 可用区,精确匹配 """, dest='az', required=False)), + (['--name'], dict(help="""(string) 子网名称 """, dest='name', required=False)), + (['--vpc-id'], dict(help="""(string) 私有网络ID,精确匹配 """, dest='vpcId', required=False)), + (['--filters'], dict(help="""(array: filter) subnetId - 子网ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询负载均衡地域列表 ''', + help=''' 查询子网列表 ''', description=''' - 查询负载均衡地域列表。 + 查询子网列表。 - 示例: jdc cps describe-cpslbregions + 示例: jdc cps describe-subnets ''', ) - def describe_cpslbregions(self): + def describe_subnets(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeCPSLBRegionsRequest import DescribeCPSLBRegionsRequest + from jdcloud_sdk.services.cps.apis.DescribeSubnetsRequest import DescribeSubnetsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCPSLBRegionsRequest(params_dict, headers) + req = DescribeSubnetsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1598,29 +1749,31 @@ def describe_cpslbregions(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--route-table-id'], dict(help="""(string) 路由表ID """, dest='routeTableId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--subnet-spec'], dict(help="""(subnetSpec) 子网配置 """, dest='subnetSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询路由表详情 ''', + help=''' 创建子网 ''', description=''' - 查询路由表详情。 + 创建子网。 - 示例: jdc cps describe-route-table --route-table-id xxx + 示例: jdc cps create-subnet --subnet-spec '{"":""}' ''', ) - def describe_route_table(self): + def create_subnet(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeRouteTableRequest import DescribeRouteTableRequest + from jdcloud_sdk.services.cps.apis.CreateSubnetRequest import CreateSubnetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeRouteTableRequest(params_dict, headers) + req = CreateSubnetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1631,33 +1784,32 @@ def describe_route_table(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), - (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), - (['--vpc-id'], dict(help="""(string) 私有网络ID,精确匹配 """, dest='vpcId', required=False)), - (['--filters'], dict(help="""(array: filter) routeTableId - 路由表ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--ipv6cidr'], dict(help="""(string) 子网IPv6 CIDR """, dest='ipv6Cidr', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询路由表列表 ''', + help=''' 申请IPv6网段; ''', description=''' - 查询路由表列表。 + 申请IPv6网段; 。 - 示例: jdc cps describe-route-tables + 示例: jdc cps assign-ipv6cidr --subnet-id xxx ''', ) - def describe_route_tables(self): + def assign_ipv6cidr(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeRouteTablesRequest import DescribeRouteTablesRequest + from jdcloud_sdk.services.cps.apis.AssignIpv6CidrRequest import AssignIpv6CidrRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeRouteTablesRequest(params_dict, headers) + req = AssignIpv6CidrRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1667,34 +1819,31 @@ def describe_route_tables(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), - (['--listener-id'], dict(help="""(string) 监听器Id """, dest='listenerId', required=False)), - (['--filters'], dict(help="""(array: filter) serverId - 后端服务器ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询后端服务器列表 ''', + help=''' 查询子网详情 ''', description=''' - 查询后端服务器列表。 + 查询子网详情。 - 示例: jdc cps describe-servers --server-group-id xxx + 示例: jdc cps describe-subnet --subnet-id xxx ''', ) - def describe_servers(self): + def describe_subnet(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeServersRequest import DescribeServersRequest + from jdcloud_sdk.services.cps.apis.DescribeSubnetRequest import DescribeSubnetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeServersRequest(params_dict, headers) + req = DescribeSubnetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1704,32 +1853,68 @@ def describe_servers(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=True)), + (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改子网 ''', + description=''' + 修改子网。 + + 示例: jdc cps modify-subnet --subnet-id xxx + ''', + ) + def modify_subnet(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.ModifySubnetRequest import ModifySubnetRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifySubnetRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=True)), (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--server-spec'], dict(help="""(array: serverSpec) 后端服务器配置 """, dest='serverSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加后端服务器 ''', + help=''' 删除子网 ''', description=''' - 添加后端服务器。 + 删除子网。 - 示例: jdc cps add-servers --server-group-id xxx --server-spec ['{"":""}'] + 示例: jdc cps delete-subnet --subnet-id xxx ''', ) - def add_servers(self): + def delete_subnet(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.AddServersRequest import AddServersRequest + from jdcloud_sdk.services.cps.apis.DeleteSubnetRequest import DeleteSubnetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddServersRequest(params_dict, headers) + req = DeleteSubnetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1739,32 +1924,31 @@ def add_servers(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), - (['--server-id'], dict(help="""(string) 后端服务器ID """, dest='serverId', required=True)), - (['--weight'], dict(help="""(int) 权重 """, dest='weight', type=int, required=False)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--vpc-id'], dict(help="""(string) 私有网络ID """, dest='vpcId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改后端服务器 ''', + help=''' 查询私有网络详情 ''', description=''' - 修改后端服务器。 + 查询私有网络详情。 - 示例: jdc cps modify-server --server-group-id xxx --server-id xxx + 示例: jdc cps describe-vpc --vpc-id xxx ''', ) - def modify_server(self): + def describe_vpc(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.ModifyServerRequest import ModifyServerRequest + from jdcloud_sdk.services.cps.apis.DescribeVpcRequest import DescribeVpcRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyServerRequest(params_dict, headers) + req = DescribeVpcRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1774,31 +1958,899 @@ def modify_server(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), - (['--server-id'], dict(help="""(string) 后端服务器ID """, dest='serverId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--vpc-id'], dict(help="""(string) 私有网络ID """, dest='vpcId', required=True)), + (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改私有网络; ''', + description=''' + 修改私有网络; 。 + + 示例: jdc cps modify-vpc --vpc-id xxx + ''', + ) + def modify_vpc(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.ModifyVpcRequest import ModifyVpcRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyVpcRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--vpc-id'], dict(help="""(string) 私有网络ID """, dest='vpcId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除私有网络; ''', + description=''' + 删除私有网络; 。 + + 示例: jdc cps delete-vpc --vpc-id xxx + ''', + ) + def delete_vpc(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DeleteVpcRequest import DeleteVpcRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteVpcRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--name'], dict(help="""(string) 私有网络名称 """, dest='name', required=False)), + (['--filters'], dict(help="""(array: filter) vpcId - 私有网络ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询私有网络列表 ''', + description=''' + 查询私有网络列表。 + + 示例: jdc cps describe-vpcs + ''', + ) + def describe_vpcs(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DescribeVpcsRequest import DescribeVpcsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeVpcsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--vpc-spec'], dict(help="""(vpcSpec) 子网配置 """, dest='vpcSpec', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建私有网络 ''', + description=''' + 创建私有网络。 + + 示例: jdc cps create-vpc --vpc-spec '{"":""}' + ''', + ) + def create_vpc(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.CreateVpcRequest import CreateVpcRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateVpcRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--vpc-id'], dict(help="""(string) 私有网络ID """, dest='vpcId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 申请开通IPv6网关; ''', + description=''' + 申请开通IPv6网关; 。 + + 示例: jdc cps assign-ipv6gateway --vpc-id xxx + ''', + ) + def assign_ipv6gateway(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.AssignIpv6GatewayRequest import AssignIpv6GatewayRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = AssignIpv6GatewayRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), + (['--load-balancer-id'], dict(help="""(string) 负载均衡实例ID,精确匹配 """, dest='loadBalancerId', required=False)), + (['--filters'], dict(help="""(array: filter) listenerId - 监听器ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询监听器 ''', + description=''' + 查询监听器。 + + 示例: jdc cps describe-listeners + ''', + ) + def describe_listeners(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DescribeListenersRequest import DescribeListenersRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeListenersRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--listener-spec'], dict(help="""(listenerSpec) 监听器配置 """, dest='listenerSpec', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建监听器 ''', + description=''' + 创建监听器。 + + 示例: jdc cps create-listener --listener-spec '{"":""}' + ''', + ) + def create_listener(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.CreateListenerRequest import CreateListenerRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateListenerRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--algorithm'], dict(help="""(string) 调度算法 """, dest='algorithm', required=False)), + (['--sticky-session'], dict(help="""(string) 会话保持 """, dest='stickySession', required=False)), + (['--real-ip'], dict(help="""(string) 是否获取真实ip,取值范围on|off """, dest='realIp', required=False)), + (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--health-check'], dict(help="""(string) 健康检查 """, dest='healthCheck', required=False)), + (['--health-check-timeout'], dict(help="""(int) 健康检查响应的最大超时时间 """, dest='healthCheckTimeout', type=int, required=False)), + (['--health-check-interval'], dict(help="""(int) 健康检查响应的最大间隔时间 """, dest='healthCheckInterval', type=int, required=False)), + (['--healthy-threshold'], dict(help="""(int) 健康检查结果为success的阈值 """, dest='healthyThreshold', type=int, required=False)), + (['--unhealthy-threshold'], dict(help="""(int) 健康检查结果为fail的阈值 """, dest='unhealthyThreshold', type=int, required=False)), + (['--server-group-id'], dict(help="""(string) 服务器组id """, dest='serverGroupId', required=False)), + (['--sticky-session-timeout'], dict(help="""(int) 会话保持超时时间,单位s """, dest='stickySessionTimeout', type=int, required=False)), + (['--cookie-type'], dict(help="""(string) 会话类型,植入Cookie or 重写Cookie """, dest='cookieType', required=False)), + (['--health-check-uri'], dict(help="""(string) 检查路径 """, dest='healthCheckUri', required=False)), + (['--health-check-http-code'], dict(help="""(string) 正常态码,要使用的Http状态码 """, dest='healthCheckHttpCode', required=False)), + (['--certificate-id'], dict(help="""(string) 证书ID """, dest='certificateId', required=False)), + (['--headers'], dict(help="""(array: string) 获取HTTP头字段:X-Forwarded-For、X-Forwarded-Proto、X- Forwarded-Port、X-Forwarded-LBIP """, dest='headers', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改监听器 ''', + description=''' + 修改监听器。 + + 示例: jdc cps modify-listener --listener-id xxx + ''', + ) + def modify_listener(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.ModifyListenerRequest import ModifyListenerRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyListenerRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询监听器详情 ''', + description=''' + 查询监听器详情。 + + 示例: jdc cps describe-listener --listener-id xxx + ''', + ) + def describe_listener(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DescribeListenerRequest import DescribeListenerRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeListenerRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除监听器 ''', + description=''' + 删除监听器。 + + 示例: jdc cps delete-listener --listener-id xxx + ''', + ) + def delete_listener(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DeleteListenerRequest import DeleteListenerRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteListenerRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 开启监听器 ''', + description=''' + 开启监听器。 + + 示例: jdc cps start-listener --listener-id xxx + ''', + ) + def start_listener(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.StartListenerRequest import StartListenerRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = StartListenerRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 关闭监听器 ''', + description=''' + 关闭监听器。 + + 示例: jdc cps stop-listener --listener-id xxx + ''', + ) + def stop_listener(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.StopListenerRequest import StopListenerRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = StopListenerRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--az'], dict(help="""(string) 可用区,精确匹配 """, dest='az', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询云物理服务器实例类型 ''', + description=''' + 查询云物理服务器实例类型。 + + 示例: jdc cps describe-device-types + ''', + ) + def describe_device_types(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DescribeDeviceTypesRequest import DescribeDeviceTypesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeDeviceTypesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--device-type'], dict(help="""(string) 实例类型,可调用接口(describeDeviceTypes)获取指定地域的实例类型,例如:cps.c.normal """, dest='deviceType', required=True)), + (['--os-type'], dict(help="""(string) 操作系统类型,取值范围:CentOS、Ubuntu、Windows """, dest='osType', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询云物理服务器支持的操作系统 ''', + description=''' + 查询云物理服务器支持的操作系统。 + + 示例: jdc cps describe-os --device-type xxx + ''', + ) + def describe_os(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DescribeOSRequest import DescribeOSRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeOSRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--device-type'], dict(help="""(string) 实例类型,可调用(describeDeviceTypes)接口获取指定地域的实例类型,例如:cps.c.normal """, dest='deviceType', required=True)), + (['--volume-type'], dict(help="""(string) 磁盘类型,取值范围:system、data """, dest='volumeType', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询某种实例类型的云物理服务器支持的RAID类型,可查询系统盘RAID类型和数据盘RAID类型 ''', + description=''' + 查询某种实例类型的云物理服务器支持的RAID类型,可查询系统盘RAID类型和数据盘RAID类型。 + + 示例: jdc cps describe-device-raids --device-type xxx + ''', + ) + def describe_device_raids(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DescribeDeviceRaidsRequest import DescribeDeviceRaidsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeDeviceRaidsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询单台云物理服务器详细信息 ''', + description=''' + 查询单台云物理服务器详细信息。 + + 示例: jdc cps describe-instance --instance-id xxx + ''', + ) + def describe_instance(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DescribeInstanceRequest import DescribeInstanceRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeInstanceRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--az'], dict(help="""(string) 可用区,精确匹配 """, dest='az', required=False)), + (['--name'], dict(help="""(string) 云物理服务器名称,支持模糊匹配 """, dest='name', required=False)), + (['--network-type'], dict(help="""(string) 网络类型,精确匹配,支持basic(基础网络)、vpc(私有网络)、retail(零售中台网络) """, dest='networkType', required=False)), + (['--device-type'], dict(help="""(string) 实例类型,精确匹配,调用接口(describeDeviceTypes)获取实例类型 """, dest='deviceType', required=False)), + (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=False)), + (['--keypair-id'], dict(help="""(string) 密钥对ID """, dest='keypairId', required=False)), + (['--enable-internet'], dict(help="""(string) 是否启用外网, yes、no """, dest='enableInternet', required=False)), + (['--private-ip'], dict(help="""(string) 内网ip """, dest='privateIp', required=False)), + (['--interface-mode'], dict(help="""(string) 实例网卡类型:bond(网卡bond)、dual(双网卡) """, dest='interfaceMode', required=False)), + (['--filters'], dict(help="""(array: filter) instanceId - 云物理服务器ID,精确匹配,支持多个
; status - 云物理服务器状态,参考云物理服务器状态,精确匹配,支持多个; """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 批量查询云物理服务器详细信息
; 支持分页查询,默认每页20条
; ''', + description=''' + 批量查询云物理服务器详细信息
; 支持分页查询,默认每页20条
; 。 + + 示例: jdc cps describe-instances + ''', + ) + def describe_instances(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DescribeInstancesRequest import DescribeInstancesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeInstancesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--instance-spec'], dict(help="""(instanceSpec) 描述云物理服务器配置 """, dest='instanceSpec', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建一台或多台指定配置的云物理服务器
; - 地域与可用区
; - 调用接口(describeRegiones)获取云物理服务器支持的地域与可用区
; - 实例类型
; - 调用接口(describeDeviceTypes)获取物理实例类型列表
; - 不能使用已下线、或已售馨的实例类型
; - 操作系统
; - 可调用接口(describeOS)获取云物理服务器支持的操作系统列表
; - 存储
; - 数据盘多种RAID可选,可调用接口(describeDeviceRaids)获取服务器支持的RAID列表
; - 网络
; - 网络类型目前支持basic、vpc
; - 线路目前只支持bgp
; - 支持不启用外网,如果启用外网,带宽范围[1,200] 单位Mbps
; - 其他
; - 购买时长,可按年或月购买:月取值范围[1,9], 年取值范围[1,3]
; - 密码设置参考公共参数规范
; ''', + description=''' + 创建一台或多台指定配置的云物理服务器
; - 地域与可用区
; - 调用接口(describeRegiones)获取云物理服务器支持的地域与可用区
; - 实例类型
; - 调用接口(describeDeviceTypes)获取物理实例类型列表
; - 不能使用已下线、或已售馨的实例类型
; - 操作系统
; - 可调用接口(describeOS)获取云物理服务器支持的操作系统列表
; - 存储
; - 数据盘多种RAID可选,可调用接口(describeDeviceRaids)获取服务器支持的RAID列表
; - 网络
; - 网络类型目前支持basic、vpc
; - 线路目前只支持bgp
; - 支持不启用外网,如果启用外网,带宽范围[1,200] 单位Mbps
; - 其他
; - 购买时长,可按年或月购买:月取值范围[1,9], 年取值范围[1,3]
; - 密码设置参考公共参数规范
; 。 + + 示例: jdc cps create-instances --instance-spec '{"":""}' + ''', + ) + def create_instances(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.CreateInstancesRequest import CreateInstancesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateInstancesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询云物理服务器名称 ''', + description=''' + 查询云物理服务器名称。 + + 示例: jdc cps describe-instance-name --instance-id xxx + ''', + ) + def describe_instance_name(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DescribeInstanceNameRequest import DescribeInstanceNameRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeInstanceNameRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--ipv6address'], dict(help="""(string) IPv6地址 """, dest='ipv6Address', required=False)), + (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 申请IPv6地址 ''', + description=''' + 申请IPv6地址。 + + 示例: jdc cps assign-ipv6address --instance-id xxx --subnet-id xxx + ''', + ) + def assign_ipv6address(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.AssignIpv6AddressRequest import AssignIpv6AddressRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = AssignIpv6AddressRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--name'], dict(help="""(string) 云物理服务器名称 """, dest='name', required=False)), + (['--description'], dict(help="""(string) 云物理服务器描述 """, dest='description', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改云物理服务器部分信息,包括名称、描述 ''', + description=''' + 修改云物理服务器部分信息,包括名称、描述。 + + 示例: jdc cps modify-instance --instance-id xxx + ''', + ) + def modify_instance(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.ModifyInstanceRequest import ModifyInstanceRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyInstanceRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询单个云物理服务器已安装的RAID信息,包括系统盘RAID信息和数据盘RAID信息 ''', + description=''' + 查询单个云物理服务器已安装的RAID信息,包括系统盘RAID信息和数据盘RAID信息。 + + 示例: jdc cps describe-instance-raid --instance-id xxx + ''', + ) + def describe_instance_raid(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DescribeInstanceRaidRequest import DescribeInstanceRaidRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeInstanceRaidRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询单个云物理服务器硬件监控信息 ''', + description=''' + 查询单个云物理服务器硬件监控信息。 + + 示例: jdc cps describe-instance-status --instance-id xxx + ''', + ) + def describe_instance_status(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.DescribeInstanceStatusRequest import DescribeInstanceStatusRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeInstanceStatusRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 重启单台云物理服务器,只能重启running状态的服务器 [MFA enabled] ''', + description=''' + 重启单台云物理服务器,只能重启running状态的服务器 [MFA enabled]。 + + 示例: jdc cps restart-instance --instance-id xxx + ''', + ) + def restart_instance(self): + client_factory = ClientFactory('cps') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.cps.apis.RestartInstanceRequest import RestartInstanceRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = RestartInstanceRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 移除后端服务器 ''', + help=''' 对单台云物理服务器执行关机操作,只能停止running状态的服务器 [MFA enabled] ''', description=''' - 移除后端服务器。 + 对单台云物理服务器执行关机操作,只能停止running状态的服务器 [MFA enabled]。 - 示例: jdc cps remove-server --server-group-id xxx --server-id xxx + 示例: jdc cps stop-instance --instance-id xxx ''', ) - def remove_server(self): + def stop_instance(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.RemoveServerRequest import RemoveServerRequest + from jdcloud_sdk.services.cps.apis.StopInstanceRequest import StopInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RemoveServerRequest(params_dict, headers) + req = StopInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1808,34 +2860,32 @@ def remove_server(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), - (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), - (['--load-balancer-id'], dict(help="""(string) 负载均衡ID """, dest='loadBalancerId', required=False)), - (['--filters'], dict(help="""(array: filter) serverGroupId - 虚拟服务器组ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询虚拟服务器组列表 ''', + help=''' 对单台云物理服务器执行开机操作,只能启动stopped状态的服务器 ''', description=''' - 查询虚拟服务器组列表。 + 对单台云物理服务器执行开机操作,只能启动stopped状态的服务器。 - 示例: jdc cps describe-server-groups + 示例: jdc cps start-instance --instance-id xxx ''', ) - def describe_server_groups(self): + def start_instance(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeServerGroupsRequest import DescribeServerGroupsRequest + from jdcloud_sdk.services.cps.apis.StartInstanceRequest import StartInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeServerGroupsRequest(params_dict, headers) + req = StartInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1845,31 +2895,32 @@ def describe_server_groups(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--server-group-spec'], dict(help="""(serverGroupSpec) 虚拟服务器组配置 """, dest='serverGroupSpec', required=True)), + (['--instance-ids'], dict(help="""(array: string) 资源id列表 """, dest='instanceIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建虚拟服务器组 ''', + help=''' 批量重启云物理服务器,只能重启running状态的服务器 [MFA enabled] ''', description=''' - 创建虚拟服务器组。 + 批量重启云物理服务器,只能重启running状态的服务器 [MFA enabled]。 - 示例: jdc cps create-server-group --server-group-spec '{"":""}' + 示例: jdc cps restart-instances ''', ) - def create_server_group(self): + def restart_instances(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.CreateServerGroupRequest import CreateServerGroupRequest + from jdcloud_sdk.services.cps.apis.RestartInstancesRequest import RestartInstancesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateServerGroupRequest(params_dict, headers) + req = RestartInstancesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1879,30 +2930,32 @@ def create_server_group(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--instance-ids'], dict(help="""(array: string) 资源id列表 """, dest='instanceIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询虚拟服务器组 ''', + help=''' 批量关闭云物理服务器,只能停止running状态的服务器 [MFA enabled] ''', description=''' - 查询虚拟服务器组。 + 批量关闭云物理服务器,只能停止running状态的服务器 [MFA enabled]。 - 示例: jdc cps describe-server-group --server-group-id xxx + 示例: jdc cps stop-instances ''', ) - def describe_server_group(self): + def stop_instances(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeServerGroupRequest import DescribeServerGroupRequest + from jdcloud_sdk.services.cps.apis.StopInstancesRequest import StopInstancesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeServerGroupRequest(params_dict, headers) + req = StopInstancesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1912,31 +2965,32 @@ def describe_server_group(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), - (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--instance-ids'], dict(help="""(array: string) 资源id列表 """, dest='instanceIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改虚拟服务器组 ''', + help=''' 批量开启云物理服务器,只能启动stopped状态的服务器 ''', description=''' - 修改虚拟服务器组。 + 批量开启云物理服务器,只能启动stopped状态的服务器。 - 示例: jdc cps modify-server-group --server-group-id xxx + 示例: jdc cps start-instances ''', ) - def modify_server_group(self): + def start_instances(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.ModifyServerGroupRequest import ModifyServerGroupRequest + from jdcloud_sdk.services.cps.apis.StartInstancesRequest import StartInstancesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyServerGroupRequest(params_dict, headers) + req = StartInstancesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1946,30 +3000,33 @@ def modify_server_group(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeCPSLBRegions)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--server-group-id'], dict(help="""(string) 服务器组ID """, dest='serverGroupId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--instance-spec'], dict(help="""(reinstallInstanceSpec) 云物理服务器配置 """, dest='instanceSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除虚拟服务器组 ''', + help=''' 重装云物理服务器,只能重装stopped状态的服务器
; - 可调用接口(describeOS)获取云物理服务器支持的操作系统列表; [MFA enabled] ''', description=''' - 删除虚拟服务器组。 + 重装云物理服务器,只能重装stopped状态的服务器
; - 可调用接口(describeOS)获取云物理服务器支持的操作系统列表; [MFA enabled]。 - 示例: jdc cps delete-server-group --server-group-id xxx + 示例: jdc cps reinstall-instance --instance-id xxx --instance-spec '{"":""}' ''', ) - def delete_server_group(self): + def reinstall_instance(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DeleteServerGroupRequest import DeleteServerGroupRequest + from jdcloud_sdk.services.cps.apis.ReinstallInstanceRequest import ReinstallInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteServerGroupRequest(params_dict, headers) + req = ReinstallInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1980,29 +3037,32 @@ def delete_server_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--az'], dict(help="""(string) 可用区, 如cn-east-1a;可调用接口(describeRegiones)获取云物理服务器在该地域支持的可用区 """, dest='az', required=True)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--bandwidth'], dict(help="""(int) 外网带宽,单位Mbps,取值范围[1,200] """, dest='bandwidth', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询基础网络子网 ''', + help=''' 升级云物理服务器外网带宽,只能操作running或者stopped状态的服务器
; - 不支持未启用外网的服务器升级带宽; - 外网带宽不支持降级; ''', description=''' - 查询基础网络子网。 + 升级云物理服务器外网带宽,只能操作running或者stopped状态的服务器
; - 不支持未启用外网的服务器升级带宽; - 外网带宽不支持降级; 。 - 示例: jdc cps describe-basic-subnet --az xxx + 示例: jdc cps modify-bandwidth --instance-id xxx --bandwidth 5 ''', ) - def describe_basic_subnet(self): + def modify_bandwidth(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeBasicSubnetRequest import DescribeBasicSubnetRequest + from jdcloud_sdk.services.cps.apis.ModifyBandwidthRequest import ModifyBandwidthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBasicSubnetRequest(params_dict, headers) + req = ModifyBandwidthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2013,34 +3073,34 @@ def describe_basic_subnet(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), - (['--az'], dict(help="""(string) 可用区,精确匹配 """, dest='az', required=False)), - (['--name'], dict(help="""(string) 子网名称 """, dest='name', required=False)), - (['--vpc-id'], dict(help="""(string) 私有网络ID,精确匹配 """, dest='vpcId', required=False)), - (['--filters'], dict(help="""(array: filter) subnetId - 子网ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--elastic-ip-id'], dict(help="""(string) 弹性公网IPID """, dest='elasticIpId', required=True)), + (['--target-ip'], dict(help="""(string) 私有IP """, dest='targetIp', required=False)), + (['--subnet-id'], dict(help="""(string) 主网口或辅网口的子网ID,多网口实例必填 """, dest='subnetId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询子网列表 ''', + help=''' 绑定弹性公网IP; ''', description=''' - 查询子网列表。 + 绑定弹性公网IP; 。 - 示例: jdc cps describe-subnets + 示例: jdc cps associate-elastic-ip --instance-id xxx --elastic-ip-id xxx ''', ) - def describe_subnets(self): + def associate_elastic_ip(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeSubnetsRequest import DescribeSubnetsRequest + from jdcloud_sdk.services.cps.apis.AssociateElasticIpRequest import AssociateElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSubnetsRequest(params_dict, headers) + req = AssociateElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2051,30 +3111,32 @@ def describe_subnets(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--subnet-spec'], dict(help="""(subnetSpec) 子网配置 """, dest='subnetSpec', required=True)), + (['--elastic-ip-id'], dict(help="""(string) 弹性公网IPId """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建子网 ''', + help=''' 解绑弹性公网IP; ''', description=''' - 创建子网。 + 解绑弹性公网IP; 。 - 示例: jdc cps create-subnet --subnet-spec '{"":""}' + 示例: jdc cps disassociate-elastic-ip --instance-id xxx --elastic-ip-id xxx ''', ) - def create_subnet(self): + def disassociate_elastic_ip(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.CreateSubnetRequest import CreateSubnetRequest + from jdcloud_sdk.services.cps.apis.DisassociateElasticIpRequest import DisassociateElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateSubnetRequest(params_dict, headers) + req = DisassociateElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2085,29 +3147,32 @@ def create_subnet(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=True)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--password'], dict(help="""(string) 密码 """, dest='password', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询子网详情 ''', + help=''' 重置云物理服务器密码; ''', description=''' - 查询子网详情。 + 重置云物理服务器密码; 。 - 示例: jdc cps describe-subnet --subnet-id xxx + 示例: jdc cps reset-password --instance-id xxx --password xxx ''', ) - def describe_subnet(self): + def reset_password(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeSubnetRequest import DescribeSubnetRequest + from jdcloud_sdk.services.cps.apis.ResetPasswordRequest import ResetPasswordRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSubnetRequest(params_dict, headers) + req = ResetPasswordRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2118,31 +3183,31 @@ def describe_subnet(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=True)), - (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), - (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--subnet-id'], dict(help="""(string) 主网口或者辅网口的子网id """, dest='subnetId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改子网 ''', + help=''' 查询可用的私有IP列表 ''', description=''' - 修改子网。 + 查询可用的私有IP列表。 - 示例: jdc cps modify-subnet --subnet-id xxx + 示例: jdc cps describe-available-private-ip --instance-id xxx --subnet-id xxx ''', ) - def modify_subnet(self): + def describe_available_private_ip(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.ModifySubnetRequest import ModifySubnetRequest + from jdcloud_sdk.services.cps.apis.DescribeAvailablePrivateIpRequest import DescribeAvailablePrivateIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifySubnetRequest(params_dict, headers) + req = DescribeAvailablePrivateIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2153,30 +3218,33 @@ def modify_subnet(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=True)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--start-time'], dict(help="""(int) 开始时间的时间戳,格式:1562915166551 """, dest='startTime', type=int, required=False)), + (['--end-time'], dict(help="""(int) 结束时间的时间戳,格式:1562915166551 """, dest='endTime', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) metric - 监控指标,精确匹配,支持多个,具体如下
; cps.cpu.util - CPU使用率
; cps.memory.util - 内存使用率
; cps.memory.used - 内存使用量
; cps.disk.used - 磁盘使用量
; cps.disk.util - 磁盘使用率
; cps.disk.bytes.read - 磁盘读流量
; cps.disk.bytes.write - 磁盘写流量
; cps.disk.counts.read - 磁盘读IOPS
; cps.disk.counts.write - 磁盘写IOPS
; cps.network.bytes.ingress - 网卡进流量
; cps.network.bytes.egress - 网卡出流量
; cps.network.packets.ingress - 网络进包量
; cps.network.packets.egress - 网络出包量
; cps.avg.load1 - CPU平均负载1min
; cps.avg.load5 - CPU平均负载5min
; cps.avg.load15 - CPU平均负载15min
; cps.tcp.connect.total - TCP总连接数
; cps.tcp.connect.established - TCP正常连接数
; cps.process.total - 总进程数; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除子网 ''', + help=''' 查询云物理服务器监控信息 ''', description=''' - 删除子网。 + 查询云物理服务器监控信息。 - 示例: jdc cps delete-subnet --subnet-id xxx + 示例: jdc cps describe-instance-monitor-info --instance-id xxx ''', ) - def delete_subnet(self): + def describe_instance_monitor_info(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DeleteSubnetRequest import DeleteSubnetRequest + from jdcloud_sdk.services.cps.apis.DescribeInstanceMonitorInfoRequest import DescribeInstanceMonitorInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteSubnetRequest(params_dict, headers) + req = DescribeInstanceMonitorInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2187,29 +3255,32 @@ def delete_subnet(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--vpc-id'], dict(help="""(string) 私有网络ID """, dest='vpcId', required=True)), + (['--instance-id'], dict(help="""(string) 云物理服务器ID """, dest='instanceId', required=True)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询私有网络详情 ''', + help=''' 查询云物理服务器监控报警日志信息 ''', description=''' - 查询私有网络详情。 + 查询云物理服务器监控报警日志信息。 - 示例: jdc cps describe-vpc --vpc-id xxx + 示例: jdc cps describe-event-logs --instance-id xxx ''', ) - def describe_vpc(self): + def describe_event_logs(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeVpcRequest import DescribeVpcRequest + from jdcloud_sdk.services.cps.apis.DescribeEventLogsRequest import DescribeEventLogsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeVpcRequest(params_dict, headers) + req = DescribeEventLogsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2220,31 +3291,30 @@ def describe_vpc(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--vpc-id'], dict(help="""(string) 私有网络ID """, dest='vpcId', required=True)), - (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), - (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--route-table-id'], dict(help="""(string) 路由表ID """, dest='routeTableId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改私有网络; ''', + help=''' 查询路由表详情 ''', description=''' - 修改私有网络; 。 + 查询路由表详情。 - 示例: jdc cps modify-vpc --vpc-id xxx + 示例: jdc cps describe-route-table --route-table-id xxx ''', ) - def modify_vpc(self): + def describe_route_table(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.ModifyVpcRequest import ModifyVpcRequest + from jdcloud_sdk.services.cps.apis.DescribeRouteTableRequest import DescribeRouteTableRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyVpcRequest(params_dict, headers) + req = DescribeRouteTableRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2255,30 +3325,34 @@ def modify_vpc(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--vpc-id'], dict(help="""(string) 私有网络ID """, dest='vpcId', required=True)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), + (['--name'], dict(help="""(string) 名称 """, dest='name', required=False)), + (['--vpc-id'], dict(help="""(string) 私有网络ID,精确匹配 """, dest='vpcId', required=False)), + (['--filters'], dict(help="""(array: filter) routeTableId - 路由表ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除私有网络; ''', + help=''' 查询路由表列表 ''', description=''' - 删除私有网络; 。 + 查询路由表列表。 - 示例: jdc cps delete-vpc --vpc-id xxx + 示例: jdc cps describe-route-tables ''', ) - def delete_vpc(self): + def describe_route_tables(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DeleteVpcRequest import DeleteVpcRequest + from jdcloud_sdk.services.cps.apis.DescribeRouteTablesRequest import DescribeRouteTablesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVpcRequest(params_dict, headers) + req = DescribeRouteTablesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2288,33 +3362,30 @@ def delete_vpc(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[20, 100] """, dest='pageSize', type=int, required=False)), - (['--name'], dict(help="""(string) 私有网络名称 """, dest='name', required=False)), - (['--filters'], dict(help="""(array: filter) vpcId - 私有网络ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--network-type'], dict(help="""(string) 网络类型basic(基础网络)、vpc(私有网络)、retail(零售中台网络), 默认basic """, dest='networkType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询私有网络列表 ''', + help=''' 查询云物理服务器地域列表 ''', description=''' - 查询私有网络列表。 + 查询云物理服务器地域列表。 - 示例: jdc cps describe-vpcs + 示例: jdc cps describe-regiones ''', ) - def describe_vpcs(self): + def describe_regiones(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.DescribeVpcsRequest import DescribeVpcsRequest + from jdcloud_sdk.services.cps.apis.DescribeRegionesRequest import DescribeRegionesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeVpcsRequest(params_dict, headers) + req = DescribeRegionesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2324,31 +3395,29 @@ def describe_vpcs(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID,可调用接口(describeRegiones)获取云物理服务器支持的地域 """, dest='regionId', required=False)), - (['--client-token'], dict(help="""(string) 由客户端生成,用于保证请求的幂等性,长度不能超过36个字符;
; 如果多个请求使用了相同的clientToken,只会执行第一个请求,之后的请求直接返回第一个请求的结果
; """, dest='clientToken', required=False)), - (['--vpc-spec'], dict(help="""(vpcSpec) 子网配置 """, dest='vpcSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建私有网络 ''', + help=''' 查询负载均衡地域列表 ''', description=''' - 创建私有网络。 + 查询负载均衡地域列表。 - 示例: jdc cps create-vpc --vpc-spec '{"":""}' + 示例: jdc cps describe-cpslbregions ''', ) - def create_vpc(self): + def describe_cpslbregions(self): client_factory = ClientFactory('cps') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.cps.apis.CreateVpcRequest import CreateVpcRequest + from jdcloud_sdk.services.cps.apis.DescribeCPSLBRegionsRequest import DescribeCPSLBRegionsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVpcRequest(params_dict, headers) + req = DescribeCPSLBRegionsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2358,7 +3427,7 @@ def create_vpc(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-elastic-ips','apply-elastic-ips','describe-elastic-ip','modify-elastic-ip-bandwidth','describe-device-types','describe-os','describe-device-raids','describe-instance','describe-instances','create-instances','describe-instance-name','modify-instance','describe-instance-raid','describe-instance-status','restart-instance','stop-instance','start-instance','reinstall-instance','modify-bandwidth','associate-elastic-ip','disassociate-elastic-ip','reset-password','describe-instance-monitor-info','describe-keypairs','create-keypairs','import-keypairs','describe-keypair','delete-keypairs','describe-listeners','create-listener','modify-listener','describe-listener','delete-listener','start-listener','stop-listener','describe-load-balancers','create-load-balancer','modify-load-balancer','describe-load-balancer','start-load-balancer','stop-load-balancer','associate-elastic-ip-lb','disassociate-elastic-ip-lb','describe-regiones','describe-cpslbregions','describe-route-table','describe-route-tables','describe-servers','add-servers','modify-server','remove-server','describe-server-groups','create-server-group','describe-server-group','modify-server-group','delete-server-group','describe-basic-subnet','describe-subnets','create-subnet','describe-subnet','modify-subnet','delete-subnet','describe-vpc','modify-vpc','delete-vpc','describe-vpcs','create-vpc',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-ipv6address','describe-ipv6addresses','assign-ipv6addresses-bandwidth','modify-ipv6address-bandwidth','describe-certs','create-cert','describe-cert','remove-cert','modify-cert','describe-alias-ips','create-alias-ip','delete-alias-ip','describe-secondary-cidrs','create-secondary-cidr','delete-secondary-cidr','describe-elastic-ips','apply-elastic-ips','describe-elastic-ip','modify-elastic-ip-bandwidth','describe-elastic-ip-name','describe-server-groups','create-server-group','describe-server-group','modify-server-group','delete-server-group','describe-keypairs','create-keypairs','import-keypairs','describe-keypair','delete-keypairs','describe-load-balancers','create-load-balancer','modify-load-balancer','describe-load-balancer','start-load-balancer','stop-load-balancer','associate-elastic-ip-lb','disassociate-elastic-ip-lb','describe-slbs-name','describe-servers','add-servers','modify-server','remove-server','describe-ipv6gateways','describe-ipv6gateway','modify-ipv6gateway','describe-basic-subnet','describe-subnets','create-subnet','assign-ipv6cidr','describe-subnet','modify-subnet','delete-subnet','describe-vpc','modify-vpc','delete-vpc','describe-vpcs','create-vpc','assign-ipv6gateway','describe-listeners','create-listener','modify-listener','describe-listener','delete-listener','start-listener','stop-listener','describe-device-types','describe-os','describe-device-raids','describe-instance','describe-instances','create-instances','describe-instance-name','assign-ipv6address','modify-instance','describe-instance-raid','describe-instance-status','restart-instance','stop-instance','start-instance','restart-instances','stop-instances','start-instances','reinstall-instance','modify-bandwidth','associate-elastic-ip','disassociate-elastic-ip','reset-password','describe-available-private-ip','describe-instance-monitor-info','describe-event-logs','describe-route-table','describe-route-tables','describe-regiones','describe-cpslbregions',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/cr.py b/jdcloud_cli/controllers/services/cr.py deleted file mode 100644 index 2418cbc..0000000 --- a/jdcloud_cli/controllers/services/cr.py +++ /dev/null @@ -1,565 +0,0 @@ -# coding=utf8 - -# Copyright 2018 JDCLOUD.COM -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# NOTE: This class is auto generated by the jdcloud code generator program. - -from argparse import RawTextHelpFormatter -from jdcloud_cli.cement.ext.ext_argparse import expose -from jdcloud_cli.controllers.base_controller import BaseController -from jdcloud_cli.client_factory import ClientFactory -from jdcloud_cli.parameter_builder import collect_user_args, collect_user_headers -from jdcloud_cli.printer import Printer -from jdcloud_cli.skeleton import Skeleton - - -class CrController(BaseController): - class Meta: - label = 'cr' - help = '容器镜像仓库' - description = ''' - cr cli 子命令,容器镜像仓库服务。 - OpenAPI文档地址为:https://docs.jdcloud.com/cn/containerregistry/api/overview - ''' - stacked_on = 'base' - stacked_type = 'nested' - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--expired-after-hours'], dict(help="""(int) issue新token的过期时间, 可选参数为新生成令牌的过期时间,最大值为24小时,最小值为1小时,为空则默认为12小时过期时间。; """, dest='expiredAfterHours', type=int, required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help='''

申请12小时有效期的令牌。 使用docker CLI push和pull镜像。

;

authorizationToken为每个registry返回一个base64编码的字符串,解码后docker login命令; 可完成指定registry的鉴权。JCR CLI提供jcr get-login进行认证处理。

; ''', - description=''' -

申请12小时有效期的令牌。 使用docker CLI push和pull镜像。

;

authorizationToken为每个registry返回一个base64编码的字符串,解码后docker login命令; 可完成指定registry的鉴权。JCR CLI提供jcr get-login进行认证处理。

; 。 - - 示例: jdc cr get-authorization-token --registry-name xxx - ''', - ) - def get_authorization_token(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.GetAuthorizationTokenRequest import GetAuthorizationTokenRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = GetAuthorizationTokenRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--filters'], dict(help="""(array: filter) token - 令牌 ID,支持多个; """, dest='filters', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help='''

批量查询令牌。

;

暂时不支持分页和过滤条件。

; ''', - description=''' -

批量查询令牌。

;

暂时不支持分页和过滤条件。

; 。 - - 示例: jdc cr describe-authorization-tokens --registry-name xxx - ''', - ) - def describe_authorization_tokens(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.DescribeAuthorizationTokensRequest import DescribeAuthorizationTokensRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DescribeAuthorizationTokensRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--authorization-token'], dict(help="""(string) 准备释放的 token ID,功能为指定token释放。 """, dest='authorizationToken', required=False)), - (['--force-all'], dict(help="""(bool) true 表示强制删除用户当前registry下所有有效token的标志;false 表示删除所有有效token。 """, dest='forceAll', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 释放用户 registry 的 token。; ''', - description=''' - 释放用户 registry 的 token。; 。 - - 示例: jdc cr release-authorization-token --registry-name xxx - ''', - ) - def release_authorization_token(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.ReleaseAuthorizationTokenRequest import ReleaseAuthorizationTokenRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = ReleaseAuthorizationTokenRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--filters'], dict(help="""(array: filter) registryName - 镜像仓储名称 ; repositoryName - 镜像库名称 ; imageDigest - 镜像哈希值 ; imageTag - 镜像标签 ; tagStatus - 打标TAGGED或没打标UNTAGGED ; """, dest='filters', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 返回指定repository中images的元数据,包括image size, image tags和creation date。; ''', - description=''' - 返回指定repository中images的元数据,包括image size, image tags和creation date。; 。 - - 示例: jdc cr describe-images - ''', - ) - def describe_images(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.DescribeImagesRequest import DescribeImagesRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DescribeImagesRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--repository-name'], dict(help="""(string) 镜像仓库表名称 """, dest='repositoryName', required=True)), - (['--image-digest'], dict(help="""(string) sha256哈希,image manifest的digest. """, dest='imageDigest', required=False)), - (['--image-tag'], dict(help="""(string) image使用的tag """, dest='imageTag', required=False)), - (['--image-tag-status'], dict(help="""(string) 枚举中的一个值,如 tagged 和 untagged. """, dest='imageTagStatus', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 删除镜像; imageDigest imageTag imageTagStatus 三者只能且必须传一个。; 可根据Tag状态删除Image,例如删除所有tagged的镜像。; digest和tag唯一表征单个镜像,其中imageDigest为sha256哈希,image manifest的digest。; 例如 sha256:examplee6d1e504117a17000003d3753086354a38375961f2e665416ef4b1b2f;image使用的tag, 如 "precise" ; ''', - description=''' - 删除镜像; imageDigest imageTag imageTagStatus 三者只能且必须传一个。; 可根据Tag状态删除Image,例如删除所有tagged的镜像。; digest和tag唯一表征单个镜像,其中imageDigest为sha256哈希,image manifest的digest。; 例如 sha256:examplee6d1e504117a17000003d3753086354a38375961f2e665416ef4b1b2f;image使用的tag, 如 "precise" ; 。 - - 示例: jdc cr delete-image --registry-name xxx --repository-name xxx - ''', - ) - def delete_image(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.DeleteImageRequest import DeleteImageRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DeleteImageRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--filters'], dict(help="""(array: filter) resourceTypes - 资源类型,暂时只支持 [registry, repository],支持同时查询两种配额。; """, dest='filters', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查询配额 ''', - description=''' - 查询配额。 - - 示例: jdc cr describe-quotas - ''', - ) - def describe_quotas(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.DescribeQuotasRequest import DescribeQuotasRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DescribeQuotasRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 批量查询指定用户下所有 registry 详情。; 暂不支持 filter.; ''', - description=''' - 批量查询指定用户下所有 registry 详情。; 暂不支持 filter.; 。 - - 示例: jdc cr describe-registries - ''', - ) - def describe_registries(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.DescribeRegistriesRequest import DescribeRegistriesRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DescribeRegistriesRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 用户定义的registry名称。
DNS兼容registry名称规则如下:;
不可为空,且不能超过32字符
以小写字母开始和结尾,支持使用小写字母、数字、中划线(-); """, dest='registryName', required=True)), - (['--description'], dict(help="""(string) 注册表描述,参考公共参数规范。; """, dest='description', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 通过参数创建注册表。; ''', - description=''' - 通过参数创建注册表。; 。 - - 示例: jdc cr create-registry --registry-name xxx - ''', - ) - def create_registry(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.CreateRegistryRequest import CreateRegistryRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = CreateRegistryRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查询指定用户下某个 registry 详情。; ''', - description=''' - 查询指定用户下某个 registry 详情。; 。 - - 示例: jdc cr describe-registry --registry-name xxx - ''', - ) - def describe_registry(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.DescribeRegistryRequest import DescribeRegistryRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DescribeRegistryRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 删除指定用户下某个 registry.; ''', - description=''' - 删除指定用户下某个 registry.; 。 - - 示例: jdc cr delete-registry --registry-name xxx - ''', - ) - def delete_registry(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.DeleteRegistryRequest import DeleteRegistryRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DeleteRegistryRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 待验证的注册表名。 """, dest='registryName', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查询指定注册表名称是否已经存在以及是否符合命名规范。; ''', - description=''' - 查询指定注册表名称是否已经存在以及是否符合命名规范。; 。 - - 示例: jdc cr check-registry-name --registry-name xxx - ''', - ) - def check_registry_name(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.CheckRegistryNameRequest import CheckRegistryNameRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = CheckRegistryNameRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--repository-name'], dict(help="""(string) 镜像仓库名称。; 可以专有模式如默认命名空间nginx-web-app;或者和命名空间一起将多个仓库聚集在一起如 project-a/nginx-web-app。; """, dest='repositoryName', required=True)), - (['--description'], dict(help="""(string) 注册表描述,参考公共参数规范。; """, dest='description', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 通过参数创建镜像仓库。; 仓库名称可以分解为多个路径名,每个名称必须至少包含一个小写字母数字,考虑URL规范。; 支持包含段划线或者下划线进行分割,但不允许点'.',多个路径名之间通过("/")连接,总长度不超过256个字符,当前只支持二级目录。; ''', - description=''' - 通过参数创建镜像仓库。; 仓库名称可以分解为多个路径名,每个名称必须至少包含一个小写字母数字,考虑URL规范。; 支持包含段划线或者下划线进行分割,但不允许点'.',多个路径名之间通过("/")连接,总长度不超过256个字符,当前只支持二级目录。; 。 - - 示例: jdc cr create-repository --registry-name xxx --repository-name xxx - ''', - ) - def create_repository(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.CreateRepositoryRequest import CreateRepositoryRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = CreateRepositoryRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--filters'], dict(help="""(array: filter) name - 仓库名称,模糊匹配,支持单个; """, dest='filters', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 描述用户指定 registry 下的 repository.; ''', - description=''' - 描述用户指定 registry 下的 repository.; 。 - - 示例: jdc cr describe-repositories - ''', - ) - def describe_repositories(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.DescribeRepositoriesRequest import DescribeRepositoriesRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DescribeRepositoriesRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名称 """, dest='registryName', required=True)), - (['--repository-name'], dict(help="""(string) 镜像仓库名称 """, dest='repositoryName', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 删除指定用户下某个镜像仓库.; ''', - description=''' - 删除指定用户下某个镜像仓库.; 。 - - 示例: jdc cr delete-repository --registry-name xxx --repository-name xxx - ''', - ) - def delete_repository(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.DeleteRepositoryRequest import DeleteRepositoryRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DeleteRepositoryRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--registry-name'], dict(help="""(string) 注册表名。 """, dest='registryName', required=True)), - (['--repository-name'], dict(help="""(string) 待验证的镜像仓库名。 """, dest='repositoryName', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查询指定镜像仓库名称是否已经存在以及是否符合命名规范。; ''', - description=''' - 查询指定镜像仓库名称是否已经存在以及是否符合命名规范。; 。 - - 示例: jdc cr check-repository-name --registry-name xxx --repository-name xxx - ''', - ) - def check_repository_name(self): - client_factory = ClientFactory('cr') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.cr.apis.CheckRepositoryNameRequest import CheckRepositoryNameRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = CheckRepositoryNameRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['get-authorization-token','describe-authorization-tokens','release-authorization-token','describe-images','delete-image','describe-quotas','describe-registries','create-registry','describe-registry','delete-registry','check-registry-name','create-repository','describe-repositories','delete-repository','check-repository-name',], required=True)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 生成单个API接口的json骨架空字符串 ''', - description=''' - 生成单个API接口的json骨架空字符串。 - - 示例: jdc nc generate-skeleton --api describeContainer ''', - ) - def generate_skeleton(self): - skeleton = Skeleton('cr', self.app.pargs.api) - skeleton.show() diff --git a/jdcloud_cli/controllers/services/datastar.py b/jdcloud_cli/controllers/services/datastar.py index 624698d..ee6750a 100644 --- a/jdcloud_cli/controllers/services/datastar.py +++ b/jdcloud_cli/controllers/services/datastar.py @@ -46,6 +46,7 @@ class Meta: (['--first-index'], dict(help="""(string) 数据对应的第一级分析指标(可选一级指标以最终授权为准) """, dest='firstIndex', required=True)), (['--second-index'], dict(help="""(string) 数据对应的第二级分析指标,如不填写,则默认把一级指标下的所有二级指标都查询出来(可选二级指标以最终授权为准) """, dest='secondIndex', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, diff --git a/jdcloud_cli/controllers/services/deploy.py b/jdcloud_cli/controllers/services/deploy.py index 62c60bf..d972374 100644 --- a/jdcloud_cli/controllers/services/deploy.py +++ b/jdcloud_cli/controllers/services/deploy.py @@ -43,6 +43,7 @@ class Meta: (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--filters'], dict(help="""(array: filter) appId - 应用ID,精确匹配; appName - 应用名,精确匹配; platform - 部署平台,精确匹配; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -76,6 +77,7 @@ def describe_apps(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--app-id'], dict(help="""(string) App Id """, dest='appId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -107,42 +109,32 @@ def describe_app(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--group-id'], dict(help="""(string) 部署组ID,部署组的唯一标识 """, dest='groupId', required=True)), - (['--desc'], dict(help="""(string) 描述 """, dest='desc', required=False)), - (['--deploy-source'], dict(help="""(int) 部署来源:1url,2云编译,3云存储 """, dest='deploySource', type=int, required=True)), - (['--deploy-cmd'], dict(help="""(string) 部署操作 """, dest='deployCmd', required=False)), - (['--cmd-source'], dict(help="""(int) 1使用输入的操作,2使用程序自带操作 """, dest='cmdSource', type=int, required=False)), - (['--cmd-type'], dict(help="""(int) 部署操作展示格式:1form,2ymal """, dest='cmdType', type=int, required=False)), - (['--product-type'], dict(help="""(int) 项目类型 1tomcat,2 """, dest='productType', type=int, required=False)), - (['--download-url'], dict(help="""(string) 下载url """, dest='downloadUrl', required=False)), - (['--md5'], dict(help="""(string) md5 """, dest='md5', required=False)), - (['--compile-project'], dict(help="""(string) 云编译项目名 """, dest='compileProject', required=False)), - (['--compile-series'], dict(help="""(string) 云编译构建序号 """, dest='compileSeries', required=False)), - (['--oss-space'], dict(help="""(string) 云存储空间 """, dest='ossSpace', required=False)), - (['--oss-dir'], dict(help="""(string) 云存储目录 """, dest='ossDir', required=False)), - (['--file-type'], dict(help="""(int) 文件类型:1.tar,2.zip,3.tar.gz """, dest='fileType', type=int, required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) appId - 应用ID,精确匹配; groupId - 部署组ID,精确匹配; groupName - 部署组名,精确匹配; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建部署任务 ''', + help=''' 批量查询部署组的信息,此接口支持分页查询,默认每页20条 ''', description=''' - 创建部署任务。 + 批量查询部署组的信息,此接口支持分页查询,默认每页20条。 - 示例: jdc deploy create-deploy --group-id xxx --deploy-source 0 + 示例: jdc deploy describe-groups ''', ) - def create_deploy(self): + def describe_groups(self): client_factory = ClientFactory('deploy') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.deploy.apis.CreateDeployRequest import CreateDeployRequest + from jdcloud_sdk.services.deploy.apis.DescribeGroupsRequest import DescribeGroupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateDeployRequest(params_dict, headers) + req = DescribeGroupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -153,29 +145,30 @@ def create_deploy(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--deploy-id'], dict(help="""(string) Deploy Id """, dest='deployId', required=True)), + (['--group-id'], dict(help="""(string) Group Id """, dest='groupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询一个部署任务详情 ''', + help=''' 查询一个部署组的信息 ''', description=''' - 查询一个部署任务详情。 + 查询一个部署组的信息。 - 示例: jdc deploy describe-deploy --deploy-id xxx + 示例: jdc deploy describe-group --group-id xxx ''', ) - def describe_deploy(self): + def describe_group(self): client_factory = ClientFactory('deploy') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.deploy.apis.DescribeDeployRequest import DescribeDeployRequest + from jdcloud_sdk.services.deploy.apis.DescribeGroupRequest import DescribeGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDeployRequest(params_dict, headers) + req = DescribeGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -186,31 +179,43 @@ def describe_deploy(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) appId - 应用ID,精确匹配; groupId - 部署组ID,精确匹配; groupName - 部署组名,精确匹配; """, dest='filters', required=False)), + (['--group-id'], dict(help="""(string) 部署组ID,部署组的唯一标识 """, dest='groupId', required=True)), + (['--desc'], dict(help="""(string) 描述 """, dest='desc', required=False)), + (['--deploy-source'], dict(help="""(int) 部署来源:1url,2云编译,3云存储 """, dest='deploySource', type=int, required=True)), + (['--deploy-cmd'], dict(help="""(string) 部署操作 """, dest='deployCmd', required=False)), + (['--cmd-source'], dict(help="""(int) 1使用输入的操作,2使用程序自带操作 """, dest='cmdSource', type=int, required=False)), + (['--cmd-type'], dict(help="""(int) 部署操作展示格式:1form,2ymal """, dest='cmdType', type=int, required=False)), + (['--product-type'], dict(help="""(int) 项目类型 1tomcat,2 """, dest='productType', type=int, required=False)), + (['--download-url'], dict(help="""(string) 下载url """, dest='downloadUrl', required=False)), + (['--md5'], dict(help="""(string) md5 """, dest='md5', required=False)), + (['--compile-project'], dict(help="""(string) 云编译项目名 """, dest='compileProject', required=False)), + (['--compile-series'], dict(help="""(string) 云编译构建序号 """, dest='compileSeries', required=False)), + (['--oss-space'], dict(help="""(string) 云存储空间 """, dest='ossSpace', required=False)), + (['--oss-dir'], dict(help="""(string) 云存储目录 """, dest='ossDir', required=False)), + (['--file-type'], dict(help="""(int) 文件类型:1.tar,2.zip,3.tar.gz """, dest='fileType', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量查询部署组的信息,此接口支持分页查询,默认每页20条 ''', + help=''' 创建部署任务 ''', description=''' - 批量查询部署组的信息,此接口支持分页查询,默认每页20条。 + 创建部署任务。 - 示例: jdc deploy describe-groups + 示例: jdc deploy create-deploy --group-id xxx --deploy-source 5 ''', ) - def describe_groups(self): + def create_deploy(self): client_factory = ClientFactory('deploy') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.deploy.apis.DescribeGroupsRequest import DescribeGroupsRequest + from jdcloud_sdk.services.deploy.apis.CreateDeployRequest import CreateDeployRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeGroupsRequest(params_dict, headers) + req = CreateDeployRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -221,29 +226,30 @@ def describe_groups(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--group-id'], dict(help="""(string) Group Id """, dest='groupId', required=True)), + (['--deploy-id'], dict(help="""(string) Deploy Id """, dest='deployId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询一个部署组的信息 ''', + help=''' 查询一个部署任务详情 ''', description=''' - 查询一个部署组的信息。 + 查询一个部署任务详情。 - 示例: jdc deploy describe-group --group-id xxx + 示例: jdc deploy describe-deploy --deploy-id xxx ''', ) - def describe_group(self): + def describe_deploy(self): client_factory = ClientFactory('deploy') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.deploy.apis.DescribeGroupRequest import DescribeGroupRequest + from jdcloud_sdk.services.deploy.apis.DescribeDeployRequest import DescribeDeployRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeGroupRequest(params_dict, headers) + req = DescribeDeployRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -253,7 +259,7 @@ def describe_group(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-apps','describe-app','create-deploy','describe-deploy','describe-groups','describe-group',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-apps','describe-app','describe-groups','describe-group','create-deploy','describe-deploy',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/detection.py b/jdcloud_cli/controllers/services/detection.py index 900aa62..53b6741 100644 --- a/jdcloud_cli/controllers/services/detection.py +++ b/jdcloud_cli/controllers/services/detection.py @@ -38,29 +38,39 @@ class Meta: @expose( arguments=[ - (['--filters'], dict(help="""(array: filter) agent id列表; uuid - agent id,精确匹配,支持多个 """, dest='filters', required=True)), + (['--name-or-addr'], dict(help="""(string) NA """, dest='nameOrAddr', required=False)), + (['--name'], dict(help="""(string) NA """, dest='name', required=False)), + (['--id'], dict(help="""(array: string) NA """, dest='id', required=False)), + (['--task-type'], dict(help="""(string) NA """, dest='taskType', required=False)), + (['--page-number'], dict(help="""(int) NA """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) NA """, dest='pageSize', type=int, required=False)), + (['--with-stats'], dict(help="""(string) NA """, dest='withStats', required=False)), + (['--with-deleted'], dict(help="""(string) 1:包含删除对象,默认:0 """, dest='withDeleted', required=False)), + (['--time-interval'], dict(help="""(string) 查询的可用率、响应时间的时间间隔,最大不超过30天,支持分钟级别,小时级别,天级别,例如:1m、1h、1d """, dest='timeInterval', required=False)), + (['--filters'], dict(help="""(array: filter) name为'id' - 站点监控id """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询可用性监控agent状态 ''', + help=''' 获取站点监控任务信息 ''', description=''' - 查询可用性监控agent状态。 + 获取站点监控任务信息。 - 示例: jdc detection describe-agent-status --filters ['{"":""}'] + 示例: jdc detection get-site-monitor ''', ) - def describe_agent_status(self): + def get_site_monitor(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.DescribeAgentStatusRequest import DescribeAgentStatusRequest + from jdcloud_sdk.services.detection.apis.GetSiteMonitorRequest import GetSiteMonitorRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAgentStatusRequest(params_dict, headers) + req = GetSiteMonitorRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -70,32 +80,53 @@ def describe_agent_status(self): @expose( arguments=[ - (['--resource-id'], dict(help="""(string) 资源的uuid """, dest='resourceId', required=True)), - (['--start-time'], dict(help="""(string) 查询时间范围的开始时间, UTC时间,格式:2016-12-11T00:00:00+0800(早于30d时,将被重置为30d)(注意在url中+要转译为%2B故url中为2016-12-11T00:00:00%2B0800) """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询时间范围的结束时间, UTC时间,格式:2016-12-11T00:00:00+0800(为空时,将由startTime与timeInterval计算得出)(注意在url中+要转译为%2B故url中为2016-12-11T00:00:00%2B0800) """, dest='endTime', required=False)), - (['--time-interval'], dict(help="""(string) 时间间隔:1h,6h,12h,1d,3d,7d,14d,固定时间间隔,timeInterval 与 endTime 至少填一项 """, dest='timeInterval', required=False)), + (['--address'], dict(help="""(string) 地址 """, dest='address', required=True)), + (['--advance-checked'], dict(help="""(string) NA """, dest='advanceChecked', required=False)), + (['--created-time'], dict(help="""(int) NA """, dest='createdTime', type=int, required=False)), + (['--cycle'], dict(help="""(int) 探测频率 """, dest='cycle', type=int, required=True)), + (['--default-source'], dict(help="""(string) NA """, dest='defaultSource', required=False)), + (['--dns-option'], dict(help="""(siteMonitorDnsOption) NA """, dest='dnsOption', required=False)), + (['--enabled'], dict(help="""(string) NA """, dest='enabled', required=False)), + (['--ftp-option'], dict(help="""(siteMonitorFtpOption) NA """, dest='ftpOption', required=False)), + (['--hawkeye-id'], dict(help="""(int) NA """, dest='hawkeyeId', type=int, required=False)), + (['--http-option'], dict(help="""(siteMonitorHttpOption) NA """, dest='httpOption', required=False)), + (['--id'], dict(help="""(string) NA """, dest='id', required=False)), + (['--is-deleted'], dict(help="""(string) NA """, dest='isDeleted', required=False)), + (['--name'], dict(help="""(string) 任务名称 """, dest='name', required=True)), + (['--pin'], dict(help="""(string) NA """, dest='pin', required=False)), + (['--ping-option'], dict(help="""(siteMonitorPingOption) NA """, dest='pingOption', required=False)), + (['--pop3option'], dict(help="""(siteMonitorPop3Option) NA """, dest='pop3Option', required=False)), + (['--port'], dict(help="""(string) 端口 """, dest='port', required=False)), + (['--smtp-option'], dict(help="""(siteMonitorSmtpOption) NA """, dest='smtpOption', required=False)), + (['--source'], dict(help="""(array: siteMonitorSource) 探测源 """, dest='source', required=True)), + (['--stats'], dict(help="""(object) NA """, dest='stats', required=False)), + (['--task-type'], dict(help="""(string) 任务类型,可选值:HTTP、PING 、TCP 、UDP、DNS、SMTP、POP3和FTP """, dest='taskType', required=True)), + (['--tcp-option'], dict(help="""(siteMonitorTcpOption) NA """, dest='tcpOption', required=False)), + (['--udp-option'], dict(help="""(siteMonitorUdpOption) NA """, dest='udpOption', required=False)), + (['--updated-time'], dict(help="""(int) NA """, dest='updatedTime', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看可用性监控任务的监控数据 ''', + help=''' 创建站点监控任务 ''', description=''' - 查看可用性监控任务的监控数据。 + 创建站点监控任务。 - 示例: jdc detection describe-metric-data-am --resource-id xxx + 示例: jdc detection create-site-monitor --address xxx --cycle 5 --name xxx --source ['{"":""}'] --task-type xxx ''', ) - def describe_metric_data_am(self): + def create_site_monitor(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.DescribeMetricDataAmRequest import DescribeMetricDataAmRequest + from jdcloud_sdk.services.detection.apis.CreateSiteMonitorRequest import CreateSiteMonitorRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeMetricDataAmRequest(params_dict, headers) + req = CreateSiteMonitorRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -105,30 +136,53 @@ def describe_metric_data_am(self): @expose( arguments=[ - (['--client-token'], dict(help="""(string) 幂等性校验参数,最长36位 """, dest='clientToken', required=True)), - (['--create-probe-task-spec'], dict(help="""(createProbeTaskParam) NA """, dest='createProbeTaskSpec', required=True)), + (['--address'], dict(help="""(string) 地址 """, dest='address', required=True)), + (['--advance-checked'], dict(help="""(string) NA """, dest='advanceChecked', required=False)), + (['--created-time'], dict(help="""(int) NA """, dest='createdTime', type=int, required=False)), + (['--cycle'], dict(help="""(int) 探测频率 """, dest='cycle', type=int, required=True)), + (['--default-source'], dict(help="""(string) NA """, dest='defaultSource', required=False)), + (['--dns-option'], dict(help="""(siteMonitorDnsOption) NA """, dest='dnsOption', required=False)), + (['--enabled'], dict(help="""(string) NA """, dest='enabled', required=False)), + (['--ftp-option'], dict(help="""(siteMonitorFtpOption) NA """, dest='ftpOption', required=False)), + (['--hawkeye-id'], dict(help="""(int) NA """, dest='hawkeyeId', type=int, required=False)), + (['--http-option'], dict(help="""(siteMonitorHttpOption) NA """, dest='httpOption', required=False)), + (['--id'], dict(help="""(string) NA """, dest='id', required=False)), + (['--is-deleted'], dict(help="""(string) NA """, dest='isDeleted', required=False)), + (['--name'], dict(help="""(string) 任务名称 """, dest='name', required=True)), + (['--pin'], dict(help="""(string) NA """, dest='pin', required=False)), + (['--ping-option'], dict(help="""(siteMonitorPingOption) NA """, dest='pingOption', required=False)), + (['--pop3option'], dict(help="""(siteMonitorPop3Option) NA """, dest='pop3Option', required=False)), + (['--port'], dict(help="""(string) 端口 """, dest='port', required=False)), + (['--smtp-option'], dict(help="""(siteMonitorSmtpOption) NA """, dest='smtpOption', required=False)), + (['--source'], dict(help="""(array: siteMonitorSource) 探测源 """, dest='source', required=True)), + (['--stats'], dict(help="""(object) NA """, dest='stats', required=False)), + (['--task-type'], dict(help="""(string) 任务类型,可选值:HTTP、PING 、TCP 、UDP、DNS、SMTP、POP3和FTP """, dest='taskType', required=True)), + (['--tcp-option'], dict(help="""(siteMonitorTcpOption) NA """, dest='tcpOption', required=False)), + (['--udp-option'], dict(help="""(siteMonitorUdpOption) NA """, dest='udpOption', required=False)), + (['--updated-time'], dict(help="""(int) NA """, dest='updatedTime', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建可用性监控任务 ''', + help=''' 修改站点监控任务 ''', description=''' - 创建可用性监控任务。 + 修改站点监控任务。 - 示例: jdc detection create-probe-task --client-token xxx --create-probe-task-spec '{"":""}' + 示例: jdc detection update-site-monitor --address xxx --cycle 5 --name xxx --source ['{"":""}'] --task-type xxx ''', ) - def create_probe_task(self): + def update_site_monitor(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.CreateProbeTaskRequest import CreateProbeTaskRequest + from jdcloud_sdk.services.detection.apis.UpdateSiteMonitorRequest import UpdateSiteMonitorRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateProbeTaskRequest(params_dict, headers) + req = UpdateSiteMonitorRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -138,29 +192,30 @@ def create_probe_task(self): @expose( arguments=[ - (['--probe-task-ids'], dict(help="""(string) 探测任务的task_id,多个taskId用|分隔 """, dest='probeTaskIDs', required=True)), + (['--filters'], dict(help="""(array: filter) name为'list' - 站点监控id """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除可用性监控任务 ''', + help=''' 删除站点监控任务 ''', description=''' - 删除可用性监控任务。 + 删除站点监控任务。 - 示例: jdc detection delete-probe-task --probe-task-ids xxx + 示例: jdc detection delete-site-monitor ''', ) - def delete_probe_task(self): + def delete_site_monitor(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.DeleteProbeTaskRequest import DeleteProbeTaskRequest + from jdcloud_sdk.services.detection.apis.DeleteSiteMonitorRequest import DeleteSiteMonitorRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteProbeTaskRequest(params_dict, headers) + req = DeleteSiteMonitorRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -170,29 +225,30 @@ def delete_probe_task(self): @expose( arguments=[ - (['--probe-task-id'], dict(help="""(string) 探测任务的task_id """, dest='probeTaskID', required=True)), + (['--list'], dict(help="""(array: enableSiteMonitorReqItem) NA """, dest='list', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询可用性监控任务信息 ''', + help=''' 启停站点监控任务 ''', description=''' - 查询可用性监控任务信息。 + 启停站点监控任务。 - 示例: jdc detection describe-probe-task --probe-task-id xxx + 示例: jdc detection enable-site-monitor ''', ) - def describe_probe_task(self): + def enable_site_monitor(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.DescribeProbeTaskRequest import DescribeProbeTaskRequest + from jdcloud_sdk.services.detection.apis.EnableSiteMonitorRequest import EnableSiteMonitorRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeProbeTaskRequest(params_dict, headers) + req = EnableSiteMonitorRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -202,35 +258,30 @@ def describe_probe_task(self): @expose( arguments=[ - (['--probe-task-id'], dict(help="""(string) 探测任务的task_id """, dest='probeTaskID', required=True)), - (['--http-body'], dict(help="""(string) http body:选择探测类型为1=http时有效,最长不超过1024字节 """, dest='httpBody', required=False)), - (['--http-cookie'], dict(help="""(array: keyValue) http cookie:选择探测类型为1=http时有效,最大允许20个key、value对,最长不超过1024字节 """, dest='httpCookie', required=False)), - (['--http-header'], dict(help="""(array: keyValue) http header:选择探测类型为1=http时有效,最大允许20个key、value对,最长不超过1024字节 """, dest='httpHeader', required=False)), - (['--http-type'], dict(help="""(int) http探测方法,可选值:1:get、2:post、3:head """, dest='httpType', type=int, required=False)), - (['--name'], dict(help="""(string) task名称,不允许重复,长度不超过32字符,只允许中英文、数字、下划线_、中划线-, [0-9][a-z] [A-Z] [- _ ] """, dest='name', required=False)), - (['--probes'], dict(help="""(array: probe) 探测源(发起对探测目标探测的云主机,需安装相应的agent才能探测) """, dest='probes', required=True)), + (['--address'], dict(help="""(string) NA """, dest='address', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改可用性监控任务 ''', + help=''' 检测站点监控地址是否有效 ''', description=''' - 修改可用性监控任务。 + 检测站点监控地址是否有效。 - 示例: jdc detection update-probe-task --probe-task-id xxx --probes ['{"":""}'] + 示例: jdc detection validate-site-monitor-address ''', ) - def update_probe_task(self): + def validate_site_monitor_address(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.UpdateProbeTaskRequest import UpdateProbeTaskRequest + from jdcloud_sdk.services.detection.apis.ValidateSiteMonitorAddressRequest import ValidateSiteMonitorAddressRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateProbeTaskRequest(params_dict, headers) + req = ValidateSiteMonitorAddressRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -240,32 +291,32 @@ def update_probe_task(self): @expose( arguments=[ - (['--probe-task-id'], dict(help="""(string) 可用性监控task_id, id长度(0,50] """, dest='probeTaskID', required=True)), - (['--probe-id'], dict(help="""(string) 探测源id, id长度(0,50] """, dest='probeID', required=True)), - (['--start-time'], dict(help="""(string) 查询时间范围的开始时间, UTC时间,格式:2016-12-11T00:00:00+0800(默认为当前时间往前三天,早于3d时,将被重置为3d)(注意在url中+要转译为%2B故url中为2016-12-11T00:00:00%2B0800) """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询时间范围的结束时间, UTC时间,格式:2016-12-11T00:00:00+0800(为空时,默认为当前时间)(注意在url中+要转译为%2B故url中为2016-12-11T00:00:00%2B0800) """, dest='endTime', required=False)), + (['--id'], dict(help="""(string) NA """, dest='id', required=False)), + (['--start-time'], dict(help="""(string) NA """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) NA """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询可用性监控任务的指定探测源的异常探测历史 ''', + help=''' 获取站点监控数据 ''', description=''' - 查询可用性监控任务的指定探测源的异常探测历史。 + 获取站点监控数据。 - 示例: jdc detection describe-probe-history --probe-task-id xxx --probe-id xxx + 示例: jdc detection get-site-monitor-data-points ''', ) - def describe_probe_history(self): + def get_site_monitor_data_points(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.DescribeProbeHistoryRequest import DescribeProbeHistoryRequest + from jdcloud_sdk.services.detection.apis.GetSiteMonitorDataPointsRequest import GetSiteMonitorDataPointsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeProbeHistoryRequest(params_dict, headers) + req = GetSiteMonitorDataPointsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -275,30 +326,29 @@ def describe_probe_history(self): @expose( arguments=[ - (['--probe-task-id'], dict(help="""(string) 探测任务的task_id """, dest='probeTaskID', required=True)), - (['--filters'], dict(help="""(array: filter) 自定义标签 """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询可用性监控任务的探测源列表 ''', + help=''' 获取站点监控探针列表 ''', description=''' - 查询可用性监控任务的探测源列表。 + 获取站点监控探针列表。 - 示例: jdc detection discribe-probes --probe-task-id xxx + 示例: jdc detection get-site-monitor-source ''', ) - def discribe_probes(self): + def get_site_monitor_source(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.DiscribeProbesRequest import DiscribeProbesRequest + from jdcloud_sdk.services.detection.apis.GetSiteMonitorSourceRequest import GetSiteMonitorSourceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DiscribeProbesRequest(params_dict, headers) + req = GetSiteMonitorSourceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -308,30 +358,53 @@ def discribe_probes(self): @expose( arguments=[ - (['--enabled'], dict(help="""(bool) 默认:禁用; true:启用,false:禁用 """, dest='enabled', required=False)), - (['--task-id'], dict(help="""(array: string) 要启用或禁用的探测任务的task_id列表,列表长度[1,100) """, dest='taskId', required=False)), + (['--address'], dict(help="""(string) 地址 """, dest='address', required=True)), + (['--advance-checked'], dict(help="""(string) NA """, dest='advanceChecked', required=False)), + (['--created-time'], dict(help="""(int) NA """, dest='createdTime', type=int, required=False)), + (['--cycle'], dict(help="""(int) 探测频率 """, dest='cycle', type=int, required=True)), + (['--default-source'], dict(help="""(string) NA """, dest='defaultSource', required=False)), + (['--dns-option'], dict(help="""(siteMonitorDnsOption) NA """, dest='dnsOption', required=False)), + (['--enabled'], dict(help="""(string) NA """, dest='enabled', required=False)), + (['--ftp-option'], dict(help="""(siteMonitorFtpOption) NA """, dest='ftpOption', required=False)), + (['--hawkeye-id'], dict(help="""(int) NA """, dest='hawkeyeId', type=int, required=False)), + (['--http-option'], dict(help="""(siteMonitorHttpOption) NA """, dest='httpOption', required=False)), + (['--id'], dict(help="""(string) NA """, dest='id', required=False)), + (['--is-deleted'], dict(help="""(string) NA """, dest='isDeleted', required=False)), + (['--name'], dict(help="""(string) 任务名称 """, dest='name', required=True)), + (['--pin'], dict(help="""(string) NA """, dest='pin', required=False)), + (['--ping-option'], dict(help="""(siteMonitorPingOption) NA """, dest='pingOption', required=False)), + (['--pop3option'], dict(help="""(siteMonitorPop3Option) NA """, dest='pop3Option', required=False)), + (['--port'], dict(help="""(string) 端口 """, dest='port', required=False)), + (['--smtp-option'], dict(help="""(siteMonitorSmtpOption) NA """, dest='smtpOption', required=False)), + (['--source'], dict(help="""(array: siteMonitorSource) 探测源 """, dest='source', required=True)), + (['--stats'], dict(help="""(object) NA """, dest='stats', required=False)), + (['--task-type'], dict(help="""(string) 任务类型,可选值:HTTP、PING 、TCP 、UDP、DNS、SMTP、POP3和FTP """, dest='taskType', required=True)), + (['--tcp-option'], dict(help="""(siteMonitorTcpOption) NA """, dest='tcpOption', required=False)), + (['--udp-option'], dict(help="""(siteMonitorUdpOption) NA """, dest='udpOption', required=False)), + (['--updated-time'], dict(help="""(int) NA """, dest='updatedTime', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启用、禁用可用性监控任务 ''', + help=''' 测试站点监控参数 ''', description=''' - 启用、禁用可用性监控任务。 + 测试站点监控参数。 - 示例: jdc detection probe-task-enable + 示例: jdc detection test-site-monitor --address xxx --cycle 5 --name xxx --source ['{"":""}'] --task-type xxx ''', ) - def probe_task_enable(self): + def test_site_monitor(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.ProbeTaskEnableRequest import ProbeTaskEnableRequest + from jdcloud_sdk.services.detection.apis.TestSiteMonitorRequest import TestSiteMonitorRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ProbeTaskEnableRequest(params_dict, headers) + req = TestSiteMonitorRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -341,37 +414,30 @@ def probe_task_enable(self): @expose( arguments=[ - (['--page-number'], dict(help="""(int) 当前所在页,默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 页面大小,默认为20;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), - (['--name'], dict(help="""(string) 根据探测任务的名称查询,支持模糊查询 """, dest='name', required=False)), - (['--type'], dict(help="""(int) 根据探测任务的类型查询,1、http 2、telnet """, dest='type', type=int, required=False)), - (['--time-interval'], dict(help="""(string) 查询的可用率、响应时间的时间间隔,为空时默认查询最新点,最大不超过30天,支持分钟级别,小时级别,天级别,例如:1m、1h、1d """, dest='timeInterval', required=False)), - (['--with-stats'], dict(help="""(bool) 是否查询可用率、响应时间 """, dest='withStats', required=False)), - (['--with-deleted'], dict(help="""(bool) 是否包含被删除的task """, dest='withDeleted', required=False)), - (['--enabled'], dict(help="""(int) 任务状态:1为启用,0为禁用。默认为查所有的 """, dest='enabled', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) taskId - taskId,精确匹配,支持多个; name - task名称或探测地址,糊模匹配,支持单个 """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) agent id列表; uuid - agent id,精确匹配,支持多个 """, dest='filters', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询可用性监控任务列表 ''', + help=''' 查询可用性监控agent状态 ''', description=''' - 查询可用性监控任务列表。 + 查询可用性监控agent状态。 - 示例: jdc detection describe-probe-tasks + 示例: jdc detection describe-agent-status --filters ['{"":""}'] ''', ) - def describe_probe_tasks(self): + def describe_agent_status(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.DescribeProbeTasksRequest import DescribeProbeTasksRequest + from jdcloud_sdk.services.detection.apis.DescribeAgentStatusRequest import DescribeAgentStatusRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeProbeTasksRequest(params_dict, headers) + req = DescribeAgentStatusRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -381,38 +447,33 @@ def describe_probe_tasks(self): @expose( arguments=[ - (['--name-or-addr'], dict(help="""(string) NA """, dest='nameOrAddr', required=False)), - (['--name'], dict(help="""(string) NA """, dest='name', required=False)), - (['--id'], dict(help="""(array: string) NA """, dest='id', required=False)), - (['--task-type'], dict(help="""(string) NA """, dest='taskType', required=False)), - (['--page-number'], dict(help="""(int) NA """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) NA """, dest='pageSize', type=int, required=False)), - (['--with-stats'], dict(help="""(string) NA """, dest='withStats', required=False)), - (['--with-deleted'], dict(help="""(string) 1:包含删除对象,默认:0 """, dest='withDeleted', required=False)), - (['--time-interval'], dict(help="""(string) 查询的可用率、响应时间的时间间隔,最大不超过30天,支持分钟级别,小时级别,天级别,例如:1m、1h、1d """, dest='timeInterval', required=False)), - (['--filters'], dict(help="""(array: filter) name为'id' - 站点监控id """, dest='filters', required=False)), + (['--resource-id'], dict(help="""(string) 资源的uuid """, dest='resourceId', required=True)), + (['--start-time'], dict(help="""(string) 查询时间范围的开始时间, UTC时间,格式:2016-12-11T00:00:00+0800(早于30d时,将被重置为30d)(注意在url中+要转译为%2B故url中为2016-12-11T00:00:00%2B0800) """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询时间范围的结束时间, UTC时间,格式:2016-12-11T00:00:00+0800(为空时,将由startTime与timeInterval计算得出)(注意在url中+要转译为%2B故url中为2016-12-11T00:00:00%2B0800) """, dest='endTime', required=False)), + (['--time-interval'], dict(help="""(string) 时间间隔:1h,6h,12h,1d,3d,7d,14d,固定时间间隔,timeInterval 与 endTime 至少填一项 """, dest='timeInterval', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取站点监控任务信息 ''', + help=''' 查看可用性监控任务的监控数据 ''', description=''' - 获取站点监控任务信息。 + 查看可用性监控任务的监控数据。 - 示例: jdc detection get-site-monitor + 示例: jdc detection describe-metric-data-am --resource-id xxx ''', ) - def get_site_monitor(self): + def describe_metric_data_am(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.GetSiteMonitorRequest import GetSiteMonitorRequest + from jdcloud_sdk.services.detection.apis.DescribeMetricDataAmRequest import DescribeMetricDataAmRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetSiteMonitorRequest(params_dict, headers) + req = DescribeMetricDataAmRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -422,52 +483,31 @@ def get_site_monitor(self): @expose( arguments=[ - (['--address'], dict(help="""(string) 地址 """, dest='address', required=True)), - (['--advance-checked'], dict(help="""(string) NA """, dest='advanceChecked', required=False)), - (['--created-time'], dict(help="""(int) NA """, dest='createdTime', type=int, required=False)), - (['--cycle'], dict(help="""(int) 探测频率 """, dest='cycle', type=int, required=True)), - (['--default-source'], dict(help="""(string) NA """, dest='defaultSource', required=False)), - (['--dns-option'], dict(help="""(siteMonitorDnsOption) NA """, dest='dnsOption', required=False)), - (['--enabled'], dict(help="""(string) NA """, dest='enabled', required=False)), - (['--ftp-option'], dict(help="""(siteMonitorFtpOption) NA """, dest='ftpOption', required=False)), - (['--hawkeye-id'], dict(help="""(int) NA """, dest='hawkeyeId', type=int, required=False)), - (['--http-option'], dict(help="""(siteMonitorHttpOption) NA """, dest='httpOption', required=False)), - (['--id'], dict(help="""(string) NA """, dest='id', required=False)), - (['--is-deleted'], dict(help="""(string) NA """, dest='isDeleted', required=False)), - (['--name'], dict(help="""(string) 任务名称 """, dest='name', required=True)), - (['--pin'], dict(help="""(string) NA """, dest='pin', required=False)), - (['--ping-option'], dict(help="""(siteMonitorPingOption) NA """, dest='pingOption', required=False)), - (['--pop3option'], dict(help="""(siteMonitorPop3Option) NA """, dest='pop3Option', required=False)), - (['--port'], dict(help="""(string) 端口 """, dest='port', required=False)), - (['--smtp-option'], dict(help="""(siteMonitorSmtpOption) NA """, dest='smtpOption', required=False)), - (['--source'], dict(help="""(array: siteMonitorSource) 探测源 """, dest='source', required=True)), - (['--stats'], dict(help="""(object) NA """, dest='stats', required=False)), - (['--task-type'], dict(help="""(string) 任务类型,可选值:HTTP、PING 、TCP 、UDP、DNS、SMTP、POP3和FTP """, dest='taskType', required=True)), - (['--tcp-option'], dict(help="""(siteMonitorTcpOption) NA """, dest='tcpOption', required=False)), - (['--udp-option'], dict(help="""(siteMonitorUdpOption) NA """, dest='udpOption', required=False)), - (['--updated-time'], dict(help="""(int) NA """, dest='updatedTime', type=int, required=False)), + (['--client-token'], dict(help="""(string) 幂等性校验参数,最长36位 """, dest='clientToken', required=True)), + (['--create-probe-task-spec'], dict(help="""(createProbeTaskParam) NA """, dest='createProbeTaskSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建站点监控任务 ''', + help=''' 创建可用性监控任务 ''', description=''' - 创建站点监控任务。 + 创建可用性监控任务。 - 示例: jdc detection create-site-monitor --address xxx --cycle 0 --name xxx --source ['{"":""}'] --task-type xxx + 示例: jdc detection create-probe-task --client-token xxx --create-probe-task-spec '{"":""}' ''', ) - def create_site_monitor(self): + def create_probe_task(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.CreateSiteMonitorRequest import CreateSiteMonitorRequest + from jdcloud_sdk.services.detection.apis.CreateProbeTaskRequest import CreateProbeTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateSiteMonitorRequest(params_dict, headers) + req = CreateProbeTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -477,52 +517,30 @@ def create_site_monitor(self): @expose( arguments=[ - (['--address'], dict(help="""(string) 地址 """, dest='address', required=True)), - (['--advance-checked'], dict(help="""(string) NA """, dest='advanceChecked', required=False)), - (['--created-time'], dict(help="""(int) NA """, dest='createdTime', type=int, required=False)), - (['--cycle'], dict(help="""(int) 探测频率 """, dest='cycle', type=int, required=True)), - (['--default-source'], dict(help="""(string) NA """, dest='defaultSource', required=False)), - (['--dns-option'], dict(help="""(siteMonitorDnsOption) NA """, dest='dnsOption', required=False)), - (['--enabled'], dict(help="""(string) NA """, dest='enabled', required=False)), - (['--ftp-option'], dict(help="""(siteMonitorFtpOption) NA """, dest='ftpOption', required=False)), - (['--hawkeye-id'], dict(help="""(int) NA """, dest='hawkeyeId', type=int, required=False)), - (['--http-option'], dict(help="""(siteMonitorHttpOption) NA """, dest='httpOption', required=False)), - (['--id'], dict(help="""(string) NA """, dest='id', required=False)), - (['--is-deleted'], dict(help="""(string) NA """, dest='isDeleted', required=False)), - (['--name'], dict(help="""(string) 任务名称 """, dest='name', required=True)), - (['--pin'], dict(help="""(string) NA """, dest='pin', required=False)), - (['--ping-option'], dict(help="""(siteMonitorPingOption) NA """, dest='pingOption', required=False)), - (['--pop3option'], dict(help="""(siteMonitorPop3Option) NA """, dest='pop3Option', required=False)), - (['--port'], dict(help="""(string) 端口 """, dest='port', required=False)), - (['--smtp-option'], dict(help="""(siteMonitorSmtpOption) NA """, dest='smtpOption', required=False)), - (['--source'], dict(help="""(array: siteMonitorSource) 探测源 """, dest='source', required=True)), - (['--stats'], dict(help="""(object) NA """, dest='stats', required=False)), - (['--task-type'], dict(help="""(string) 任务类型,可选值:HTTP、PING 、TCP 、UDP、DNS、SMTP、POP3和FTP """, dest='taskType', required=True)), - (['--tcp-option'], dict(help="""(siteMonitorTcpOption) NA """, dest='tcpOption', required=False)), - (['--udp-option'], dict(help="""(siteMonitorUdpOption) NA """, dest='udpOption', required=False)), - (['--updated-time'], dict(help="""(int) NA """, dest='updatedTime', type=int, required=False)), + (['--probe-task-ids'], dict(help="""(string) 探测任务的task_id,多个taskId用|分隔 """, dest='probeTaskIDs', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改站点监控任务 ''', + help=''' 删除可用性监控任务 ''', description=''' - 修改站点监控任务。 + 删除可用性监控任务。 - 示例: jdc detection update-site-monitor --address xxx --cycle 0 --name xxx --source ['{"":""}'] --task-type xxx + 示例: jdc detection delete-probe-task --probe-task-ids xxx ''', ) - def update_site_monitor(self): + def delete_probe_task(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.UpdateSiteMonitorRequest import UpdateSiteMonitorRequest + from jdcloud_sdk.services.detection.apis.DeleteProbeTaskRequest import DeleteProbeTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateSiteMonitorRequest(params_dict, headers) + req = DeleteProbeTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -532,29 +550,30 @@ def update_site_monitor(self): @expose( arguments=[ - (['--filters'], dict(help="""(array: filter) name为'list' - 站点监控id """, dest='filters', required=False)), + (['--probe-task-id'], dict(help="""(string) 探测任务的task_id """, dest='probeTaskID', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除站点监控任务 ''', + help=''' 查询可用性监控任务信息 ''', description=''' - 删除站点监控任务。 + 查询可用性监控任务信息。 - 示例: jdc detection delete-site-monitor + 示例: jdc detection describe-probe-task --probe-task-id xxx ''', ) - def delete_site_monitor(self): + def describe_probe_task(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.DeleteSiteMonitorRequest import DeleteSiteMonitorRequest + from jdcloud_sdk.services.detection.apis.DescribeProbeTaskRequest import DescribeProbeTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteSiteMonitorRequest(params_dict, headers) + req = DescribeProbeTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -564,29 +583,36 @@ def delete_site_monitor(self): @expose( arguments=[ - (['--list'], dict(help="""(array: enableSiteMonitorReqItem) NA """, dest='list', required=False)), + (['--probe-task-id'], dict(help="""(string) 探测任务的task_id """, dest='probeTaskID', required=True)), + (['--http-body'], dict(help="""(string) http body:选择探测类型为1=http时有效,最长不超过1024字节 """, dest='httpBody', required=False)), + (['--http-cookie'], dict(help="""(array: keyValue) http cookie:选择探测类型为1=http时有效,最大允许20个key、value对,最长不超过1024字节 """, dest='httpCookie', required=False)), + (['--http-header'], dict(help="""(array: keyValue) http header:选择探测类型为1=http时有效,最大允许20个key、value对,最长不超过1024字节 """, dest='httpHeader', required=False)), + (['--http-type'], dict(help="""(int) http探测方法,可选值:1:get、2:post、3:head """, dest='httpType', type=int, required=False)), + (['--name'], dict(help="""(string) task名称,不允许重复,长度不超过32字符,只允许中英文、数字、下划线_、中划线-, [0-9][a-z] [A-Z] [- _ ] """, dest='name', required=False)), + (['--probes'], dict(help="""(array: probe) 探测源(发起对探测目标探测的云主机,需安装相应的agent才能探测) """, dest='probes', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启停站点监控任务 ''', + help=''' 修改可用性监控任务 ''', description=''' - 启停站点监控任务。 + 修改可用性监控任务。 - 示例: jdc detection enable-site-monitor + 示例: jdc detection update-probe-task --probe-task-id xxx --probes ['{"":""}'] ''', ) - def enable_site_monitor(self): + def update_probe_task(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.EnableSiteMonitorRequest import EnableSiteMonitorRequest + from jdcloud_sdk.services.detection.apis.UpdateProbeTaskRequest import UpdateProbeTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableSiteMonitorRequest(params_dict, headers) + req = UpdateProbeTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -596,29 +622,33 @@ def enable_site_monitor(self): @expose( arguments=[ - (['--address'], dict(help="""(string) NA """, dest='address', required=False)), + (['--probe-task-id'], dict(help="""(string) 可用性监控task_id, id长度(0,50] """, dest='probeTaskID', required=True)), + (['--probe-id'], dict(help="""(string) 探测源id, id长度(0,50] """, dest='probeID', required=True)), + (['--start-time'], dict(help="""(string) 查询时间范围的开始时间, UTC时间,格式:2016-12-11T00:00:00+0800(默认为当前时间往前三天,早于3d时,将被重置为3d)(注意在url中+要转译为%2B故url中为2016-12-11T00:00:00%2B0800) """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询时间范围的结束时间, UTC时间,格式:2016-12-11T00:00:00+0800(为空时,默认为当前时间)(注意在url中+要转译为%2B故url中为2016-12-11T00:00:00%2B0800) """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 检测站点监控地址是否有效 ''', + help=''' 查询可用性监控任务的指定探测源的异常探测历史 ''', description=''' - 检测站点监控地址是否有效。 + 查询可用性监控任务的指定探测源的异常探测历史。 - 示例: jdc detection validate-site-monitor-address + 示例: jdc detection describe-probe-history --probe-task-id xxx --probe-id xxx ''', ) - def validate_site_monitor_address(self): + def describe_probe_history(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.ValidateSiteMonitorAddressRequest import ValidateSiteMonitorAddressRequest + from jdcloud_sdk.services.detection.apis.DescribeProbeHistoryRequest import DescribeProbeHistoryRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ValidateSiteMonitorAddressRequest(params_dict, headers) + req = DescribeProbeHistoryRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -628,31 +658,31 @@ def validate_site_monitor_address(self): @expose( arguments=[ - (['--id'], dict(help="""(string) NA """, dest='id', required=False)), - (['--start-time'], dict(help="""(string) NA """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) NA """, dest='endTime', required=False)), + (['--probe-task-id'], dict(help="""(string) 探测任务的task_id """, dest='probeTaskID', required=True)), + (['--filters'], dict(help="""(array: filter) 自定义标签 """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取站点监控数据 ''', + help=''' 查询可用性监控任务的探测源列表 ''', description=''' - 获取站点监控数据。 + 查询可用性监控任务的探测源列表。 - 示例: jdc detection get-site-monitor-data-points + 示例: jdc detection discribe-probes --probe-task-id xxx ''', ) - def get_site_monitor_data_points(self): + def discribe_probes(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.GetSiteMonitorDataPointsRequest import GetSiteMonitorDataPointsRequest + from jdcloud_sdk.services.detection.apis.DiscribeProbesRequest import DiscribeProbesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetSiteMonitorDataPointsRequest(params_dict, headers) + req = DiscribeProbesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -662,28 +692,31 @@ def get_site_monitor_data_points(self): @expose( arguments=[ + (['--enabled'], dict(help="""(bool) 默认:禁用; true:启用,false:禁用 """, dest='enabled', type=bool, required=False)), + (['--task-id'], dict(help="""(array: string) 要启用或禁用的探测任务的task_id列表,列表长度[1,100) """, dest='taskId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取站点监控探针列表 ''', + help=''' 启用、禁用可用性监控任务 ''', description=''' - 获取站点监控探针列表。 + 启用、禁用可用性监控任务。 - 示例: jdc detection get-site-monitor-source + 示例: jdc detection probe-task-enable ''', ) - def get_site_monitor_source(self): + def probe_task_enable(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.GetSiteMonitorSourceRequest import GetSiteMonitorSourceRequest + from jdcloud_sdk.services.detection.apis.ProbeTaskEnableRequest import ProbeTaskEnableRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetSiteMonitorSourceRequest(params_dict, headers) + req = ProbeTaskEnableRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -693,52 +726,38 @@ def get_site_monitor_source(self): @expose( arguments=[ - (['--address'], dict(help="""(string) 地址 """, dest='address', required=True)), - (['--advance-checked'], dict(help="""(string) NA """, dest='advanceChecked', required=False)), - (['--created-time'], dict(help="""(int) NA """, dest='createdTime', type=int, required=False)), - (['--cycle'], dict(help="""(int) 探测频率 """, dest='cycle', type=int, required=True)), - (['--default-source'], dict(help="""(string) NA """, dest='defaultSource', required=False)), - (['--dns-option'], dict(help="""(siteMonitorDnsOption) NA """, dest='dnsOption', required=False)), - (['--enabled'], dict(help="""(string) NA """, dest='enabled', required=False)), - (['--ftp-option'], dict(help="""(siteMonitorFtpOption) NA """, dest='ftpOption', required=False)), - (['--hawkeye-id'], dict(help="""(int) NA """, dest='hawkeyeId', type=int, required=False)), - (['--http-option'], dict(help="""(siteMonitorHttpOption) NA """, dest='httpOption', required=False)), - (['--id'], dict(help="""(string) NA """, dest='id', required=False)), - (['--is-deleted'], dict(help="""(string) NA """, dest='isDeleted', required=False)), - (['--name'], dict(help="""(string) 任务名称 """, dest='name', required=True)), - (['--pin'], dict(help="""(string) NA """, dest='pin', required=False)), - (['--ping-option'], dict(help="""(siteMonitorPingOption) NA """, dest='pingOption', required=False)), - (['--pop3option'], dict(help="""(siteMonitorPop3Option) NA """, dest='pop3Option', required=False)), - (['--port'], dict(help="""(string) 端口 """, dest='port', required=False)), - (['--smtp-option'], dict(help="""(siteMonitorSmtpOption) NA """, dest='smtpOption', required=False)), - (['--source'], dict(help="""(array: siteMonitorSource) 探测源 """, dest='source', required=True)), - (['--stats'], dict(help="""(object) NA """, dest='stats', required=False)), - (['--task-type'], dict(help="""(string) 任务类型,可选值:HTTP、PING 、TCP 、UDP、DNS、SMTP、POP3和FTP """, dest='taskType', required=True)), - (['--tcp-option'], dict(help="""(siteMonitorTcpOption) NA """, dest='tcpOption', required=False)), - (['--udp-option'], dict(help="""(siteMonitorUdpOption) NA """, dest='udpOption', required=False)), - (['--updated-time'], dict(help="""(int) NA """, dest='updatedTime', type=int, required=False)), + (['--page-number'], dict(help="""(int) 当前所在页,默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 页面大小,默认为20;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), + (['--name'], dict(help="""(string) 根据探测任务的名称查询,支持模糊查询 """, dest='name', required=False)), + (['--type'], dict(help="""(int) 根据探测任务的类型查询,1、http 2、telnet """, dest='type', type=int, required=False)), + (['--time-interval'], dict(help="""(string) 查询的可用率、响应时间的时间间隔,为空时默认查询最新点,最大不超过30天,支持分钟级别,小时级别,天级别,例如:1m、1h、1d """, dest='timeInterval', required=False)), + (['--with-stats'], dict(help="""(bool) 是否查询可用率、响应时间 """, dest='withStats', type=bool, required=False)), + (['--with-deleted'], dict(help="""(bool) 是否包含被删除的task """, dest='withDeleted', type=bool, required=False)), + (['--enabled'], dict(help="""(int) 任务状态:1为启用,0为禁用。默认为查所有的 """, dest='enabled', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) taskId - taskId,精确匹配,支持多个; name - task名称或探测地址,糊模匹配,支持单个 """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 测试站点监控参数 ''', + help=''' 查询可用性监控任务列表 ''', description=''' - 测试站点监控参数。 + 查询可用性监控任务列表。 - 示例: jdc detection test-site-monitor --address xxx --cycle 0 --name xxx --source ['{"":""}'] --task-type xxx + 示例: jdc detection describe-probe-tasks ''', ) - def test_site_monitor(self): + def describe_probe_tasks(self): client_factory = ClientFactory('detection') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.detection.apis.TestSiteMonitorRequest import TestSiteMonitorRequest + from jdcloud_sdk.services.detection.apis.DescribeProbeTasksRequest import DescribeProbeTasksRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = TestSiteMonitorRequest(params_dict, headers) + req = DescribeProbeTasksRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -748,7 +767,7 @@ def test_site_monitor(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-agent-status','describe-metric-data-am','create-probe-task','delete-probe-task','describe-probe-task','update-probe-task','describe-probe-history','discribe-probes','probe-task-enable','describe-probe-tasks','get-site-monitor','create-site-monitor','update-site-monitor','delete-site-monitor','enable-site-monitor','validate-site-monitor-address','get-site-monitor-data-points','get-site-monitor-source','test-site-monitor',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['get-site-monitor','create-site-monitor','update-site-monitor','delete-site-monitor','enable-site-monitor','validate-site-monitor-address','get-site-monitor-data-points','get-site-monitor-source','test-site-monitor','describe-agent-status','describe-metric-data-am','create-probe-task','delete-probe-task','describe-probe-task','update-probe-task','describe-probe-history','discribe-probes','probe-task-enable','describe-probe-tasks',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/disk.py b/jdcloud_cli/controllers/services/disk.py index a622eb7..95a7662 100644 --- a/jdcloud_cli/controllers/services/disk.py +++ b/jdcloud_cli/controllers/services/disk.py @@ -42,8 +42,9 @@ class Meta: (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), - (['--filters'], dict(help="""(array: filter) diskId - 云硬盘ID,精确匹配,支持多个; diskType - 云硬盘类型,精确匹配,支持多个,取值为 ssd,premium-hdd,ssd.io1,ssd.gp1,hdd.std1; instanceId - 云硬盘所挂载主机的ID,精确匹配,支持多个; instanceType - 云硬盘所挂载主机的类型,精确匹配,支持多个; status - 可用区,精确匹配,支持多个; az - 云硬盘状态,精确匹配,支持多个; name - 云硬盘名称,模糊匹配,支持单个; multiAttach - 云硬盘是否多点挂载,精确匹配,支持单个; encrypted - 云硬盘是否加密,精确匹配,支持单个; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) diskId - 云硬盘ID,精确匹配,支持多个; diskType - 云硬盘类型,精确匹配,支持多个,取值为 ssd,premium-hdd,ssd.io1,ssd.gp1,hdd.std1; instanceId - 云硬盘所挂载主机的ID,精确匹配,支持多个; instanceType - 云硬盘所挂载主机的类型,精确匹配,支持多个; status - 云硬盘状态,精确匹配,支持多个 ; az - 可用区,精确匹配,支持多个; name - 云硬盘名称,模糊匹配,支持单个; multiAttach - 云硬盘是否多点挂载,精确匹配,支持单个; encrypted - 云硬盘是否加密,精确匹配,支持单个; policyId - 绑定policyId的云硬盘,精确匹配,支持多个; notPolicyId - 未绑定policyId的云硬盘,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -77,9 +78,10 @@ def describe_disks(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--disk-spec'], dict(help="""(diskSpec) 创建云硬盘规格 """, dest='diskSpec', required=True)), (['--max-count'], dict(help="""(int) 购买实例数量;取值范围:[1,100] """, dest='maxCount', type=int, required=True)), - (['--user-tags'], dict(help="""(array: tag) 用户标签 """, dest='userTags', required=False)), + (['--user-tags'], dict(help="""(array: tag) 用户标签,默认为空;tag标签的限制:每个资源最多允许绑定 10 个不同的标签,同一资源每个标签“键”上只能存在1个标签“值”;标签键/值只支持中文、数字、大小写字母、空格及特殊符号_.:/=+-@;当无tags时,reps结果返回中tagmsg为空 """, dest='userTags', required=False)), (['--client-token'], dict(help="""(string) 幂等性校验参数 """, dest='clientToken', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -87,7 +89,7 @@ def describe_disks(self): description=''' - 创建一块或多块按配置或者按使用时长付费的云硬盘。; - 云硬盘类型包括高效云盘(premium-hdd)、SSD云盘(ssd)、通用型SSD(ssd.gp1)、性能型SSD(ssd.io1)、容量型HDD(hdd.std1)。; - 计费方式默认为按配置付费。; - 创建完成后,云硬盘状态为 available。; - 可选参数快照 ID用于从快照创建新盘。; - 批量创建时,云硬盘的命名为 硬盘名称-数字,例如 myDisk-1,myDisk-2。; - maxCount为最大努力,不保证一定能达到maxCount。; - userTags 为创建云盘时打的标签; 。 - 示例: jdc disk create-disks --disk-spec '{"":""}' --max-count 0 --client-token xxx + 示例: jdc disk create-disks --disk-spec '{"":""}' --max-count 5 --client-token xxx ''', ) def create_disks(self): @@ -113,6 +115,7 @@ def create_disks(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--disk-id'], dict(help="""(string) 云硬盘ID """, dest='diskId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -148,6 +151,7 @@ def describe_disk(self): (['--name'], dict(help="""(string) 云硬盘名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='name', required=False)), (['--description'], dict(help="""(string) 云硬盘描述,允许输入UTF-8编码下的全部字符,不超过256字符。 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -181,6 +185,7 @@ def modify_disk_attribute(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--disk-id'], dict(help="""(string) 云硬盘ID """, dest='diskId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -215,6 +220,7 @@ def delete_disk(self): (['--disk-id'], dict(help="""(string) 云硬盘ID """, dest='diskId', required=True)), (['--snapshot-id'], dict(help="""(string) 用于恢复云盘的快照ID """, dest='snapshotId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -248,8 +254,9 @@ def restore_disk(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--disk-id'], dict(help="""(string) 云硬盘ID """, dest='diskId', required=True)), (['--disk-size-gb'], dict(help="""(int) 扩容后的云硬盘大小,单位为GiB """, dest='diskSizeGB', type=int, required=True)), - (['--iops'], dict(help="""(int) 修改ssd.io1型云硬盘的iops数量,当且仅当ssd.io1型的云盘类型有效,步长是10. """, dest='iops', type=int, required=False)), + (['--iops'], dict(help="""(int) 修改ssd.io1型云硬盘的iops数量,当且仅当ssd.io1型的云盘类型有效,步长是10; 默认iops为云硬盘原有iops值 """, dest='iops', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -257,7 +264,7 @@ def restore_disk(self): description=''' - 扩容云硬盘到指定大小,云硬盘状态必须为 available。; - 当云硬盘正在创建快照时,不允许扩容。; 。 - 示例: jdc disk extend-disk --disk-id xxx --disk-size-gb 0 + 示例: jdc disk extend-disk --disk-id xxx --disk-size-gb 5 ''', ) def extend_disk(self): @@ -278,6 +285,77 @@ def extend_disk(self): except Exception as e: print(e) + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), + (['--filter-groups'], dict(help="""(array: filterGroups) diskId - 云硬盘ID,精确匹配,支持多个; diskType - 云硬盘类型,精确匹配,支持多个,取值为 ssd,premium-hdd,ssd.io1,ssd.gp1,hdd.std1; instanceId - 云硬盘所挂载主机的ID,精确匹配,支持多个; instanceType - 云硬盘所挂载主机的类型,精确匹配,支持多个; status - 可用区,精确匹配,支持多个; az - 云硬盘状态,精确匹配,支持多个; name - 云硬盘名称,模糊匹配,支持单个; multiAttach - 云硬盘是否多点挂载,精确匹配,支持单个; encrypted - 云硬盘是否加密,精确匹配,支持单个; policyId - 绑定policyId的云硬盘,精确匹配,支持多个; notPolicyId - 未绑定policyId的云硬盘,精确匹配,支持多个; """, dest='filterGroups', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' - 查询您已经创建的云硬盘。; - filters多个过滤条件之间是逻辑与(AND),每个条件内部的多个取值是逻辑或(OR); ''', + description=''' + - 查询您已经创建的云硬盘。; - filters多个过滤条件之间是逻辑与(AND),每个条件内部的多个取值是逻辑或(OR); 。 + + 示例: jdc disk describe-volumes-ignore-service-code + ''', + ) + def describe_volumes_ignore_service_code(self): + client_factory = ClientFactory('disk') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.disk.apis.DescribeVolumesIgnoreServiceCodeRequest import DescribeVolumesIgnoreServiceCodeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeVolumesIgnoreServiceCodeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--type'], dict(help="""(string) 资源类型 disk:用户能创建的云盘的配额 snapshot: 用户能创建的快照的配额 snapshot_policy: 用户能创建的快照策略的配额 """, dest='type', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询云硬盘和快照资源的配额 ''', + description=''' + 查询云硬盘和快照资源的配额。 + + 示例: jdc disk describe-quota --type xxx + ''', + ) + def describe_quota(self): + client_factory = ClientFactory('disk') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.disk.apis.DescribeQuotaRequest import DescribeQuotaRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeQuotaRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), @@ -286,6 +364,7 @@ def extend_disk(self): (['--snapshot-source'], dict(help="""(string) 查找快照的类型,可以为private,others,shared,默认为private """, dest='snapshotSource', required=False)), (['--filters'], dict(help="""(array: filter) snapshotId - 云硬盘快照ID,支持多个; diskId - 生成快照的云硬盘ID,支持多个; status - 快照状态,精确匹配,支持多个,取值为 creating、available、copying、deleting、error_create、error_delete; name - 快照名称,模糊匹配,支持单个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -320,6 +399,7 @@ def describe_snapshots(self): (['--snapshot-spec'], dict(help="""(snapshotSpec) 创建快照规格 """, dest='snapshotSpec', required=True)), (['--client-token'], dict(help="""(string) 幂等性校验参数 """, dest='clientToken', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -353,6 +433,7 @@ def create_snapshot(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--snapshot-ids'], dict(help="""(array: string) 快照ID列表 """, dest='snapshotIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -386,6 +467,7 @@ def delete_snapshots(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--snapshot-id'], dict(help="""(string) 快照ID """, dest='snapshotId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -419,8 +501,10 @@ def describe_snapshot(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--snapshot-id'], dict(help="""(string) 快照ID """, dest='snapshotId', required=True)), (['--name'], dict(help="""(string) 快照名称 """, dest='name', required=False)), - (['--description'], dict(help="""(string) 快照描述,name和description必须要指定一个 """, dest='description', required=False)), + (['--description'], dict(help="""(string) 快照描述 """, dest='description', required=False)), + (['--expire-time'], dict(help="""(string) 快照过期时间,三者至少指定一个 """, dest='expireTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -454,6 +538,7 @@ def modify_snapshot_attribute(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--snapshot-id'], dict(help="""(string) 快照ID """, dest='snapshotId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -484,7 +569,369 @@ def delete_snapshot(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-disks','create-disks','describe-disk','modify-disk-attribute','delete-disk','restore-disk','extend-disk','describe-snapshots','create-snapshot','delete-snapshots','describe-snapshot','modify-snapshot-attribute','delete-snapshot',], required=True)), + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询快照容量 ''', + description=''' + 查询快照容量。 + + 示例: jdc disk describe-snapshots-capacity + ''', + ) + def describe_snapshots_capacity(self): + client_factory = ClientFactory('disk') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.disk.apis.DescribeSnapshotsCapacityRequest import DescribeSnapshotsCapacityRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeSnapshotsCapacityRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--disk-id'], dict(help="""(string) 云硬盘ID """, dest='diskId', required=False)), + (['--snapshot-id'], dict(help="""(string) 快照ID """, dest='snapshotId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询快照链的快照个数和快照总容量 ''', + description=''' + 查询快照链的快照个数和快照总容量。 + + 示例: jdc disk describe-snapshot-chain + ''', + ) + def describe_snapshot_chain(self): + client_factory = ClientFactory('disk') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.disk.apis.DescribeSnapshotChainRequest import DescribeSnapshotChainRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeSnapshotChainRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询云硬盘售罄情况列表 ''', + description=''' + 查询云硬盘售罄情况列表。 + + 示例: jdc disk describe-soldout + ''', + ) + def describe_soldout(self): + client_factory = ClientFactory('disk') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.disk.apis.DescribeSoldoutRequest import DescribeSoldoutRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeSoldoutRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--name'], dict(help="""(string) 策略名称 """, dest='name', required=True)), + (['--interval'], dict(help="""(int) 策略执行周期,单位:秒,不小于12小时 """, dest='interval', type=int, required=True)), + (['--effective-time'], dict(help="""(string) 策略生效时间,格式`YYYY-MM-DDTHH:mm:ss+xx:xx`。如`2020-02-02T20:02:00+08:00` """, dest='effectiveTime', required=True)), + (['--snapshot-lifecycle'], dict(help="""(int) 快照保留时间,单位:秒,0:表示不删除 """, dest='snapshotLifecycle', type=int, required=True)), + (['--contact-info'], dict(help="""(contactInfo) 联系人信息 """, dest='contactInfo', required=False)), + (['--status'], dict(help="""(int) 策略状态。1:启用 2:禁用 """, dest='status', type=int, required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建快照策略 ''', + description=''' + 创建快照策略。 + + 示例: jdc disk create-snapshot-policy --name xxx --interval 5 --effective-time xxx --snapshot-lifecycle 5 --status 5 + ''', + ) + def create_snapshot_policy(self): + client_factory = ClientFactory('disk') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.disk.apis.CreateSnapshotPolicyRequest import CreateSnapshotPolicyRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateSnapshotPolicyRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--policy-id'], dict(help="""(string) 策略ID """, dest='policyId', required=True)), + (['--name'], dict(help="""(string) 策略名称 """, dest='name', required=True)), + (['--interval'], dict(help="""(int) 策略执行周期,单位:秒,不小于12小时 """, dest='interval', type=int, required=True)), + (['--effective-time'], dict(help="""(string) 策略生效时间,格式`YYYY-MM-DDTHH:mm:ss+xx:xx`。如`2020-02-02T20:02:00+08:00` """, dest='effectiveTime', required=True)), + (['--snapshot-lifecycle'], dict(help="""(int) 快照保留时间,单位:秒,0:表示不删除 """, dest='snapshotLifecycle', type=int, required=True)), + (['--contact-info'], dict(help="""(contactInfo) 联系人信息 """, dest='contactInfo', required=False)), + (['--status'], dict(help="""(int) 策略状态。1:启用 2:禁用 """, dest='status', type=int, required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改快照策略 ''', + description=''' + 修改快照策略。 + + 示例: jdc disk update-snapshot-policy --policy-id xxx --name xxx --interval 5 --effective-time xxx --snapshot-lifecycle 5 --status 5 + ''', + ) + def update_snapshot_policy(self): + client_factory = ClientFactory('disk') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.disk.apis.UpdateSnapshotPolicyRequest import UpdateSnapshotPolicyRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateSnapshotPolicyRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--policy-id'], dict(help="""(string) 策略ID """, dest='policyId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除快照策略 ''', + description=''' + 删除快照策略。 + + 示例: jdc disk delete-snapshot-policy --policy-id xxx + ''', + ) + def delete_snapshot_policy(self): + client_factory = ClientFactory('disk') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.disk.apis.DeleteSnapshotPolicyRequest import DeleteSnapshotPolicyRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteSnapshotPolicyRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--name'], dict(help="""(string) 策略名称,默认为空 """, dest='name', required=False)), + (['--policy-id'], dict(help="""(array: string) 策略ID,默认为空 """, dest='policyId', required=False)), + (['--status'], dict(help="""(array: int) 策略状态。1: 启用 2:禁用 """, dest='status', type=int, required=False)), + (['--order'], dict(help="""(orderItem) 排序字段,只支持create_time和update_time字段 """, dest='order', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询快照策略 ''', + description=''' + 查询快照策略。 + + 示例: jdc disk describe-snapshot-policies + ''', + ) + def describe_snapshot_policies(self): + client_factory = ClientFactory('disk') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.disk.apis.DescribeSnapshotPoliciesRequest import DescribeSnapshotPoliciesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeSnapshotPoliciesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--filter-groups'], dict(help="""(array: filterGroups) 过滤条件 """, dest='filterGroups', required=False)), + (['--order'], dict(help="""(orderItem) 排序字段,只支持create_time和update_time字段 """, dest='order', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' - 查询您已经创建的快照策略。; - filters多个过滤条件之间是逻辑与(AND),每个条件内部的多个取值是逻辑或(OR); ''', + description=''' + - 查询您已经创建的快照策略。; - filters多个过滤条件之间是逻辑与(AND),每个条件内部的多个取值是逻辑或(OR); 。 + + 示例: jdc disk describe-snap-polices + ''', + ) + def describe_snap_polices(self): + client_factory = ClientFactory('disk') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.disk.apis.DescribeSnapPolicesRequest import DescribeSnapPolicesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeSnapPolicesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--relations'], dict(help="""(array: policyDiskRelationOp) 绑定/解绑操作 """, dest='relations', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 绑定/解绑快照策略与磁盘关系 ''', + description=''' + 绑定/解绑快照策略与磁盘关系。 + + 示例: jdc disk apply-snapshot-policies + ''', + ) + def apply_snapshot_policies(self): + client_factory = ClientFactory('disk') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.disk.apis.ApplySnapshotPoliciesRequest import ApplySnapshotPoliciesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ApplySnapshotPoliciesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--disk-id'], dict(help="""(array: string) 磁盘ID """, dest='diskId', required=False)), + (['--disk-region'], dict(help="""(array: string) 磁盘地域ID """, dest='diskRegion', required=False)), + (['--policy-id'], dict(help="""(array: string) 策略ID """, dest='policyId', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询快照策略与磁盘绑定关系 ''', + description=''' + 查询快照策略与磁盘绑定关系。 + + 示例: jdc disk describe-snapshot-policy-disk-relations + ''', + ) + def describe_snapshot_policy_disk_relations(self): + client_factory = ClientFactory('disk') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.disk.apis.DescribeSnapshotPolicyDiskRelationsRequest import DescribeSnapshotPolicyDiskRelationsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeSnapshotPolicyDiskRelationsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--api'], dict(help="""(string) api name """, choices=['describe-disks','create-disks','describe-disk','modify-disk-attribute','delete-disk','restore-disk','extend-disk','describe-volumes-ignore-service-code','describe-quota','describe-snapshots','create-snapshot','delete-snapshots','describe-snapshot','modify-snapshot-attribute','delete-snapshot','describe-snapshots-capacity','describe-snapshot-chain','describe-soldout','create-snapshot-policy','update-snapshot-policy','delete-snapshot-policy','describe-snapshot-policies','describe-snap-polices','apply-snapshot-policies','describe-snapshot-policy-disk-relations',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/domainservice.py b/jdcloud_cli/controllers/services/domainservice.py index 1d9aac0..4e3b6be 100644 --- a/jdcloud_cli/controllers/services/domainservice.py +++ b/jdcloud_cli/controllers/services/domainservice.py @@ -38,36 +38,34 @@ class Meta: @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 分页参数,页的序号,默认是1 """, dest='pageNumber', type=int, required=True)), - (['--page-size'], dict(help="""(int) 分页参数,每页含有的结果的数目,默认是10 """, dest='pageSize', type=int, required=True)), - (['--start-time'], dict(help="""(string) 记录的起始时间,格式:UTC时间例如2017-11-10T23:00:00Z """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 记录的终止时间,格式:UTC时间例如2017-11-10T23:00:00Z """, dest='endTime', required=True)), - (['--key-word'], dict(help="""(string) 日志需要匹配的关键词 """, dest='keyWord', required=False)), - (['--success'], dict(help="""(bool) 日志里面的结果是成功还是失败 """, dest='success', required=False)), - (['--type'], dict(help="""(int) 日志的类型 """, dest='type', type=int, required=False)), + (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), + (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), + (['--page-number'], dict(help="""(int) 当前页数,起始值为1,默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数, 默认为10 """, dest='pageSize', type=int, required=False)), + (['--search'], dict(help="""(string) 关键字,按照”%search%”模式匹配解析记录的主机记录 """, dest='search', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看用户在云解析服务下的操作记录 ''', + help=''' 查询主域名的解析记录。 ; 在使用解析记录相关的接口之前,请调用此接口获取解析记录的列表。; ''', description=''' - 查看用户在云解析服务下的操作记录。 + 查询主域名的解析记录。 ; 在使用解析记录相关的接口之前,请调用此接口获取解析记录的列表。; 。 - 示例: jdc domainservice describe-action-log --page-number 0 --page-size 0 --start-time xxx --end-time xxx + 示例: jdc domainservice describe-resource-record --domain-id xxx ''', ) - def describe_action_log(self): + def describe_resource_record(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.DescribeActionLogRequest import DescribeActionLogRequest + from jdcloud_sdk.services.domainservice.apis.DescribeResourceRecordRequest import DescribeResourceRecordRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeActionLogRequest(params_dict, headers) + req = DescribeResourceRecordRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -78,32 +76,31 @@ def describe_action_log(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 分页查询时查询的每页的序号,起始值为1,默认为1 """, dest='pageNumber', type=int, required=True)), - (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数,默认为10 """, dest='pageSize', type=int, required=True)), - (['--domain-name'], dict(help="""(string) 关键字,按照”%domainName%”模式匹配主域名 """, dest='domainName', required=False)), - (['--domain-id'], dict(help="""(int) 域名ID。不为0时,只查此domainId的域名 """, dest='domainId', type=int, required=False)), + (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), + (['--req'], dict(help="""(addRR) RR参数 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取用户所属的主域名列表。 ; 请在调用域名相关的接口之前,调用此接口获取相关的domainId和domainName。 ; 主域名的相关概念,请查阅云解析文档; ''', + help=''' 添加主域名的解析记录 ''', description=''' - 获取用户所属的主域名列表。 ; 请在调用域名相关的接口之前,调用此接口获取相关的domainId和domainName。 ; 主域名的相关概念,请查阅云解析文档; 。 + 添加主域名的解析记录。 - 示例: jdc domainservice describe-domains --page-number 0 --page-size 0 + 示例: jdc domainservice create-resource-record --domain-id xxx --req '{"":""}' ''', ) - def describe_domains(self): + def create_resource_record(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.DescribeDomainsRequest import DescribeDomainsRequest + from jdcloud_sdk.services.domainservice.apis.CreateResourceRecordRequest import CreateResourceRecordRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDomainsRequest(params_dict, headers) + req = CreateResourceRecordRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -114,35 +111,32 @@ def describe_domains(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--pack-id'], dict(help="""(int) 主域名的套餐类型, 免费:0 企业版:1 企业高级版:2 """, dest='packId', type=int, required=True)), - (['--domain-name'], dict(help="""(string) 要添加的主域名 """, dest='domainName', required=True)), - (['--domain-id'], dict(help="""(int) 主域名的ID,升级套餐必填,请使用describeDomains获取 """, dest='domainId', type=int, required=False)), - (['--buy-type'], dict(help="""(int) 新购买:1、升级:3,收费套餐的域名必填 """, dest='buyType', type=int, required=False)), - (['--time-span'], dict(help="""(int) 取值1,2,3 ,含义:时长,收费套餐的域名必填 """, dest='timeSpan', type=int, required=False)), - (['--time-unit'], dict(help="""(int) 时间单位,收费套餐的域名必填,1:小时,2:天,3:月,4:年 """, dest='timeUnit', type=int, required=False)), - (['--billing-type'], dict(help="""(int) 计费类型,可以不传此参数。 """, dest='billingType', type=int, required=False)), + (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), + (['--resource-record-id'], dict(help="""(string) 解析记录ID,请使用describeResourceRecord接口获取。 """, dest='resourceRecordId', required=True)), + (['--req'], dict(help="""(updateRR) updateRR参数 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加主域名 ; 如何添加免费域名,详细情况请查阅文档; 添加收费域名,请查阅文档,; 添加收费域名前,请确保用户的京东云账户有足够的资金支付,Openapi接口回返回订单号,可以用此订单号向计费系统查阅详情。; ''', + help=''' 修改主域名的某个解析记录 ''', description=''' - 添加主域名 ; 如何添加免费域名,详细情况请查阅文档; 添加收费域名,请查阅文档,; 添加收费域名前,请确保用户的京东云账户有足够的资金支付,Openapi接口回返回订单号,可以用此订单号向计费系统查阅详情。; 。 + 修改主域名的某个解析记录。 - 示例: jdc domainservice create-domain --pack-id 0 --domain-name xxx + 示例: jdc domainservice modify-resource-record --domain-id xxx --resource-record-id xxx --req '{"":""}' ''', ) - def create_domain(self): + def modify_resource_record(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.CreateDomainRequest import CreateDomainRequest + from jdcloud_sdk.services.domainservice.apis.ModifyResourceRecordRequest import ModifyResourceRecordRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateDomainRequest(params_dict, headers) + req = ModifyResourceRecordRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -154,29 +148,30 @@ def create_domain(self): arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), - (['--domain-name'], dict(help="""(string) 需要修改的主域名,请使用describeDomains接口获取 """, dest='domainName', required=True)), + (['--resource-record-id'], dict(help="""(string) 解析记录ID,请使用describeResourceRecord接口获取。 """, dest='resourceRecordId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改主域名 ''', + help=''' 删除主域名下的解析记录 ''', description=''' - 修改主域名。 + 删除主域名下的解析记录。 - 示例: jdc domainservice modify-domain --domain-id xxx --domain-name xxx + 示例: jdc domainservice delete-resource-record --domain-id xxx --resource-record-id xxx ''', ) - def modify_domain(self): + def delete_resource_record(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.ModifyDomainRequest import ModifyDomainRequest + from jdcloud_sdk.services.domainservice.apis.DeleteResourceRecordRequest import DeleteResourceRecordRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyDomainRequest(params_dict, headers) + req = DeleteResourceRecordRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -188,28 +183,31 @@ def modify_domain(self): arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), + (['--resource-record-id'], dict(help="""(string) 解析记录ID,请使用describeResourceRecord接口获取。 """, dest='resourceRecordId', required=True)), + (['--action'], dict(help="""(string) 要修改的状态,enable:启用 disable:停用 """, dest='action', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除主域名 ''', + help=''' 启用、停用主域名下的解析记录 ''', description=''' - 删除主域名。 + 启用、停用主域名下的解析记录。 - 示例: jdc domainservice delete-domain --domain-id xxx + 示例: jdc domainservice modify-resource-record-status --domain-id xxx --resource-record-id xxx --action xxx ''', ) - def delete_domain(self): + def modify_resource_record_status(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.DeleteDomainRequest import DeleteDomainRequest + from jdcloud_sdk.services.domainservice.apis.ModifyResourceRecordStatusRequest import ModifyResourceRecordStatusRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteDomainRequest(params_dict, headers) + req = ModifyResourceRecordStatusRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -221,31 +219,32 @@ def delete_domain(self): arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), - (['--domain-name'], dict(help="""(string) 查询的主域名,请使用describeDomains接口获取 """, dest='domainName', required=True)), - (['--start'], dict(help="""(string) 查询时间段的起始时间, UTC时间格式,例如2017-11-10T23:00:00Z """, dest='start', required=True)), - (['--end'], dict(help="""(string) 查询时间段的终止时间, UTC时间格式,例如2017-11-10T23:00:00Z """, dest='end', required=True)), + (['--load-mode'], dict(help="""(int) 展示方式,暂时不使用 """, dest='loadMode', type=int, required=False)), + (['--pack-id'], dict(help="""(int) 套餐ID,0->免费版 1->企业版 2->企业高级版 """, dest='packId', type=int, required=True)), + (['--view-id'], dict(help="""(int) view ID,默认为-1 """, dest='viewId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看主域名的解析次数 ''', + help=''' 查询云解析所有的基础解析线路。 ; 在使用解析线路的参数之前,请调用此接口获取解析线路的ID。; ''', description=''' - 查看主域名的解析次数。 + 查询云解析所有的基础解析线路。 ; 在使用解析线路的参数之前,请调用此接口获取解析线路的ID。; 。 - 示例: jdc domainservice describe-domain-query-count --domain-id xxx --domain-name xxx --start xxx --end xxx + 示例: jdc domainservice describe-view-tree --domain-id xxx --pack-id 5 --view-id 5 ''', ) - def describe_domain_query_count(self): + def describe_view_tree(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.DescribeDomainQueryCountRequest import DescribeDomainQueryCountRequest + from jdcloud_sdk.services.domainservice.apis.DescribeViewTreeRequest import DescribeViewTreeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDomainQueryCountRequest(params_dict, headers) + req = DescribeViewTreeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -257,31 +256,30 @@ def describe_domain_query_count(self): arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), - (['--domain-name'], dict(help="""(string) 主域名,请使用describeDomains接口获取 """, dest='domainName', required=True)), - (['--start'], dict(help="""(string) 时间段的起始时间, UTC时间格式,例如2017-11-10T23:00:00Z """, dest='start', required=True)), - (['--end'], dict(help="""(string) 时间段的终止时间, UTC时间格式,例如2017-11-10T23:00:00Z """, dest='end', required=True)), + (['--req'], dict(help="""(array: batchSetDNS) 需要设置的解析记录列表 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看域名的查询流量 ''', + help=''' 同一个主域名下,批量新增或者批量更新导入解析记录。; 如果解析记录的ID为0,是新增解析记录,如果不为0,则是更新解析记录。; ''', description=''' - 查看域名的查询流量。 + 同一个主域名下,批量新增或者批量更新导入解析记录。; 如果解析记录的ID为0,是新增解析记录,如果不为0,则是更新解析记录。; 。 - 示例: jdc domainservice describe-domain-query-traffic --domain-id xxx --domain-name xxx --start xxx --end xxx + 示例: jdc domainservice batch-set-resource-records --domain-id xxx --req ['{"":""}'] ''', ) - def describe_domain_query_traffic(self): + def batch_set_resource_records(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.DescribeDomainQueryTrafficRequest import DescribeDomainQueryTrafficRequest + from jdcloud_sdk.services.domainservice.apis.BatchSetResourceRecordsRequest import BatchSetResourceRecordsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDomainQueryTrafficRequest(params_dict, headers) + req = BatchSetResourceRecordsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -292,32 +290,33 @@ def describe_domain_query_traffic(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), - (['--page-number'], dict(help="""(int) 当前页数,起始值为1,默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数, 默认为10 """, dest='pageSize', type=int, required=False)), - (['--search'], dict(help="""(string) 关键字,按照”%search%”模式匹配解析记录的主机记录 """, dest='search', required=False)), + (['--page-number'], dict(help="""(int) 分页查询时查询的每页的序号,起始值为1,默认为1 """, dest='pageNumber', type=int, required=True)), + (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数,默认为10 """, dest='pageSize', type=int, required=True)), + (['--domain-name'], dict(help="""(string) 关键字,按照”%domainName%”模式匹配主域名 """, dest='domainName', required=False)), + (['--domain-id'], dict(help="""(int) 域名ID。不为0时,只查此domainId的域名 """, dest='domainId', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询主域名的解析记录。 ; 在使用解析记录相关的接口之前,请调用此接口获取解析记录的列表。; ''', + help=''' 获取用户所属的主域名列表。 ; 请在调用域名相关的接口之前,调用此接口获取相关的domainId和domainName。 ; 主域名的相关概念,请查阅云解析文档; ''', description=''' - 查询主域名的解析记录。 ; 在使用解析记录相关的接口之前,请调用此接口获取解析记录的列表。; 。 + 获取用户所属的主域名列表。 ; 请在调用域名相关的接口之前,调用此接口获取相关的domainId和domainName。 ; 主域名的相关概念,请查阅云解析文档; 。 - 示例: jdc domainservice describe-resource-record --domain-id xxx + 示例: jdc domainservice describe-domains --page-number 5 --page-size 5 ''', ) - def describe_resource_record(self): + def describe_domains(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.DescribeResourceRecordRequest import DescribeResourceRecordRequest + from jdcloud_sdk.services.domainservice.apis.DescribeDomainsRequest import DescribeDomainsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeResourceRecordRequest(params_dict, headers) + req = DescribeDomainsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -328,30 +327,36 @@ def describe_resource_record(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), - (['--req'], dict(help="""(addRR) RR参数 """, dest='req', required=True)), + (['--pack-id'], dict(help="""(int) 主域名的套餐类型, 免费:0 企业版:1 企业高级版:2 """, dest='packId', type=int, required=True)), + (['--domain-name'], dict(help="""(string) 要添加的主域名 """, dest='domainName', required=True)), + (['--domain-id'], dict(help="""(int) 主域名的ID,升级套餐必填,请使用describeDomains获取 """, dest='domainId', type=int, required=False)), + (['--buy-type'], dict(help="""(int) 新购买:1、升级:3,收费套餐的域名必填 """, dest='buyType', type=int, required=False)), + (['--time-span'], dict(help="""(int) 取值1,2,3 ,含义:时长,收费套餐的域名必填 """, dest='timeSpan', type=int, required=False)), + (['--time-unit'], dict(help="""(int) 时间单位,收费套餐的域名必填,1:小时,2:天,3:月,4:年 """, dest='timeUnit', type=int, required=False)), + (['--billing-type'], dict(help="""(int) 计费类型,可以不传此参数。 """, dest='billingType', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加主域名的解析记录 ''', + help=''' 添加主域名 ; 如何添加免费域名,详细情况请查阅文档; 添加收费域名,请查阅文档,; 添加收费域名前,请确保用户的京东云账户有足够的资金支付,Openapi接口回返回订单号,可以用此订单号向计费系统查阅详情。; ''', description=''' - 添加主域名的解析记录。 + 添加主域名 ; 如何添加免费域名,详细情况请查阅文档; 添加收费域名,请查阅文档,; 添加收费域名前,请确保用户的京东云账户有足够的资金支付,Openapi接口回返回订单号,可以用此订单号向计费系统查阅详情。; 。 - 示例: jdc domainservice create-resource-record --domain-id xxx --req '{"":""}' + 示例: jdc domainservice create-domain --pack-id 5 --domain-name xxx ''', ) - def create_resource_record(self): + def create_domain(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.CreateResourceRecordRequest import CreateResourceRecordRequest + from jdcloud_sdk.services.domainservice.apis.CreateDomainRequest import CreateDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateResourceRecordRequest(params_dict, headers) + req = CreateDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -363,30 +368,30 @@ def create_resource_record(self): arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), - (['--resource-record-id'], dict(help="""(string) 解析记录ID,请使用describeResourceRecord接口获取。 """, dest='resourceRecordId', required=True)), - (['--req'], dict(help="""(updateRR) updateRR参数 """, dest='req', required=True)), + (['--domain-name'], dict(help="""(string) 需要修改的主域名,请使用describeDomains接口获取 """, dest='domainName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改主域名的某个解析记录 ''', + help=''' 修改主域名 ''', description=''' - 修改主域名的某个解析记录。 + 修改主域名。 - 示例: jdc domainservice modify-resource-record --domain-id xxx --resource-record-id xxx --req '{"":""}' + 示例: jdc domainservice modify-domain --domain-id xxx --domain-name xxx ''', ) - def modify_resource_record(self): + def modify_domain(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.ModifyResourceRecordRequest import ModifyResourceRecordRequest + from jdcloud_sdk.services.domainservice.apis.ModifyDomainRequest import ModifyDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyResourceRecordRequest(params_dict, headers) + req = ModifyDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -398,29 +403,29 @@ def modify_resource_record(self): arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), - (['--resource-record-id'], dict(help="""(string) 解析记录ID,请使用describeResourceRecord接口获取。 """, dest='resourceRecordId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除主域名下的解析记录 ''', + help=''' 删除主域名 ''', description=''' - 删除主域名下的解析记录。 + 删除主域名。 - 示例: jdc domainservice delete-resource-record --domain-id xxx --resource-record-id xxx + 示例: jdc domainservice delete-domain --domain-id xxx ''', ) - def delete_resource_record(self): + def delete_domain(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.DeleteResourceRecordRequest import DeleteResourceRecordRequest + from jdcloud_sdk.services.domainservice.apis.DeleteDomainRequest import DeleteDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteResourceRecordRequest(params_dict, headers) + req = DeleteDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -432,30 +437,32 @@ def delete_resource_record(self): arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), - (['--resource-record-id'], dict(help="""(string) 解析记录ID,请使用describeResourceRecord接口获取。 """, dest='resourceRecordId', required=True)), - (['--action'], dict(help="""(string) 要修改的状态,enable:启用 disable:停用 """, dest='action', required=True)), + (['--domain-name'], dict(help="""(string) 查询的主域名,请使用describeDomains接口获取 """, dest='domainName', required=True)), + (['--start'], dict(help="""(string) 查询时间段的起始时间, UTC时间格式,例如2017-11-10T23:00:00Z """, dest='start', required=True)), + (['--end'], dict(help="""(string) 查询时间段的终止时间, UTC时间格式,例如2017-11-10T23:00:00Z """, dest='end', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启用、停用主域名下的解析记录 ''', + help=''' 查看主域名的解析次数 ''', description=''' - 启用、停用主域名下的解析记录。 + 查看主域名的解析次数。 - 示例: jdc domainservice modify-resource-record-status --domain-id xxx --resource-record-id xxx --action xxx + 示例: jdc domainservice describe-domain-query-count --domain-id xxx --domain-name xxx --start xxx --end xxx ''', ) - def modify_resource_record_status(self): + def describe_domain_query_count(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.ModifyResourceRecordStatusRequest import ModifyResourceRecordStatusRequest + from jdcloud_sdk.services.domainservice.apis.DescribeDomainQueryCountRequest import DescribeDomainQueryCountRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyResourceRecordStatusRequest(params_dict, headers) + req = DescribeDomainQueryCountRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -467,31 +474,32 @@ def modify_resource_record_status(self): arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), - (['--load-mode'], dict(help="""(int) 展示方式,暂时不使用 """, dest='loadMode', type=int, required=False)), - (['--pack-id'], dict(help="""(int) 套餐ID,0->免费版 1->企业版 2->企业高级版 """, dest='packId', type=int, required=True)), - (['--view-id'], dict(help="""(int) view ID,默认为-1 """, dest='viewId', type=int, required=True)), + (['--domain-name'], dict(help="""(string) 主域名,请使用describeDomains接口获取 """, dest='domainName', required=True)), + (['--start'], dict(help="""(string) 时间段的起始时间, UTC时间格式,例如2017-11-10T23:00:00Z """, dest='start', required=True)), + (['--end'], dict(help="""(string) 时间段的终止时间, UTC时间格式,例如2017-11-10T23:00:00Z """, dest='end', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询云解析所有的基础解析线路。 ; 在使用解析线路的参数之前,请调用此接口获取解析线路的ID。; ''', + help=''' 查看域名的查询流量 ''', description=''' - 查询云解析所有的基础解析线路。 ; 在使用解析线路的参数之前,请调用此接口获取解析线路的ID。; 。 + 查看域名的查询流量。 - 示例: jdc domainservice describe-view-tree --domain-id xxx --pack-id 0 --view-id 0 + 示例: jdc domainservice describe-domain-query-traffic --domain-id xxx --domain-name xxx --start xxx --end xxx ''', ) - def describe_view_tree(self): + def describe_domain_query_traffic(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.DescribeViewTreeRequest import DescribeViewTreeRequest + from jdcloud_sdk.services.domainservice.apis.DescribeDomainQueryTrafficRequest import DescribeDomainQueryTrafficRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeViewTreeRequest(params_dict, headers) + req = DescribeDomainQueryTrafficRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -501,31 +509,37 @@ def describe_view_tree(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), - (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), - (['--req'], dict(help="""(array: batchSetDNS) 需要设置的解析记录列表 """, dest='req', required=True)), + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 分页参数,页的序号,默认是1 """, dest='pageNumber', type=int, required=True)), + (['--page-size'], dict(help="""(int) 分页参数,每页含有的结果的数目,默认是10 """, dest='pageSize', type=int, required=True)), + (['--start-time'], dict(help="""(string) 记录的起始时间,格式:UTC时间例如2017-11-10T23:00:00Z """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 记录的终止时间,格式:UTC时间例如2017-11-10T23:00:00Z """, dest='endTime', required=True)), + (['--key-word'], dict(help="""(string) 日志需要匹配的关键词 """, dest='keyWord', required=False)), + (['--success'], dict(help="""(bool) 日志里面的结果是成功还是失败 """, dest='success', type=bool, required=False)), + (['--type'], dict(help="""(int) 日志的类型 """, dest='type', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 同一个主域名下,批量新增或者批量更新导入解析记录。; 如果解析记录的ID为0,是新增解析记录,如果不为0,则是更新解析记录。; ''', + help=''' 查看用户在云解析服务下的操作记录 ''', description=''' - 同一个主域名下,批量新增或者批量更新导入解析记录。; 如果解析记录的ID为0,是新增解析记录,如果不为0,则是更新解析记录。; 。 + 查看用户在云解析服务下的操作记录。 - 示例: jdc domainservice batch-set-resource-records --domain-id xxx --req ['{"":""}'] + 示例: jdc domainservice describe-action-log --page-number 5 --page-size 5 --start-time xxx --end-time xxx ''', ) - def batch_set_resource_records(self): + def describe_action_log(self): client_factory = ClientFactory('domainservice') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.domainservice.apis.BatchSetResourceRecordsRequest import BatchSetResourceRecordsRequest + from jdcloud_sdk.services.domainservice.apis.DescribeActionLogRequest import DescribeActionLogRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BatchSetResourceRecordsRequest(params_dict, headers) + req = DescribeActionLogRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -542,6 +556,7 @@ def batch_set_resource_records(self): (['--page-number'], dict(help="""(int) 分页参数,页的序号 """, dest='pageNumber', type=int, required=True)), (['--page-size'], dict(help="""(int) 分页参数,每页含有的结果的数目 """, dest='pageSize', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -549,7 +564,7 @@ def batch_set_resource_records(self): description=''' 查询主域名的自定义解析线路。 - 示例: jdc domainservice describe-user-view --domain-id xxx --view-id 0 --page-number 0 --page-size 0 + 示例: jdc domainservice describe-user-view --domain-id xxx --view-id 5 --page-number 5 --page-size 5 ''', ) def describe_user_view(self): @@ -576,6 +591,7 @@ def describe_user_view(self): (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), (['--req'], dict(help="""(addView) 添加自定义线路的参数 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -610,6 +626,7 @@ def create_user_view(self): (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), (['--req'], dict(help="""(delView) 删除自定义线路的参数 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -647,6 +664,7 @@ def delete_user_view(self): (['--page-number'], dict(help="""(int) 分页参数,页的序号, 默认为1 """, dest='pageNumber', type=int, required=True)), (['--page-size'], dict(help="""(int) 分页参数,每页含有的结果的数目,默认为10 """, dest='pageSize', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -654,7 +672,7 @@ def delete_user_view(self): description=''' 查询主域名的自定义解析线路的IP段。 - 示例: jdc domainservice describe-user-view-ip --domain-id xxx --view-id 0 --page-number 0 --page-size 0 + 示例: jdc domainservice describe-user-view-ip --domain-id xxx --view-id 5 --page-number 5 --page-size 5 ''', ) def describe_user_view_ip(self): @@ -681,6 +699,7 @@ def describe_user_view_ip(self): (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), (['--req'], dict(help="""(addViewIP) 添加域名的自定义解析线路的IP段的参数 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -715,6 +734,7 @@ def create_user_view_ip(self): (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), (['--req'], dict(help="""(delViewIP) 删除域名的自定义解析线路的IP段的参数 """, dest='req', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -751,6 +771,7 @@ def delete_user_view_ip(self): (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数 """, dest='pageSize', type=int, required=False)), (['--search-value'], dict(help="""(string) 查询的值 """, dest='searchValue', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -785,6 +806,7 @@ def describe_monitor(self): (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), (['--sub-domain-name'], dict(help="""(string) 子域名 """, dest='subDomainName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -819,6 +841,7 @@ def create_monitor(self): (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), (['--update-monitor'], dict(help="""(updateMonitor) 监控项设置信息 """, dest='updateMonitor', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -853,6 +876,7 @@ def modify_monitor(self): (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), (['--sub-domain-name'], dict(help="""(string) 子域名 """, dest='subDomainName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -888,6 +912,7 @@ def describe_monitor_target(self): (['--sub-domain-name'], dict(help="""(string) 子域名 """, dest='subDomainName', required=True)), (['--targets'], dict(help="""(array: string) 子域名可用监控对象的数组 """, dest='targets', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -924,6 +949,7 @@ def create_monitor_target(self): (['--action'], dict(help="""(string) 暂停stop, 开启start, 手动恢复recover,手动切换switch,手动恢复和手动切换时候不支持批量操作 """, dest='action', required=True)), (['--switch-target'], dict(help="""(string) 监控项的主机值, 手动切换时必填 """, dest='switchTarget', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -958,6 +984,7 @@ def modify_monitor_status(self): (['--domain-id'], dict(help="""(string) 域名ID,请使用describeDomains接口获取。 """, dest='domainId', required=True)), (['--monitor-id'], dict(help="""(string) 监控项ID,请使用describeMonitor接口获取。 """, dest='monitorId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -994,6 +1021,7 @@ def delete_monitor(self): (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数 """, dest='pageSize', type=int, required=False)), (['--search-value'], dict(help="""(string) 关键字 """, dest='searchValue', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1024,7 +1052,7 @@ def describe_monitor_alarm(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-action-log','describe-domains','create-domain','modify-domain','delete-domain','describe-domain-query-count','describe-domain-query-traffic','describe-resource-record','create-resource-record','modify-resource-record','delete-resource-record','modify-resource-record-status','describe-view-tree','batch-set-resource-records','describe-user-view','create-user-view','delete-user-view','describe-user-view-ip','create-user-view-ip','delete-user-view-ip','describe-monitor','create-monitor','modify-monitor','describe-monitor-target','create-monitor-target','modify-monitor-status','delete-monitor','describe-monitor-alarm',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-resource-record','create-resource-record','modify-resource-record','delete-resource-record','modify-resource-record-status','describe-view-tree','batch-set-resource-records','describe-domains','create-domain','modify-domain','delete-domain','describe-domain-query-count','describe-domain-query-traffic','describe-action-log','describe-user-view','create-user-view','delete-user-view','describe-user-view-ip','create-user-view-ip','delete-user-view-ip','describe-monitor','create-monitor','modify-monitor','describe-monitor-target','create-monitor-target','modify-monitor-status','delete-monitor','describe-monitor-alarm',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/elite.py b/jdcloud_cli/controllers/services/elite.py index f7c7f83..476dcf2 100644 --- a/jdcloud_cli/controllers/services/elite.py +++ b/jdcloud_cli/controllers/services/elite.py @@ -41,6 +41,7 @@ class Meta: (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--order-number'], dict(help="""(string) 订单号 """, dest='orderNumber', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -72,29 +73,32 @@ def jdx_query_delivery_info(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--report-order-info'], dict(help="""(reportOrderInfo) 上报订单信息 """, dest='reportOrderInfo', required=True)), + (['--buyer-pin'], dict(help="""(string) 购买用户pin """, dest='buyerPin', required=True)), + (['--business-data'], dict(help="""(string) 业务数据,与下单时的业务数据一致 """, dest='businessData', required=True)), + (['--query-all'], dict(help="""(bool) 是否查询全部,如果传入false,则只查询当前时间有效的,否则查询所有的 """, dest='queryAll', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 上报订单 ''', + help=''' 获取云存服务信息 ''', description=''' - 上报订单。 + 获取云存服务信息。 - 示例: jdc elite jdx-report-order --report-order-info '{"":""}' + 示例: jdc elite get-store-service --buyer-pin xxx --business-data xxx ''', ) - def jdx_report_order(self): + def get_store_service(self): client_factory = ClientFactory('elite') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.elite.apis.JdxReportOrderRequest import JdxReportOrderRequest + from jdcloud_sdk.services.elite.apis.GetStoreServiceRequest import GetStoreServiceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = JdxReportOrderRequest(params_dict, headers) + req = GetStoreServiceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -105,29 +109,31 @@ def jdx_report_order(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--create-order-info'], dict(help="""(createOrderInfo) 下单信息 """, dest='createOrderInfo', required=True)), + (['--page-no'], dict(help="""(int) 页码(最小1) """, dest='pageNo', type=int, required=True)), + (['--page-size'], dict(help="""(int) 每页记录数(最小10,最大100) """, dest='pageSize', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 下单接口 ''', + help=''' 输出商品接口 ''', description=''' - 下单接口。 + 输出商品接口。 - 示例: jdc elite jdx-create-order --create-order-info '{"":""}' + 示例: jdc elite jdx-query-product --page-no 5 --page-size 5 ''', ) - def jdx_create_order(self): + def jdx_query_product(self): client_factory = ClientFactory('elite') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.elite.apis.JdxCreateOrderRequest import JdxCreateOrderRequest + from jdcloud_sdk.services.elite.apis.JdxQueryProductRequest import JdxQueryProductRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = JdxCreateOrderRequest(params_dict, headers) + req = JdxQueryProductRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -138,29 +144,35 @@ def jdx_create_order(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--query-price-param'], dict(help="""(queryPriceParam) 查询价格参数 """, dest='queryPriceParam', required=True)), + (['--page-no'], dict(help="""(int) 页码(最小1) """, dest='pageNo', type=int, required=True)), + (['--page-size'], dict(help="""(int) 每页记录数(最小10,最大100) """, dest='pageSize', type=int, required=True)), + (['--deliver-number'], dict(help="""(string) 交付单号 """, dest='deliverNumber', required=False)), + (['--deliver-status'], dict(help="""(int) 交付状态 """, dest='deliverStatus', type=int, required=False)), + (['--create-dt-start'], dict(help="""(string) 交付单创建起始时间,格式:yyyy-MM-dd HH:mm:ss """, dest='createDtStart', required=False)), + (['--create-dt-end'], dict(help="""(string) 交付单创建结束时间,格式:yyyy-MM-dd HH:mm:ss """, dest='createDtEnd', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询价格 ''', + help=''' 分页查询交付单信息 ''', description=''' - 查询价格。 + 分页查询交付单信息。 - 示例: jdc elite jdx-query-price --query-price-param '{"":""}' + 示例: jdc elite list-sale-service --page-no 5 --page-size 5 ''', ) - def jdx_query_price(self): + def list_sale_service(self): client_factory = ClientFactory('elite') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.elite.apis.JdxQueryPriceRequest import JdxQueryPriceRequest + from jdcloud_sdk.services.elite.apis.ListSaleServiceRequest import ListSaleServiceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = JdxQueryPriceRequest(params_dict, headers) + req = ListSaleServiceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -171,30 +183,30 @@ def jdx_query_price(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-no'], dict(help="""(int) 页码(最小1) """, dest='pageNo', type=int, required=True)), - (['--page-size'], dict(help="""(int) 每页记录数(最小10,最大100) """, dest='pageSize', type=int, required=True)), + (['--deliver-number'], dict(help="""(string) 交付单号 """, dest='deliverNumber', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 输出商品接口 ''', + help=''' 根据交付单号查询交付单信息 ''', description=''' - 输出商品接口。 + 根据交付单号查询交付单信息。 - 示例: jdc elite jdx-query-product --page-no 0 --page-size 0 + 示例: jdc elite get-sale-service-by-deliver-number --deliver-number xxx ''', ) - def jdx_query_product(self): + def get_sale_service_by_deliver_number(self): client_factory = ClientFactory('elite') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.elite.apis.JdxQueryProductRequest import JdxQueryProductRequest + from jdcloud_sdk.services.elite.apis.GetSaleServiceByDeliverNumberRequest import GetSaleServiceByDeliverNumberRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = JdxQueryProductRequest(params_dict, headers) + req = GetSaleServiceByDeliverNumberRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -205,34 +217,30 @@ def jdx_query_product(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-no'], dict(help="""(int) 页码(最小1) """, dest='pageNo', type=int, required=True)), - (['--page-size'], dict(help="""(int) 每页记录数(最小10,最大100) """, dest='pageSize', type=int, required=True)), - (['--deliver-number'], dict(help="""(string) 交付单号 """, dest='deliverNumber', required=False)), - (['--deliver-status'], dict(help="""(int) 交付状态 """, dest='deliverStatus', type=int, required=False)), - (['--create-dt-start'], dict(help="""(string) 交付单创建起始时间,格式:yyyy-MM-dd HH:mm:ss """, dest='createDtStart', required=False)), - (['--create-dt-end'], dict(help="""(string) 交付单创建结束时间,格式:yyyy-MM-dd HH:mm:ss """, dest='createDtEnd', required=False)), + (['--confirm-delivery-info'], dict(help="""(confirmDeliveryInfo) 交付信息 """, dest='confirmDeliveryInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 分页查询交付单信息 ''', + help=''' 确认交付 ''', description=''' - 分页查询交付单信息。 + 确认交付。 - 示例: jdc elite list-sale-service --page-no 0 --page-size 0 + 示例: jdc elite confirm-sale-service-delivery --confirm-delivery-info '{"":""}' ''', ) - def list_sale_service(self): + def confirm_sale_service_delivery(self): client_factory = ClientFactory('elite') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.elite.apis.ListSaleServiceRequest import ListSaleServiceRequest + from jdcloud_sdk.services.elite.apis.ConfirmSaleServiceDeliveryRequest import ConfirmSaleServiceDeliveryRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListSaleServiceRequest(params_dict, headers) + req = ConfirmSaleServiceDeliveryRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -243,29 +251,30 @@ def list_sale_service(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--deliver-number'], dict(help="""(string) 交付单号 """, dest='deliverNumber', required=True)), + (['--report-order-info'], dict(help="""(reportOrderInfo) 上报订单信息 """, dest='reportOrderInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据交付单号查询交付单信息 ''', + help=''' 上报订单 ''', description=''' - 根据交付单号查询交付单信息。 + 上报订单。 - 示例: jdc elite get-sale-service-by-deliver-number --deliver-number xxx + 示例: jdc elite jdx-report-order --report-order-info '{"":""}' ''', ) - def get_sale_service_by_deliver_number(self): + def jdx_report_order(self): client_factory = ClientFactory('elite') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.elite.apis.GetSaleServiceByDeliverNumberRequest import GetSaleServiceByDeliverNumberRequest + from jdcloud_sdk.services.elite.apis.JdxReportOrderRequest import JdxReportOrderRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetSaleServiceByDeliverNumberRequest(params_dict, headers) + req = JdxReportOrderRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -276,29 +285,30 @@ def get_sale_service_by_deliver_number(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--confirm-delivery-info'], dict(help="""(confirmDeliveryInfo) 交付信息 """, dest='confirmDeliveryInfo', required=True)), + (['--create-order-info'], dict(help="""(createOrderInfo) 下单信息 """, dest='createOrderInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 确认交付 ''', + help=''' 下单接口 ''', description=''' - 确认交付。 + 下单接口。 - 示例: jdc elite confirm-sale-service-delivery --confirm-delivery-info '{"":""}' + 示例: jdc elite jdx-create-order --create-order-info '{"":""}' ''', ) - def confirm_sale_service_delivery(self): + def jdx_create_order(self): client_factory = ClientFactory('elite') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.elite.apis.ConfirmSaleServiceDeliveryRequest import ConfirmSaleServiceDeliveryRequest + from jdcloud_sdk.services.elite.apis.JdxCreateOrderRequest import JdxCreateOrderRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ConfirmSaleServiceDeliveryRequest(params_dict, headers) + req = JdxCreateOrderRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -309,31 +319,30 @@ def confirm_sale_service_delivery(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--buyer-pin'], dict(help="""(string) 购买用户pin """, dest='buyerPin', required=True)), - (['--business-data'], dict(help="""(string) 业务数据,与下单时的业务数据一致 """, dest='businessData', required=True)), - (['--query-all'], dict(help="""(bool) 是否查询全部,如果传入false,则只查询当前时间有效的,否则查询所有的 """, dest='queryAll', required=False)), + (['--query-price-param'], dict(help="""(queryPriceParam) 查询价格参数 """, dest='queryPriceParam', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取云存服务信息 ''', + help=''' 查询价格 ''', description=''' - 获取云存服务信息。 + 查询价格。 - 示例: jdc elite get-store-service --buyer-pin xxx --business-data xxx + 示例: jdc elite jdx-query-price --query-price-param '{"":""}' ''', ) - def get_store_service(self): + def jdx_query_price(self): client_factory = ClientFactory('elite') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.elite.apis.GetStoreServiceRequest import GetStoreServiceRequest + from jdcloud_sdk.services.elite.apis.JdxQueryPriceRequest import JdxQueryPriceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetStoreServiceRequest(params_dict, headers) + req = JdxQueryPriceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -343,7 +352,7 @@ def get_store_service(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['jdx-query-delivery-info','jdx-report-order','jdx-create-order','jdx-query-price','jdx-query-product','list-sale-service','get-sale-service-by-deliver-number','confirm-sale-service-delivery','get-store-service',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['jdx-query-delivery-info','get-store-service','jdx-query-product','list-sale-service','get-sale-service-by-deliver-number','confirm-sale-service-delivery','jdx-report-order','jdx-create-order','jdx-query-price',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/function.py b/jdcloud_cli/controllers/services/function.py index 9623e31..b9545ca 100644 --- a/jdcloud_cli/controllers/services/function.py +++ b/jdcloud_cli/controllers/services/function.py @@ -39,29 +39,33 @@ class Meta: @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--function-name'], dict(help="""(string) 别名所属函数名称 """, dest='functionName', required=True)), + (['--list-all'], dict(help="""(bool) 是否返回所有函数 """, dest='listAll', type=bool, required=True)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小 """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) functionId -函数ID,精确匹配,支持多个; functionName - 函数名称,模糊匹配,支持单个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询别名列表 ''', + help=''' 查询函数列表 ''', description=''' - 查询别名列表。 + 查询函数列表。 - 示例: jdc function list-alias --function-name xxx + 示例: jdc function list-function --list-all true ''', ) - def list_alias(self): + def list_function(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.ListAliasRequest import ListAliasRequest + from jdcloud_sdk.services.function.apis.ListFunctionRequest import ListFunctionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListAliasRequest(params_dict, headers) + req = ListFunctionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -72,32 +76,42 @@ def list_alias(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--function-name'], dict(help="""(string) 别名所属函数名称 """, dest='functionName', required=True)), - (['--alias-name'], dict(help="""(string) 别名名称 """, dest='aliasName', required=True)), - (['--description'], dict(help="""(string) 别名描述信息 """, dest='description', required=False)), - (['--version'], dict(help="""(string) 别名对应的版本名称 """, dest='version', required=False)), + (['--name'], dict(help="""(string) 函数名称 """, dest='name', required=False)), + (['--description'], dict(help="""(string) 函数描述信息 """, dest='description', required=False)), + (['--entrance'], dict(help="""(string) 函数入口,格式为入口文件.入口函数名 """, dest='entrance', required=False)), + (['--memory'], dict(help="""(int) 函数运行最大内存 """, dest='memory', type=int, required=False)), + (['--run-time'], dict(help="""(string) 函数运行环境 """, dest='runTime', required=False)), + (['--over-time'], dict(help="""(int) 函数运行超时时间 """, dest='overTime', type=int, required=False)), + (['--version'], dict(help="""(string) 函数版本,默认为LATEST """, dest='version', required=False)), + (['--code'], dict(help="""(code) 函数代码包 """, dest='code', required=False)), + (['--environment'], dict(help="""(env) 函数运行时环境变量 """, dest='environment', required=False)), + (['--log-set-id'], dict(help="""(string) 函数指定的日志集Id """, dest='logSetId', required=False)), + (['--log-topic-id'], dict(help="""(string) 函数指定的日志主题Id """, dest='logTopicId', required=False)), + (['--vpc-id'], dict(help="""(string) 函数配置的VPCId """, dest='vpcId', required=False)), + (['--subnet-id'], dict(help="""(string) 函数配置的子网Id """, dest='subnetId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建别名 ''', + help=''' 创建函数 ''', description=''' - 创建别名。 + 创建函数。 - 示例: jdc function create-alias --function-name xxx --alias-name xxx + 示例: jdc function create-function ''', ) - def create_alias(self): + def create_function(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.CreateAliasRequest import CreateAliasRequest + from jdcloud_sdk.services.function.apis.CreateFunctionRequest import CreateFunctionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateAliasRequest(params_dict, headers) + req = CreateFunctionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -108,30 +122,30 @@ def create_alias(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--function-name'], dict(help="""(string) 别名所属函数名称 """, dest='functionName', required=True)), - (['--alias-name'], dict(help="""(string) 别名名称 """, dest='aliasName', required=True)), + (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询别名详情 ''', + help=''' 查询函数详情 ''', description=''' - 查询别名详情。 + 查询函数详情。 - 示例: jdc function get-alias --function-name xxx --alias-name xxx + 示例: jdc function get-function --function-name xxx ''', ) - def get_alias(self): + def get_function(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.GetAliasRequest import GetAliasRequest + from jdcloud_sdk.services.function.apis.GetFunctionRequest import GetFunctionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetAliasRequest(params_dict, headers) + req = GetFunctionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -142,32 +156,42 @@ def get_alias(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--function-name'], dict(help="""(string) 别名所属函数名称 """, dest='functionName', required=True)), - (['--alias-name'], dict(help="""(string) 别名名称 """, dest='aliasName', required=True)), - (['--description'], dict(help="""(string) 别名描述信息 """, dest='description', required=True)), - (['--version'], dict(help="""(string) 别名对应版本 """, dest='version', required=True)), + (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), + (['--description'], dict(help="""(string) 函数描述信息 """, dest='description', required=False)), + (['--entrance'], dict(help="""(string) 函数入口,格式为入口文件.入口函数名 """, dest='entrance', required=False)), + (['--memory'], dict(help="""(int) 函数运行最大内存 """, dest='memory', type=int, required=False)), + (['--run-time'], dict(help="""(string) 函数运行环境 """, dest='runTime', required=False)), + (['--over-time'], dict(help="""(int) 函数运行超时时间 """, dest='overTime', type=int, required=False)), + (['--version'], dict(help="""(string) 函数版本 """, dest='version', required=False)), + (['--code'], dict(help="""(code) 函数代码包 """, dest='code', required=False)), + (['--environment'], dict(help="""(env) 函数运行时环境变量 """, dest='environment', required=False)), + (['--log-set-id'], dict(help="""(string) 函数指定的日志集Id """, dest='logSetId', required=False)), + (['--log-topic-id'], dict(help="""(string) 函数指定的日志主题Id """, dest='logTopicId', required=False)), + (['--vpc-id'], dict(help="""(string) 函数配置的VPCId """, dest='vpcId', required=False)), + (['--subnet-id'], dict(help="""(string) 函数配置的子网Id """, dest='subnetId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新别名 ''', + help=''' 更新函数 ''', description=''' - 更新别名。 + 更新函数。 - 示例: jdc function update-alias --function-name xxx --alias-name xxx --description xxx --version xxx + 示例: jdc function update-function --function-name xxx ''', ) - def update_alias(self): + def update_function(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.UpdateAliasRequest import UpdateAliasRequest + from jdcloud_sdk.services.function.apis.UpdateFunctionRequest import UpdateFunctionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateAliasRequest(params_dict, headers) + req = UpdateFunctionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -178,30 +202,30 @@ def update_alias(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--function-name'], dict(help="""(string) 别名所属函数名称 """, dest='functionName', required=True)), - (['--alias-name'], dict(help="""(string) 别名名称 """, dest='aliasName', required=True)), + (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除别名 ''', + help=''' 删除函数 ''', description=''' - 删除别名。 + 删除函数。 - 示例: jdc function delete-alias --function-name xxx --alias-name xxx + 示例: jdc function delete-function --function-name xxx ''', ) - def delete_alias(self): + def delete_function(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.DeleteAliasRequest import DeleteAliasRequest + from jdcloud_sdk.services.function.apis.DeleteFunctionRequest import DeleteFunctionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteAliasRequest(params_dict, headers) + req = DeleteFunctionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -212,32 +236,32 @@ def delete_alias(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--list-all'], dict(help="""(bool) 是否返回所有函数 """, dest='listAll', required=True)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小 """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) functionId -函数ID,精确匹配,支持多个; functionName - 函数名称,模糊匹配,支持单个; """, dest='filters', required=False)), + (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), + (['--version-name'], dict(help="""(string) 版本名称 """, dest='versionName', required=True)), + (['--event'], dict(help="""(string) 执行函数的输入事件 """, dest='event', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询函数列表 ''', + help=''' 控制台测试执行函数 ''', description=''' - 查询函数列表。 + 控制台测试执行函数。 - 示例: jdc function list-function --list-all true + 示例: jdc function invoke --function-name xxx --version-name xxx --event xxx ''', ) - def list_function(self): + def invoke(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.ListFunctionRequest import ListFunctionRequest + from jdcloud_sdk.services.function.apis.InvokeRequest import InvokeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListFunctionRequest(params_dict, headers) + req = InvokeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -248,41 +272,32 @@ def list_function(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) 函数名称 """, dest='name', required=False)), - (['--description'], dict(help="""(string) 函数描述信息 """, dest='description', required=False)), - (['--entrance'], dict(help="""(string) 函数入口,格式为入口文件.入口函数名 """, dest='entrance', required=False)), - (['--memory'], dict(help="""(int) 函数运行最大内存 """, dest='memory', type=int, required=False)), - (['--run-time'], dict(help="""(string) 函数运行环境 """, dest='runTime', required=False)), - (['--over-time'], dict(help="""(int) 函数运行超时时间 """, dest='overTime', type=int, required=False)), - (['--version'], dict(help="""(string) 函数版本,默认为LATEST """, dest='version', required=False)), - (['--code'], dict(help="""(code) 函数代码包 """, dest='code', required=False)), - (['--environment'], dict(help="""(env) 函数运行时环境变量 """, dest='environment', required=False)), - (['--log-set-id'], dict(help="""(string) 函数指定的日志集Id """, dest='logSetId', required=False)), - (['--log-topic-id'], dict(help="""(string) 函数指定的日志主题Id """, dest='logTopicId', required=False)), - (['--vpc-id'], dict(help="""(string) 函数配置的VPCId """, dest='vpcId', required=False)), - (['--subnet-id'], dict(help="""(string) 函数配置的子网Id """, dest='subnetId', required=False)), + (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), + (['--version-name'], dict(help="""(string) 版本名称 """, dest='versionName', required=True)), + (['--event'], dict(help="""(string) 异步执行函数的输入事件 """, dest='event', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建函数 ''', + help=''' 异步测试执行函数 ''', description=''' - 创建函数。 + 异步测试执行函数。 - 示例: jdc function create-function + 示例: jdc function async-invoke --function-name xxx --version-name xxx --event xxx ''', ) - def create_function(self): + def async_invoke(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.CreateFunctionRequest import CreateFunctionRequest + from jdcloud_sdk.services.function.apis.AsyncInvokeRequest import AsyncInvokeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateFunctionRequest(params_dict, headers) + req = AsyncInvokeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -295,27 +310,28 @@ def create_function(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询函数详情 ''', + help=''' 查询版本列表 ''', description=''' - 查询函数详情。 + 查询版本列表。 - 示例: jdc function get-function --function-name xxx + 示例: jdc function list-version --function-name xxx ''', ) - def get_function(self): + def list_version(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.GetFunctionRequest import GetFunctionRequest + from jdcloud_sdk.services.function.apis.ListVersionRequest import ListVersionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetFunctionRequest(params_dict, headers) + req = ListVersionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -327,40 +343,30 @@ def get_function(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), - (['--description'], dict(help="""(string) 函数描述信息 """, dest='description', required=False)), - (['--entrance'], dict(help="""(string) 函数入口,格式为入口文件.入口函数名 """, dest='entrance', required=False)), - (['--memory'], dict(help="""(int) 函数运行最大内存 """, dest='memory', type=int, required=False)), - (['--run-time'], dict(help="""(string) 函数运行环境 """, dest='runTime', required=False)), - (['--over-time'], dict(help="""(int) 函数运行超时时间 """, dest='overTime', type=int, required=False)), - (['--version'], dict(help="""(string) 函数版本 """, dest='version', required=False)), - (['--code'], dict(help="""(code) 函数代码包 """, dest='code', required=False)), - (['--environment'], dict(help="""(env) 函数运行时环境变量 """, dest='environment', required=False)), - (['--log-set-id'], dict(help="""(string) 函数指定的日志集Id """, dest='logSetId', required=False)), - (['--log-topic-id'], dict(help="""(string) 函数指定的日志主题Id """, dest='logTopicId', required=False)), - (['--vpc-id'], dict(help="""(string) 函数配置的VPCId """, dest='vpcId', required=False)), - (['--subnet-id'], dict(help="""(string) 函数配置的子网Id """, dest='subnetId', required=False)), + (['--description'], dict(help="""(string) 版本描述 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新函数 ''', + help=''' 创建版本 ''', description=''' - 更新函数。 + 创建版本。 - 示例: jdc function update-function --function-name xxx + 示例: jdc function create-version --function-name xxx ''', ) - def update_function(self): + def create_version(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.UpdateFunctionRequest import UpdateFunctionRequest + from jdcloud_sdk.services.function.apis.CreateVersionRequest import CreateVersionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateFunctionRequest(params_dict, headers) + req = CreateVersionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -372,28 +378,30 @@ def update_function(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), + (['--version-name'], dict(help="""(string) 版本名称 """, dest='versionName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除函数 ''', + help=''' 获取版本详情 ''', description=''' - 删除函数。 + 获取版本详情。 - 示例: jdc function delete-function --function-name xxx + 示例: jdc function get-version --function-name xxx --version-name xxx ''', ) - def delete_function(self): + def get_version(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.DeleteFunctionRequest import DeleteFunctionRequest + from jdcloud_sdk.services.function.apis.GetVersionRequest import GetVersionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteFunctionRequest(params_dict, headers) + req = GetVersionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -406,29 +414,29 @@ def delete_function(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), (['--version-name'], dict(help="""(string) 版本名称 """, dest='versionName', required=True)), - (['--event'], dict(help="""(string) 执行函数的输入事件 """, dest='event', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 控制台测试执行函数 ''', + help=''' 删除版本 ''', description=''' - 控制台测试执行函数。 + 删除版本。 - 示例: jdc function invoke --function-name xxx --version-name xxx --event xxx + 示例: jdc function delete-version --function-name xxx --version-name xxx ''', ) - def invoke(self): + def delete_version(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.InvokeRequest import InvokeRequest + from jdcloud_sdk.services.function.apis.DeleteVersionRequest import DeleteVersionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = InvokeRequest(params_dict, headers) + req = DeleteVersionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -439,31 +447,30 @@ def invoke(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), - (['--version-name'], dict(help="""(string) 版本名称 """, dest='versionName', required=True)), - (['--event'], dict(help="""(string) 异步执行函数的输入事件 """, dest='event', required=True)), + (['--function-name'], dict(help="""(string) 别名所属函数名称 """, dest='functionName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 异步测试执行函数 ''', + help=''' 查询别名列表 ''', description=''' - 异步测试执行函数。 + 查询别名列表。 - 示例: jdc function async-invoke --function-name xxx --version-name xxx --event xxx + 示例: jdc function list-alias --function-name xxx ''', ) - def async_invoke(self): + def list_alias(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.AsyncInvokeRequest import AsyncInvokeRequest + from jdcloud_sdk.services.function.apis.ListAliasRequest import ListAliasRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AsyncInvokeRequest(params_dict, headers) + req = ListAliasRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -474,31 +481,33 @@ def async_invoke(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), - (['--version-name'], dict(help="""(string) 版本名称 """, dest='versionName', required=True)), - (['--trigger-id'], dict(help="""(string) 触发器Id """, dest='triggerId', required=True)), + (['--function-name'], dict(help="""(string) 别名所属函数名称 """, dest='functionName', required=True)), + (['--alias-name'], dict(help="""(string) 别名名称 """, dest='aliasName', required=True)), + (['--description'], dict(help="""(string) 别名描述信息 """, dest='description', required=False)), + (['--version'], dict(help="""(string) 别名对应的版本名称 """, dest='version', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取触发器详情 ''', + help=''' 创建别名 ''', description=''' - 获取触发器详情。 + 创建别名。 - 示例: jdc function get-trigger --function-name xxx --version-name xxx --trigger-id xxx + 示例: jdc function create-alias --function-name xxx --alias-name xxx ''', ) - def get_trigger(self): + def create_alias(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.GetTriggerRequest import GetTriggerRequest + from jdcloud_sdk.services.function.apis.CreateAliasRequest import CreateAliasRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetTriggerRequest(params_dict, headers) + req = CreateAliasRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -509,29 +518,31 @@ def get_trigger(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), + (['--function-name'], dict(help="""(string) 别名所属函数名称 """, dest='functionName', required=True)), + (['--alias-name'], dict(help="""(string) 别名名称 """, dest='aliasName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询版本列表 ''', + help=''' 查询别名详情 ''', description=''' - 查询版本列表。 + 查询别名详情。 - 示例: jdc function list-version --function-name xxx + 示例: jdc function get-alias --function-name xxx --alias-name xxx ''', ) - def list_version(self): + def get_alias(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.ListVersionRequest import ListVersionRequest + from jdcloud_sdk.services.function.apis.GetAliasRequest import GetAliasRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListVersionRequest(params_dict, headers) + req = GetAliasRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -542,30 +553,33 @@ def list_version(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), - (['--description'], dict(help="""(string) 版本描述 """, dest='description', required=False)), + (['--function-name'], dict(help="""(string) 别名所属函数名称 """, dest='functionName', required=True)), + (['--alias-name'], dict(help="""(string) 别名名称 """, dest='aliasName', required=True)), + (['--description'], dict(help="""(string) 别名描述信息 """, dest='description', required=True)), + (['--version'], dict(help="""(string) 别名对应版本 """, dest='version', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建版本 ''', + help=''' 更新别名 ''', description=''' - 创建版本。 + 更新别名。 - 示例: jdc function create-version --function-name xxx + 示例: jdc function update-alias --function-name xxx --alias-name xxx --description xxx --version xxx ''', ) - def create_version(self): + def update_alias(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.CreateVersionRequest import CreateVersionRequest + from jdcloud_sdk.services.function.apis.UpdateAliasRequest import UpdateAliasRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVersionRequest(params_dict, headers) + req = UpdateAliasRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -576,30 +590,31 @@ def create_version(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), - (['--version-name'], dict(help="""(string) 版本名称 """, dest='versionName', required=True)), + (['--function-name'], dict(help="""(string) 别名所属函数名称 """, dest='functionName', required=True)), + (['--alias-name'], dict(help="""(string) 别名名称 """, dest='aliasName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取版本详情 ''', + help=''' 删除别名 ''', description=''' - 获取版本详情。 + 删除别名。 - 示例: jdc function get-version --function-name xxx --version-name xxx + 示例: jdc function delete-alias --function-name xxx --alias-name xxx ''', ) - def get_version(self): + def delete_alias(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.GetVersionRequest import GetVersionRequest + from jdcloud_sdk.services.function.apis.DeleteAliasRequest import DeleteAliasRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVersionRequest(params_dict, headers) + req = DeleteAliasRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -612,28 +627,30 @@ def get_version(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--function-name'], dict(help="""(string) 函数名称 """, dest='functionName', required=True)), (['--version-name'], dict(help="""(string) 版本名称 """, dest='versionName', required=True)), + (['--trigger-id'], dict(help="""(string) 触发器Id """, dest='triggerId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除版本 ''', + help=''' 获取触发器详情 ''', description=''' - 删除版本。 + 获取触发器详情。 - 示例: jdc function delete-version --function-name xxx --version-name xxx + 示例: jdc function get-trigger --function-name xxx --version-name xxx --trigger-id xxx ''', ) - def delete_version(self): + def get_trigger(self): client_factory = ClientFactory('function') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.function.apis.DeleteVersionRequest import DeleteVersionRequest + from jdcloud_sdk.services.function.apis.GetTriggerRequest import GetTriggerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVersionRequest(params_dict, headers) + req = GetTriggerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -643,7 +660,7 @@ def delete_version(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['list-alias','create-alias','get-alias','update-alias','delete-alias','list-function','create-function','get-function','update-function','delete-function','invoke','async-invoke','get-trigger','list-version','create-version','get-version','delete-version',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['list-function','create-function','get-function','update-function','delete-function','invoke','async-invoke','list-version','create-version','get-version','delete-version','list-alias','create-alias','get-alias','update-alias','delete-alias','get-trigger',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/httpdns.py b/jdcloud_cli/controllers/services/httpdns.py index 7e7995a..1d7900d 100644 --- a/jdcloud_cli/controllers/services/httpdns.py +++ b/jdcloud_cli/controllers/services/httpdns.py @@ -40,6 +40,7 @@ class Meta: arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -72,6 +73,7 @@ def get_account_id(self): arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -104,6 +106,7 @@ def create_account(self): arguments=[ (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -138,6 +141,7 @@ def get_account_info(self): (['--action'], dict(help="""(string) 操作类型, create创建, enable启用, disable禁用 """, dest='action', required=False)), (['--key'], dict(help="""(string) 操作的密钥 """, dest='key', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -173,6 +177,7 @@ def operate_key(self): (['--page-size'], dict(help="""(int) 分页查询时设置的每页行数 """, dest='pageSize', type=int, required=True)), (['--domain-name'], dict(help="""(string) 关键字,按照”%domainName%”模式搜索域名 """, dest='domainName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -180,7 +185,7 @@ def operate_key(self): description=''' 查询使用httpdns服务的域名。 - 示例: jdc httpdns get-domains --page-index 0 --page-size 0 + 示例: jdc httpdns get-domains --page-index 5 --page-size 5 ''', ) def get_domains(self): @@ -206,6 +211,7 @@ def get_domains(self): (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--domain-names'], dict(help="""(array: string) 需要添加的域名数组 """, dest='domainNames', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -239,6 +245,7 @@ def add_domains(self): (['--region-id'], dict(help="""(string) 实例所属的地域ID """, dest='regionId', required=False)), (['--domain-names'], dict(help="""(array: string) 需要删除的域名数组 """, dest='domainNames', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, diff --git a/jdcloud_cli/controllers/services/iam.py b/jdcloud_cli/controllers/services/iam.py index 330ba24..3eadc4c 100644 --- a/jdcloud_cli/controllers/services/iam.py +++ b/jdcloud_cli/controllers/services/iam.py @@ -38,30 +38,30 @@ class Meta: @expose( arguments=[ - (['--sub-user'], dict(help="""(string) 子用户名称 """, dest='subUser', required=True)), - (['--access-key'], dict(help="""(string) accessKey """, dest='accessKey', required=True)), + (['--create-sub-user-info'], dict(help="""(createSubUserInfo) 子用户信息 """, dest='createSubUserInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启用子用户AccessKey ''', + help=''' 创建子用户 ''', description=''' - 启用子用户AccessKey。 + 创建子用户。 - 示例: jdc iam enable-sub-user-access-key --sub-user xxx --access-key xxx + 示例: jdc iam create-sub-user --create-sub-user-info '{"":""}' ''', ) - def enable_sub_user_access_key(self): + def create_sub_user(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.EnableSubUserAccessKeyRequest import EnableSubUserAccessKeyRequest + from jdcloud_sdk.services.iam.apis.CreateSubUserRequest import CreateSubUserRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableSubUserAccessKeyRequest(params_dict, headers) + req = CreateSubUserRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -71,30 +71,30 @@ def enable_sub_user_access_key(self): @expose( arguments=[ - (['--sub-user'], dict(help="""(string) 子用户名称 """, dest='subUser', required=True)), - (['--access-key'], dict(help="""(string) accessKey """, dest='accessKey', required=True)), + (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 禁用子用户的AccessKey ''', + help=''' 查询子用户信息 ''', description=''' - 禁用子用户的AccessKey。 + 查询子用户信息。 - 示例: jdc iam disable-sub-user-access-key --sub-user xxx --access-key xxx + 示例: jdc iam describe-sub-user --sub-user xxx ''', ) - def disable_sub_user_access_key(self): + def describe_sub_user(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DisableSubUserAccessKeyRequest import DisableSubUserAccessKeyRequest + from jdcloud_sdk.services.iam.apis.DescribeSubUserRequest import DescribeSubUserRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisableSubUserAccessKeyRequest(params_dict, headers) + req = DescribeSubUserRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -104,30 +104,31 @@ def disable_sub_user_access_key(self): @expose( arguments=[ - (['--sub-user'], dict(help="""(string) 子用户名称 """, dest='subUser', required=True)), - (['--access-key'], dict(help="""(string) accessKey """, dest='accessKey', required=True)), + (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), + (['--update-sub-user-info'], dict(help="""(updateSubUserInfo) 子用户信息 """, dest='updateSubUserInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除子用户的AccessKey ''', + help=''' 修改子用户信息 ''', description=''' - 删除子用户的AccessKey。 + 修改子用户信息。 - 示例: jdc iam delete-sub-user-access-key --sub-user xxx --access-key xxx + 示例: jdc iam update-sub-user --sub-user xxx --update-sub-user-info '{"":""}' ''', ) - def delete_sub_user_access_key(self): + def update_sub_user(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DeleteSubUserAccessKeyRequest import DeleteSubUserAccessKeyRequest + from jdcloud_sdk.services.iam.apis.UpdateSubUserRequest import UpdateSubUserRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteSubUserAccessKeyRequest(params_dict, headers) + req = UpdateSubUserRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -137,29 +138,30 @@ def delete_sub_user_access_key(self): @expose( arguments=[ - (['--create-group-info'], dict(help="""(createGroupInfo) NA """, dest='createGroupInfo', required=True)), + (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建用户组 ''', + help=''' 删除子用户信息 ''', description=''' - 创建用户组。 + 删除子用户信息。 - 示例: jdc iam create-group --create-group-info '{"":""}' + 示例: jdc iam delete-sub-user --sub-user xxx ''', ) - def create_group(self): + def delete_sub_user(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.CreateGroupRequest import CreateGroupRequest + from jdcloud_sdk.services.iam.apis.DeleteSubUserRequest import DeleteSubUserRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateGroupRequest(params_dict, headers) + req = DeleteSubUserRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -169,29 +171,33 @@ def create_group(self): @expose( arguments=[ - (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), + (['--page-number'], dict(help="""(int) 页码,默认1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认50,取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--keyword'], dict(help="""(string) 关键字 """, dest='keyword', required=False)), + (['--sort'], dict(help="""(int) 排序规则:0-创建时间顺序排序,1-创建时间倒序排序 """, dest='sort', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户组详情 ''', + help=''' 查询子用户列表 ''', description=''' - 查询用户组详情。 + 查询子用户列表。 - 示例: jdc iam describe-group --group-name xxx + 示例: jdc iam describe-sub-users ''', ) - def describe_group(self): + def describe_sub_users(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribeGroupRequest import DescribeGroupRequest + from jdcloud_sdk.services.iam.apis.DescribeSubUsersRequest import DescribeSubUsersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeGroupRequest(params_dict, headers) + req = DescribeSubUsersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -201,30 +207,30 @@ def describe_group(self): @expose( arguments=[ - (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), - (['--update-group-info'], dict(help="""(updateGroupInfo) NA """, dest='updateGroupInfo', required=True)), + (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改用户组 ''', + help=''' 查询子用户所属的所有组 ''', description=''' - 修改用户组。 + 查询子用户所属的所有组。 - 示例: jdc iam update-group --group-name xxx --update-group-info '{"":""}' + 示例: jdc iam describe-sub-user-groups --sub-user xxx ''', ) - def update_group(self): + def describe_sub_user_groups(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.UpdateGroupRequest import UpdateGroupRequest + from jdcloud_sdk.services.iam.apis.DescribeSubUserGroupsRequest import DescribeSubUserGroupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateGroupRequest(params_dict, headers) + req = DescribeSubUserGroupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -234,29 +240,30 @@ def update_group(self): @expose( arguments=[ - (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), + (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除用户组 ''', + help=''' 查询子用户绑定的策略列表 ''', description=''' - 删除用户组。 + 查询子用户绑定的策略列表。 - 示例: jdc iam delete-group --group-name xxx + 示例: jdc iam describe-attached-sub-user-policies --sub-user xxx ''', ) - def delete_group(self): + def describe_attached_sub_user_policies(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DeleteGroupRequest import DeleteGroupRequest + from jdcloud_sdk.services.iam.apis.DescribeAttachedSubUserPoliciesRequest import DescribeAttachedSubUserPoliciesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteGroupRequest(params_dict, headers) + req = DescribeAttachedSubUserPoliciesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -266,31 +273,31 @@ def delete_group(self): @expose( arguments=[ - (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), - (['--page-number'], dict(help="""(int) 页码,默认1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认50,取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), + (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户组内的子用户列表 ''', + help=''' 为子用户解绑策略 ''', description=''' - 查询用户组内的子用户列表 。 + 为子用户解绑策略。 - 示例: jdc iam describe-group-sub-users --group-name xxx + 示例: jdc iam detach-sub-user-policy --sub-user xxx --policy-name xxx ''', ) - def describe_group_sub_users(self): + def detach_sub_user_policy(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribeGroupSubUsersRequest import DescribeGroupSubUsersRequest + from jdcloud_sdk.services.iam.apis.DetachSubUserPolicyRequest import DetachSubUserPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeGroupSubUsersRequest(params_dict, headers) + req = DetachSubUserPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -300,32 +307,31 @@ def describe_group_sub_users(self): @expose( arguments=[ - (['--page-number'], dict(help="""(int) 页码,默认1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认50,取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--keyword'], dict(help="""(string) 关键字 """, dest='keyword', required=False)), - (['--sort'], dict(help="""(int) 排序规则:0-创建时间顺序排序,1-创建时间倒序排序 """, dest='sort', type=int, required=False)), + (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), + (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户组列表 ''', + help=''' 为子用户绑定策略 ''', description=''' - 查询用户组列表。 + 为子用户绑定策略。 - 示例: jdc iam describe-groups + 示例: jdc iam attach-sub-user-policy --sub-user xxx --policy-name xxx ''', ) - def describe_groups(self): + def attach_sub_user_policy(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribeGroupsRequest import DescribeGroupsRequest + from jdcloud_sdk.services.iam.apis.AttachSubUserPolicyRequest import AttachSubUserPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeGroupsRequest(params_dict, headers) + req = AttachSubUserPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -335,29 +341,31 @@ def describe_groups(self): @expose( arguments=[ - (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--create-permission-info'], dict(help="""(createPermissionInfo) 权限信息 """, dest='createPermissionInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 列举用户组的策略 ''', + help=''' 创建策略 ''', description=''' - 列举用户组的策略。 + 创建策略。 - 示例: jdc iam describe-attached-group-policies --group-name xxx + 示例: jdc iam create-permission --create-permission-info '{"":""}' ''', ) - def describe_attached_group_policies(self): + def create_permission(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribeAttachedGroupPoliciesRequest import DescribeAttachedGroupPoliciesRequest + from jdcloud_sdk.services.iam.apis.CreatePermissionRequest import CreatePermissionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAttachedGroupPoliciesRequest(params_dict, headers) + req = CreatePermissionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -367,30 +375,31 @@ def describe_attached_group_policies(self): @expose( arguments=[ - (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), - (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--permission-id'], dict(help="""(int) 权限id """, dest='permissionId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 为用户组解绑策略 ''', + help=''' 查询策略详情 ''', description=''' - 为用户组解绑策略。 + 查询策略详情。 - 示例: jdc iam detach-group-policy --group-name xxx --policy-name xxx + 示例: jdc iam describe-permission-detail --permission-id 5 ''', ) - def detach_group_policy(self): + def describe_permission_detail(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DetachGroupPolicyRequest import DetachGroupPolicyRequest + from jdcloud_sdk.services.iam.apis.DescribePermissionDetailRequest import DescribePermissionDetailRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DetachGroupPolicyRequest(params_dict, headers) + req = DescribePermissionDetailRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -400,30 +409,32 @@ def detach_group_policy(self): @expose( arguments=[ - (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), - (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--permission-id'], dict(help="""(int) 权限id """, dest='permissionId', type=int, required=True)), + (['--update-permission-info'], dict(help="""(updatePermissionInfo) 权限信息 """, dest='updatePermissionInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 为用户组绑定策略 ''', + help=''' 修改策略 ''', description=''' - 为用户组绑定策略。 + 修改策略。 - 示例: jdc iam attach-group-policy --group-name xxx --policy-name xxx + 示例: jdc iam update-permission --permission-id 5 --update-permission-info '{"":""}' ''', ) - def attach_group_policy(self): + def update_permission(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.AttachGroupPolicyRequest import AttachGroupPolicyRequest + from jdcloud_sdk.services.iam.apis.UpdatePermissionRequest import UpdatePermissionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AttachGroupPolicyRequest(params_dict, headers) + req = UpdatePermissionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -433,30 +444,34 @@ def attach_group_policy(self): @expose( arguments=[ - (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), - (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=True)), + (['--page-size'], dict(help="""(int) 每页显示数目 """, dest='pageSize', type=int, required=True)), + (['--keyword'], dict(help="""(string) 关键字 """, dest='keyword', required=False)), + (['--query-type'], dict(help="""(int) 权限类型,0-全部,1-系统权限,2-自定义权限 """, dest='queryType', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 将子用户从组中删除 ''', + help=''' 查询策略列表 ''', description=''' - 将子用户从组中删除。 + 查询策略列表。 - 示例: jdc iam remove-sub-user-from-group --group-name xxx --sub-user xxx + 示例: jdc iam describe-permissions --page-number 5 --page-size 5 --query-type 5 ''', ) - def remove_sub_user_from_group(self): + def describe_permissions(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.RemoveSubUserFromGroupRequest import RemoveSubUserFromGroupRequest + from jdcloud_sdk.services.iam.apis.DescribePermissionsRequest import DescribePermissionsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RemoveSubUserFromGroupRequest(params_dict, headers) + req = DescribePermissionsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -466,30 +481,33 @@ def remove_sub_user_from_group(self): @expose( arguments=[ - (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), - (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--sub-user'], dict(help="""(string) 子用户用户名 """, dest='subUser', required=True)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=True)), + (['--page-size'], dict(help="""(int) 每页显示数目 """, dest='pageSize', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加子用户到用户组中 ''', + help=''' 查询子用户策略列表 ''', description=''' - 添加子用户到用户组中。 + 查询子用户策略列表。 - 示例: jdc iam add-sub-user-to-group --group-name xxx --sub-user xxx + 示例: jdc iam describe-sub-user-permissions --sub-user xxx --page-number 5 --page-size 5 ''', ) - def add_sub_user_to_group(self): + def describe_sub_user_permissions(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.AddSubUserToGroupRequest import AddSubUserToGroupRequest + from jdcloud_sdk.services.iam.apis.DescribeSubUserPermissionsRequest import DescribeSubUserPermissionsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddSubUserToGroupRequest(params_dict, headers) + req = DescribeSubUserPermissionsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -500,29 +518,31 @@ def add_sub_user_to_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--create-permission-info'], dict(help="""(createPermissionInfo) 权限信息 """, dest='createPermissionInfo', required=True)), + (['--sub-user'], dict(help="""(string) 子用户用户名 """, dest='subUser', required=True)), + (['--add-permissions-info'], dict(help="""(addPermissionsInfo) 权限信息 """, dest='addPermissionsInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建策略 ''', + help=''' 为子用户绑定策略 ''', description=''' - 创建策略。 + 为子用户绑定策略。 - 示例: jdc iam create-permission --create-permission-info '{"":""}' + 示例: jdc iam add-permissions-to-sub-user --sub-user xxx --add-permissions-info '{"":""}' ''', ) - def create_permission(self): + def add_permissions_to_sub_user(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.CreatePermissionRequest import CreatePermissionRequest + from jdcloud_sdk.services.iam.apis.AddPermissionsToSubUserRequest import AddPermissionsToSubUserRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreatePermissionRequest(params_dict, headers) + req = AddPermissionsToSubUserRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -534,28 +554,30 @@ def create_permission(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--permission-id'], dict(help="""(int) 权限id """, dest='permissionId', type=int, required=True)), + (['--sub-user'], dict(help="""(string) 子用户用户名 """, dest='subUser', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询策略详情 ''', + help=''' 为子用户解绑策略 ''', description=''' - 查询策略详情。 + 为子用户解绑策略。 - 示例: jdc iam describe-permission-detail --permission-id 5 + 示例: jdc iam remove-permission-of-sub-user --permission-id 5 --sub-user xxx ''', ) - def describe_permission_detail(self): + def remove_permission_of_sub_user(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribePermissionDetailRequest import DescribePermissionDetailRequest + from jdcloud_sdk.services.iam.apis.RemovePermissionOfSubUserRequest import RemovePermissionOfSubUserRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribePermissionDetailRequest(params_dict, headers) + req = RemovePermissionOfSubUserRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -565,31 +587,31 @@ def describe_permission_detail(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--permission-id'], dict(help="""(int) 权限id """, dest='permissionId', type=int, required=True)), - (['--update-permission-info'], dict(help="""(updatePermissionInfo) 权限信息 """, dest='updatePermissionInfo', required=True)), + (['--sub-user'], dict(help="""(string) 子用户名称 """, dest='subUser', required=True)), + (['--access-key'], dict(help="""(string) accessKey """, dest='accessKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改策略 ''', + help=''' 启用子用户AccessKey ''', description=''' - 修改策略。 + 启用子用户AccessKey。 - 示例: jdc iam update-permission --permission-id 5 --update-permission-info '{"":""}' + 示例: jdc iam enable-sub-user-access-key --sub-user xxx --access-key xxx ''', ) - def update_permission(self): + def enable_sub_user_access_key(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.UpdatePermissionRequest import UpdatePermissionRequest + from jdcloud_sdk.services.iam.apis.EnableSubUserAccessKeyRequest import EnableSubUserAccessKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdatePermissionRequest(params_dict, headers) + req = EnableSubUserAccessKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -599,33 +621,31 @@ def update_permission(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=True)), - (['--page-size'], dict(help="""(int) 每页显示数目 """, dest='pageSize', type=int, required=True)), - (['--keyword'], dict(help="""(string) 关键字 """, dest='keyword', required=False)), - (['--query-type'], dict(help="""(int) 权限类型,0-全部,1-系统权限,2-自定义权限 """, dest='queryType', type=int, required=True)), + (['--sub-user'], dict(help="""(string) 子用户名称 """, dest='subUser', required=True)), + (['--access-key'], dict(help="""(string) accessKey """, dest='accessKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询策略列表 ''', + help=''' 禁用子用户的AccessKey ''', description=''' - 查询策略列表。 + 禁用子用户的AccessKey。 - 示例: jdc iam describe-permissions --page-number 0 --page-size 0 --query-type 0 + 示例: jdc iam disable-sub-user-access-key --sub-user xxx --access-key xxx ''', ) - def describe_permissions(self): + def disable_sub_user_access_key(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribePermissionsRequest import DescribePermissionsRequest + from jdcloud_sdk.services.iam.apis.DisableSubUserAccessKeyRequest import DisableSubUserAccessKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribePermissionsRequest(params_dict, headers) + req = DisableSubUserAccessKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -635,32 +655,31 @@ def describe_permissions(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--sub-user'], dict(help="""(string) 子用户用户名 """, dest='subUser', required=True)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=True)), - (['--page-size'], dict(help="""(int) 每页显示数目 """, dest='pageSize', type=int, required=True)), + (['--sub-user'], dict(help="""(string) 子用户名称 """, dest='subUser', required=True)), + (['--access-key'], dict(help="""(string) accessKey """, dest='accessKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询子用户策略列表 ''', + help=''' 删除子用户的AccessKey ''', description=''' - 查询子用户策略列表。 + 删除子用户的AccessKey。 - 示例: jdc iam describe-sub-user-permissions --sub-user xxx --page-number 0 --page-size 0 + 示例: jdc iam delete-sub-user-access-key --sub-user xxx --access-key xxx ''', ) - def describe_sub_user_permissions(self): + def delete_sub_user_access_key(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribeSubUserPermissionsRequest import DescribeSubUserPermissionsRequest + from jdcloud_sdk.services.iam.apis.DeleteSubUserAccessKeyRequest import DeleteSubUserAccessKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSubUserPermissionsRequest(params_dict, headers) + req = DeleteSubUserAccessKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -670,31 +689,30 @@ def describe_sub_user_permissions(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--sub-user'], dict(help="""(string) 子用户用户名 """, dest='subUser', required=True)), - (['--add-permissions-info'], dict(help="""(addPermissionsInfo) 权限信息 """, dest='addPermissionsInfo', required=True)), + (['--create-policy-info'], dict(help="""(createPolicyInfo) 策略信息 """, dest='createPolicyInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 为子用户绑定策略 ''', + help=''' 创建策略 ''', description=''' - 为子用户绑定策略。 + 创建策略。 - 示例: jdc iam add-permissions-to-sub-user --sub-user xxx --add-permissions-info '{"":""}' + 示例: jdc iam create-policy --create-policy-info '{"":""}' ''', ) - def add_permissions_to_sub_user(self): + def create_policy(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.AddPermissionsToSubUserRequest import AddPermissionsToSubUserRequest + from jdcloud_sdk.services.iam.apis.CreatePolicyRequest import CreatePolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddPermissionsToSubUserRequest(params_dict, headers) + req = CreatePolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -704,31 +722,30 @@ def add_permissions_to_sub_user(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--permission-id'], dict(help="""(int) 权限id """, dest='permissionId', type=int, required=True)), - (['--sub-user'], dict(help="""(string) 子用户用户名 """, dest='subUser', required=True)), + (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 为子用户解绑策略 ''', + help=''' 查询策略详情 ''', description=''' - 为子用户解绑策略。 + 查询策略详情。 - 示例: jdc iam remove-permission-of-sub-user --permission-id 5 --sub-user xxx + 示例: jdc iam describe-policy --policy-name xxx ''', ) - def remove_permission_of_sub_user(self): + def describe_policy(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.RemovePermissionOfSubUserRequest import RemovePermissionOfSubUserRequest + from jdcloud_sdk.services.iam.apis.DescribePolicyRequest import DescribePolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RemovePermissionOfSubUserRequest(params_dict, headers) + req = DescribePolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -738,29 +755,31 @@ def remove_permission_of_sub_user(self): @expose( arguments=[ - (['--create-policy-info'], dict(help="""(createPolicyInfo) 策略信息 """, dest='createPolicyInfo', required=True)), + (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), + (['--update-policy-info'], dict(help="""(updatePolicyInfo) 策略文档信息 """, dest='updatePolicyInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建策略 ''', + help=''' 修改策略文档 ''', description=''' - 创建策略。 + 修改策略文档。 - 示例: jdc iam create-policy --create-policy-info '{"":""}' + 示例: jdc iam update-policy --policy-name xxx --update-policy-info '{"":""}' ''', ) - def create_policy(self): + def update_policy(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.CreatePolicyRequest import CreatePolicyRequest + from jdcloud_sdk.services.iam.apis.UpdatePolicyRequest import UpdatePolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreatePolicyRequest(params_dict, headers) + req = UpdatePolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -772,27 +791,28 @@ def create_policy(self): arguments=[ (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询策略详情 ''', + help=''' 删除策略 ''', description=''' - 查询策略详情。 + 删除策略。 - 示例: jdc iam describe-policy --policy-name xxx + 示例: jdc iam delete-policy --policy-name xxx ''', ) - def describe_policy(self): + def delete_policy(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribePolicyRequest import DescribePolicyRequest + from jdcloud_sdk.services.iam.apis.DeletePolicyRequest import DeletePolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribePolicyRequest(params_dict, headers) + req = DeletePolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -803,29 +823,30 @@ def describe_policy(self): @expose( arguments=[ (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), - (['--update-policy-info'], dict(help="""(updatePolicyInfo) 策略文档信息 """, dest='updatePolicyInfo', required=True)), + (['--update-policy-description-info'], dict(help="""(updatePolicyDescriptionInfo) 策略描述信息 """, dest='updatePolicyDescriptionInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改策略文档 ''', + help=''' 修改策略描述 ''', description=''' - 修改策略文档。 + 修改策略描述。 - 示例: jdc iam update-policy --policy-name xxx --update-policy-info '{"":""}' + 示例: jdc iam update-policy-description --policy-name xxx --update-policy-description-info '{"":""}' ''', ) - def update_policy(self): + def update_policy_description(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.UpdatePolicyRequest import UpdatePolicyRequest + from jdcloud_sdk.services.iam.apis.UpdatePolicyDescriptionRequest import UpdatePolicyDescriptionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdatePolicyRequest(params_dict, headers) + req = UpdatePolicyDescriptionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -835,29 +856,34 @@ def update_policy(self): @expose( arguments=[ - (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), + (['--page-number'], dict(help="""(int) 页码,默认1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认50,取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--keyword'], dict(help="""(string) 关键字 """, dest='keyword', required=False)), + (['--query-type'], dict(help="""(int) 策略类型:0-全部(默认),1-系统策略,2-自定义策略 """, dest='queryType', type=int, required=False)), + (['--sort'], dict(help="""(int) 排序规则:0-创建时间顺序排序,1-创建时间倒序排序 """, dest='sort', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除策略 ''', + help=''' 查询策略列表 ''', description=''' - 删除策略。 + 查询策略列表。 - 示例: jdc iam delete-policy --policy-name xxx + 示例: jdc iam describe-policies ''', ) - def delete_policy(self): + def describe_policies(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DeletePolicyRequest import DeletePolicyRequest + from jdcloud_sdk.services.iam.apis.DescribePoliciesRequest import DescribePoliciesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeletePolicyRequest(params_dict, headers) + req = DescribePoliciesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -867,30 +893,30 @@ def delete_policy(self): @expose( arguments=[ - (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), - (['--update-policy-description-info'], dict(help="""(updatePolicyDescriptionInfo) 策略描述信息 """, dest='updatePolicyDescriptionInfo', required=True)), + (['--create-group-info'], dict(help="""(createGroupInfo) NA """, dest='createGroupInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改策略描述 ''', + help=''' 创建用户组 ''', description=''' - 修改策略描述。 + 创建用户组。 - 示例: jdc iam update-policy-description --policy-name xxx --update-policy-description-info '{"":""}' + 示例: jdc iam create-group --create-group-info '{"":""}' ''', ) - def update_policy_description(self): + def create_group(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.UpdatePolicyDescriptionRequest import UpdatePolicyDescriptionRequest + from jdcloud_sdk.services.iam.apis.CreateGroupRequest import CreateGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdatePolicyDescriptionRequest(params_dict, headers) + req = CreateGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -900,33 +926,30 @@ def update_policy_description(self): @expose( arguments=[ - (['--page-number'], dict(help="""(int) 页码,默认1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认50,取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--keyword'], dict(help="""(string) 关键字 """, dest='keyword', required=False)), - (['--query-type'], dict(help="""(int) 策略类型:0-全部(默认),1-系统策略,2-自定义策略 """, dest='queryType', type=int, required=False)), - (['--sort'], dict(help="""(int) 排序规则:0-创建时间顺序排序,1-创建时间倒序排序 """, dest='sort', type=int, required=False)), + (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询策略列表 ''', + help=''' 查询用户组详情 ''', description=''' - 查询策略列表。 + 查询用户组详情。 - 示例: jdc iam describe-policies + 示例: jdc iam describe-group --group-name xxx ''', ) - def describe_policies(self): + def describe_group(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribePoliciesRequest import DescribePoliciesRequest + from jdcloud_sdk.services.iam.apis.DescribeGroupRequest import DescribeGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribePoliciesRequest(params_dict, headers) + req = DescribeGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -936,29 +959,31 @@ def describe_policies(self): @expose( arguments=[ - (['--create-role-info'], dict(help="""(createRoleInfo) 角色信息 """, dest='createRoleInfo', required=True)), + (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), + (['--update-group-info'], dict(help="""(updateGroupInfo) NA """, dest='updateGroupInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建角色 ''', + help=''' 修改用户组 ''', description=''' - 创建角色。 + 修改用户组。 - 示例: jdc iam create-role --create-role-info '{"":""}' + 示例: jdc iam update-group --group-name xxx --update-group-info '{"":""}' ''', ) - def create_role(self): + def update_group(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.CreateRoleRequest import CreateRoleRequest + from jdcloud_sdk.services.iam.apis.UpdateGroupRequest import UpdateGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateRoleRequest(params_dict, headers) + req = UpdateGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -968,29 +993,30 @@ def create_role(self): @expose( arguments=[ - (['--role-name'], dict(help="""(string) 角色名称 """, dest='roleName', required=True)), + (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询角色详情 ''', + help=''' 删除用户组 ''', description=''' - 查询角色详情。 + 删除用户组。 - 示例: jdc iam describe-role --role-name xxx + 示例: jdc iam delete-group --group-name xxx ''', ) - def describe_role(self): + def delete_group(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribeRoleRequest import DescribeRoleRequest + from jdcloud_sdk.services.iam.apis.DeleteGroupRequest import DeleteGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeRoleRequest(params_dict, headers) + req = DeleteGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1000,29 +1026,32 @@ def describe_role(self): @expose( arguments=[ - (['--role-name'], dict(help="""(string) 角色名称 """, dest='roleName', required=True)), + (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), + (['--page-number'], dict(help="""(int) 页码,默认1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认50,取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除角色 ''', + help=''' 查询用户组内的子用户列表 ''', description=''' - 删除角色。 + 查询用户组内的子用户列表 。 - 示例: jdc iam delete-role --role-name xxx + 示例: jdc iam describe-group-sub-users --group-name xxx ''', ) - def delete_role(self): + def describe_group_sub_users(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DeleteRoleRequest import DeleteRoleRequest + from jdcloud_sdk.services.iam.apis.DescribeGroupSubUsersRequest import DescribeGroupSubUsersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteRoleRequest(params_dict, headers) + req = DescribeGroupSubUsersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1032,30 +1061,33 @@ def delete_role(self): @expose( arguments=[ - (['--role-name'], dict(help="""(string) 角色名称 """, dest='roleName', required=True)), - (['--update-assume-role-policy-info'], dict(help="""(updateAssumeRolePolicyInfo) 角色权限信息 """, dest='updateAssumeRolePolicyInfo', required=True)), + (['--page-number'], dict(help="""(int) 页码,默认1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认50,取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--keyword'], dict(help="""(string) 关键字 """, dest='keyword', required=False)), + (['--sort'], dict(help="""(int) 排序规则:0-创建时间顺序排序,1-创建时间倒序排序 """, dest='sort', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改角色内置policy ''', + help=''' 查询用户组列表 ''', description=''' - 修改角色内置policy。 + 查询用户组列表。 - 示例: jdc iam update-assume-role-policy --role-name xxx --update-assume-role-policy-info '{"":""}' + 示例: jdc iam describe-groups ''', ) - def update_assume_role_policy(self): + def describe_groups(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.UpdateAssumeRolePolicyRequest import UpdateAssumeRolePolicyRequest + from jdcloud_sdk.services.iam.apis.DescribeGroupsRequest import DescribeGroupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateAssumeRolePolicyRequest(params_dict, headers) + req = DescribeGroupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1065,33 +1097,30 @@ def update_assume_role_policy(self): @expose( arguments=[ - (['--page-number'], dict(help="""(int) 页码,默认1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认50,取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--role-name'], dict(help="""(string) 角色名称关键词 """, dest='roleName', required=False)), - (['--type'], dict(help="""(int) 角色类型,默认查找所有类型,2-服务相关角色,3-服务角色,4-用户角色 """, dest='type', type=int, required=False)), - (['--sort'], dict(help="""(int) 排序策略,0-按创建时间顺序排序,1-按创建时间倒序排序 """, dest='sort', type=int, required=False)), + (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询角色列表 ''', + help=''' 列举用户组的策略 ''', description=''' - 查询角色列表。 + 列举用户组的策略。 - 示例: jdc iam describe-roles + 示例: jdc iam describe-attached-group-policies --group-name xxx ''', ) - def describe_roles(self): + def describe_attached_group_policies(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribeRolesRequest import DescribeRolesRequest + from jdcloud_sdk.services.iam.apis.DescribeAttachedGroupPoliciesRequest import DescribeAttachedGroupPoliciesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeRolesRequest(params_dict, headers) + req = DescribeAttachedGroupPoliciesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1101,30 +1130,31 @@ def describe_roles(self): @expose( arguments=[ - (['--role-name'], dict(help="""(string) 角色名称 """, dest='roleName', required=True)), + (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 为角色绑定策略 ''', + help=''' 为用户组解绑策略 ''', description=''' - 为角色绑定策略。 + 为用户组解绑策略。 - 示例: jdc iam attach-role-policy --role-name xxx --policy-name xxx + 示例: jdc iam detach-group-policy --group-name xxx --policy-name xxx ''', ) - def attach_role_policy(self): + def detach_group_policy(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.AttachRolePolicyRequest import AttachRolePolicyRequest + from jdcloud_sdk.services.iam.apis.DetachGroupPolicyRequest import DetachGroupPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AttachRolePolicyRequest(params_dict, headers) + req = DetachGroupPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1134,30 +1164,31 @@ def attach_role_policy(self): @expose( arguments=[ - (['--role-name'], dict(help="""(string) 角色名称 """, dest='roleName', required=True)), + (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 为角色绑定策略 ''', + help=''' 为用户组绑定策略 ''', description=''' - 为角色绑定策略。 + 为用户组绑定策略。 - 示例: jdc iam detach-role-policy --role-name xxx --policy-name xxx + 示例: jdc iam attach-group-policy --group-name xxx --policy-name xxx ''', ) - def detach_role_policy(self): + def attach_group_policy(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DetachRolePolicyRequest import DetachRolePolicyRequest + from jdcloud_sdk.services.iam.apis.AttachGroupPolicyRequest import AttachGroupPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DetachRolePolicyRequest(params_dict, headers) + req = AttachGroupPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1167,33 +1198,31 @@ def detach_role_policy(self): @expose( arguments=[ - (['--role-name'], dict(help="""(string) 角色名称 """, dest='roleName', required=True)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示数目[10~100] 默认50条 """, dest='pageSize', type=int, required=False)), - (['--keyword'], dict(help="""(string) 关键字 """, dest='keyword', required=False)), - (['--sort'], dict(help="""(int) 排序策略,0-按创建时间顺序排序 1-按创建时间倒序 """, dest='sort', type=int, required=True)), + (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), + (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询角色授权策略列表 ''', + help=''' 将子用户从组中删除 ''', description=''' - 查询角色授权策略列表。 + 将子用户从组中删除。 - 示例: jdc iam describe-role-policies --role-name xxx --sort 0 + 示例: jdc iam remove-sub-user-from-group --group-name xxx --sub-user xxx ''', ) - def describe_role_policies(self): + def remove_sub_user_from_group(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribeRolePoliciesRequest import DescribeRolePoliciesRequest + from jdcloud_sdk.services.iam.apis.RemoveSubUserFromGroupRequest import RemoveSubUserFromGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeRolePoliciesRequest(params_dict, headers) + req = RemoveSubUserFromGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1203,29 +1232,31 @@ def describe_role_policies(self): @expose( arguments=[ - (['--create-sub-user-info'], dict(help="""(createSubUserInfo) 子用户信息 """, dest='createSubUserInfo', required=True)), + (['--group-name'], dict(help="""(string) 用户组名称 """, dest='groupName', required=True)), + (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建子用户 ''', + help=''' 添加子用户到用户组中 ''', description=''' - 创建子用户。 + 添加子用户到用户组中。 - 示例: jdc iam create-sub-user --create-sub-user-info '{"":""}' + 示例: jdc iam add-sub-user-to-group --group-name xxx --sub-user xxx ''', ) - def create_sub_user(self): + def add_sub_user_to_group(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.CreateSubUserRequest import CreateSubUserRequest + from jdcloud_sdk.services.iam.apis.AddSubUserToGroupRequest import AddSubUserToGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateSubUserRequest(params_dict, headers) + req = AddSubUserToGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1235,29 +1266,30 @@ def create_sub_user(self): @expose( arguments=[ - (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), + (['--create-role-info'], dict(help="""(createRoleInfo) 角色信息 """, dest='createRoleInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询子用户信息 ''', + help=''' 创建角色 ''', description=''' - 查询子用户信息。 + 创建角色。 - 示例: jdc iam describe-sub-user --sub-user xxx + 示例: jdc iam create-role --create-role-info '{"":""}' ''', ) - def describe_sub_user(self): + def create_role(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribeSubUserRequest import DescribeSubUserRequest + from jdcloud_sdk.services.iam.apis.CreateRoleRequest import CreateRoleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSubUserRequest(params_dict, headers) + req = CreateRoleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1267,30 +1299,30 @@ def describe_sub_user(self): @expose( arguments=[ - (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), - (['--update-sub-user-info'], dict(help="""(updateSubUserInfo) 子用户信息 """, dest='updateSubUserInfo', required=True)), + (['--role-name'], dict(help="""(string) 角色名称 """, dest='roleName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改子用户信息 ''', + help=''' 查询角色详情 ''', description=''' - 修改子用户信息。 + 查询角色详情。 - 示例: jdc iam update-sub-user --sub-user xxx --update-sub-user-info '{"":""}' + 示例: jdc iam describe-role --role-name xxx ''', ) - def update_sub_user(self): + def describe_role(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.UpdateSubUserRequest import UpdateSubUserRequest + from jdcloud_sdk.services.iam.apis.DescribeRoleRequest import DescribeRoleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateSubUserRequest(params_dict, headers) + req = DescribeRoleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1300,29 +1332,30 @@ def update_sub_user(self): @expose( arguments=[ - (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), + (['--role-name'], dict(help="""(string) 角色名称 """, dest='roleName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除子用户信息 ''', + help=''' 删除角色 ''', description=''' - 删除子用户信息。 + 删除角色。 - 示例: jdc iam delete-sub-user --sub-user xxx + 示例: jdc iam delete-role --role-name xxx ''', ) - def delete_sub_user(self): + def delete_role(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DeleteSubUserRequest import DeleteSubUserRequest + from jdcloud_sdk.services.iam.apis.DeleteRoleRequest import DeleteRoleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteSubUserRequest(params_dict, headers) + req = DeleteRoleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1332,32 +1365,31 @@ def delete_sub_user(self): @expose( arguments=[ - (['--page-number'], dict(help="""(int) 页码,默认1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认50,取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--keyword'], dict(help="""(string) 关键字 """, dest='keyword', required=False)), - (['--sort'], dict(help="""(int) 排序规则:0-创建时间顺序排序,1-创建时间倒序排序 """, dest='sort', type=int, required=False)), + (['--role-name'], dict(help="""(string) 角色名称 """, dest='roleName', required=True)), + (['--update-assume-role-policy-info'], dict(help="""(updateAssumeRolePolicyInfo) 角色权限信息 """, dest='updateAssumeRolePolicyInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询子用户列表 ''', + help=''' 修改角色内置policy ''', description=''' - 查询子用户列表。 + 修改角色内置policy。 - 示例: jdc iam describe-sub-users + 示例: jdc iam update-assume-role-policy --role-name xxx --update-assume-role-policy-info '{"":""}' ''', ) - def describe_sub_users(self): + def update_assume_role_policy(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribeSubUsersRequest import DescribeSubUsersRequest + from jdcloud_sdk.services.iam.apis.UpdateAssumeRolePolicyRequest import UpdateAssumeRolePolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSubUsersRequest(params_dict, headers) + req = UpdateAssumeRolePolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1367,29 +1399,34 @@ def describe_sub_users(self): @expose( arguments=[ - (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), + (['--page-number'], dict(help="""(int) 页码,默认1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认50,取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--role-name'], dict(help="""(string) 角色名称关键词 """, dest='roleName', required=False)), + (['--type'], dict(help="""(int) 角色类型,默认查找所有类型,2-服务相关角色,3-服务角色,4-用户角色 """, dest='type', type=int, required=False)), + (['--sort'], dict(help="""(int) 排序策略,0-按创建时间顺序排序,1-按创建时间倒序排序 """, dest='sort', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询子用户所属的所有组 ''', + help=''' 查询角色列表 ''', description=''' - 查询子用户所属的所有组。 + 查询角色列表。 - 示例: jdc iam describe-sub-user-groups --sub-user xxx + 示例: jdc iam describe-roles ''', ) - def describe_sub_user_groups(self): + def describe_roles(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribeSubUserGroupsRequest import DescribeSubUserGroupsRequest + from jdcloud_sdk.services.iam.apis.DescribeRolesRequest import DescribeRolesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSubUserGroupsRequest(params_dict, headers) + req = DescribeRolesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1399,29 +1436,31 @@ def describe_sub_user_groups(self): @expose( arguments=[ - (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), + (['--role-name'], dict(help="""(string) 角色名称 """, dest='roleName', required=True)), + (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询子用户绑定的策略列表 ''', + help=''' 为角色绑定策略 ''', description=''' - 查询子用户绑定的策略列表。 + 为角色绑定策略。 - 示例: jdc iam describe-attached-sub-user-policies --sub-user xxx + 示例: jdc iam attach-role-policy --role-name xxx --policy-name xxx ''', ) - def describe_attached_sub_user_policies(self): + def attach_role_policy(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DescribeAttachedSubUserPoliciesRequest import DescribeAttachedSubUserPoliciesRequest + from jdcloud_sdk.services.iam.apis.AttachRolePolicyRequest import AttachRolePolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAttachedSubUserPoliciesRequest(params_dict, headers) + req = AttachRolePolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1431,30 +1470,31 @@ def describe_attached_sub_user_policies(self): @expose( arguments=[ - (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), + (['--role-name'], dict(help="""(string) 角色名称 """, dest='roleName', required=True)), (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 为子用户解绑策略 ''', + help=''' 为角色绑定策略 ''', description=''' - 为子用户解绑策略。 + 为角色绑定策略。 - 示例: jdc iam detach-sub-user-policy --sub-user xxx --policy-name xxx + 示例: jdc iam detach-role-policy --role-name xxx --policy-name xxx ''', ) - def detach_sub_user_policy(self): + def detach_role_policy(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.DetachSubUserPolicyRequest import DetachSubUserPolicyRequest + from jdcloud_sdk.services.iam.apis.DetachRolePolicyRequest import DetachRolePolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DetachSubUserPolicyRequest(params_dict, headers) + req = DetachRolePolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1464,30 +1504,34 @@ def detach_sub_user_policy(self): @expose( arguments=[ - (['--sub-user'], dict(help="""(string) 子用户名 """, dest='subUser', required=True)), - (['--policy-name'], dict(help="""(string) 策略名称 """, dest='policyName', required=True)), + (['--role-name'], dict(help="""(string) 角色名称 """, dest='roleName', required=True)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示数目[10~100] 默认50条 """, dest='pageSize', type=int, required=False)), + (['--keyword'], dict(help="""(string) 关键字 """, dest='keyword', required=False)), + (['--sort'], dict(help="""(int) 排序策略,0-按创建时间顺序排序 1-按创建时间倒序 """, dest='sort', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 为子用户绑定策略 ''', + help=''' 查询角色授权策略列表 ''', description=''' - 为子用户绑定策略。 + 查询角色授权策略列表。 - 示例: jdc iam attach-sub-user-policy --sub-user xxx --policy-name xxx + 示例: jdc iam describe-role-policies --role-name xxx --sort 5 ''', ) - def attach_sub_user_policy(self): + def describe_role_policies(self): client_factory = ClientFactory('iam') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iam.apis.AttachSubUserPolicyRequest import AttachSubUserPolicyRequest + from jdcloud_sdk.services.iam.apis.DescribeRolePoliciesRequest import DescribeRolePoliciesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AttachSubUserPolicyRequest(params_dict, headers) + req = DescribeRolePoliciesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1499,6 +1543,7 @@ def attach_sub_user_policy(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1531,6 +1576,7 @@ def describe_user_access_keys(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1564,6 +1610,7 @@ def create_user_access_key(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--access-key'], dict(help="""(string) accessKey """, dest='accessKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1597,6 +1644,7 @@ def enabled_user_access_key(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--access-key'], dict(help="""(string) accessKey """, dest='accessKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1630,6 +1678,7 @@ def disabled_user_access_key(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--access-key'], dict(help="""(string) accessKey """, dest='accessKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1660,7 +1709,7 @@ def delete_user_access_key(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['enable-sub-user-access-key','disable-sub-user-access-key','delete-sub-user-access-key','create-group','describe-group','update-group','delete-group','describe-group-sub-users','describe-groups','describe-attached-group-policies','detach-group-policy','attach-group-policy','remove-sub-user-from-group','add-sub-user-to-group','create-permission','describe-permission-detail','update-permission','describe-permissions','describe-sub-user-permissions','add-permissions-to-sub-user','remove-permission-of-sub-user','create-policy','describe-policy','update-policy','delete-policy','update-policy-description','describe-policies','create-role','describe-role','delete-role','update-assume-role-policy','describe-roles','attach-role-policy','detach-role-policy','describe-role-policies','create-sub-user','describe-sub-user','update-sub-user','delete-sub-user','describe-sub-users','describe-sub-user-groups','describe-attached-sub-user-policies','detach-sub-user-policy','attach-sub-user-policy','describe-user-access-keys','create-user-access-key','enabled-user-access-key','disabled-user-access-key','delete-user-access-key',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['create-sub-user','describe-sub-user','update-sub-user','delete-sub-user','describe-sub-users','describe-sub-user-groups','describe-attached-sub-user-policies','detach-sub-user-policy','attach-sub-user-policy','create-permission','describe-permission-detail','update-permission','describe-permissions','describe-sub-user-permissions','add-permissions-to-sub-user','remove-permission-of-sub-user','enable-sub-user-access-key','disable-sub-user-access-key','delete-sub-user-access-key','create-policy','describe-policy','update-policy','delete-policy','update-policy-description','describe-policies','create-group','describe-group','update-group','delete-group','describe-group-sub-users','describe-groups','describe-attached-group-policies','detach-group-policy','attach-group-policy','remove-sub-user-from-group','add-sub-user-to-group','create-role','describe-role','delete-role','update-assume-role-policy','describe-roles','attach-role-policy','detach-role-policy','describe-role-policies','describe-user-access-keys','create-user-access-key','enabled-user-access-key','disabled-user-access-key','delete-user-access-key',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/ias.py b/jdcloud_cli/controllers/services/ias.py index a4960e1..2dba890 100644 --- a/jdcloud_cli/controllers/services/ias.py +++ b/jdcloud_cli/controllers/services/ias.py @@ -42,7 +42,7 @@ class Meta: (['--pin'], dict(help="""(string) pin """, dest='pin', required=True)), (['--app-name'], dict(help="""(string) appName """, dest='appName', required=True)), (['--client-id'], dict(help="""(string) clientId """, dest='clientId', required=True)), - (['--multi-tenant'], dict(help="""(bool) multiTenant """, dest='multiTenant', required=True)), + (['--multi-tenant'], dict(help="""(bool) multiTenant """, dest='multiTenant', type=bool, required=True)), (['--state'], dict(help="""(string) state """, dest='state', required=True)), (['--scope'], dict(help="""(string) scope """, dest='scope', required=True)), (['--start-time'], dict(help="""(int) startTime """, dest='startTime', type=int, required=True)), @@ -52,6 +52,7 @@ class Meta: (['--page-size'], dict(help="""(int) pageSize """, dest='pageSize', type=int, required=True)), (['--offset'], dict(help="""(int) offset """, dest='offset', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -59,7 +60,7 @@ class Meta: description=''' 运营后台查询app。 - 示例: jdc ias apps --pin xxx --app-name xxx --client-id xxx --multi-tenant true --state xxx --scope xxx --start-time 0 --end-time 0 --account-type xxx --page-index 0 --page-size 0 --offset 0 + 示例: jdc ias apps --pin xxx --app-name xxx --client-id xxx --multi-tenant true --state xxx --scope xxx --start-time 5 --end-time 5 --account-type xxx --page-index 5 --page-size 5 --offset 5 ''', ) def apps(self): @@ -85,6 +86,7 @@ def apps(self): (['--region-id'], dict(help="""(string) NA """, dest='regionId', required=False)), (['--client-id'], dict(help="""(string) NA """, dest='clientId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -117,6 +119,7 @@ def app_detail(self): arguments=[ (['--region-id'], dict(help="""(string) NA """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -163,10 +166,11 @@ def state(self): (['--extension'], dict(help="""(string) 应用扩展信息 """, dest='extension', required=False)), (['--access-token-validity-seconds'], dict(help="""(int) 访问令牌有效期,值的范围为 600 秒到 6x3600=21,600 秒,即10分钟-6小时 """, dest='accessTokenValiditySeconds', type=int, required=False)), (['--refresh-token-validity-seconds'], dict(help="""(int) 刷新令牌有效期,值的范围为 30x24x3600=2,592,000 秒到 365x24x3600=31,536,000 秒,即30天-365天

注:当 GrantTypes 包含 refresh_token 时,refreshTokenValiditySeconds 为必传参数 """, dest='refreshTokenValiditySeconds', type=int, required=False)), - (['--multi-tenant'], dict(help="""(bool) 是否为多租户应用
"false":该应用仅支持当前创建应用的租户访问,其他京东云租户无法访问
"true":该应用支持其他京东云租户访问,但当前创建应用的租户不能访问 """, dest='multiTenant', required=False)), + (['--multi-tenant'], dict(help="""(bool) 是否为多租户应用
"false":该应用仅支持当前创建应用的租户访问,其他京东云租户无法访问
"true":该应用支持其他京东云租户访问,但当前创建应用的租户不能访问 """, dest='multiTenant', type=bool, required=False)), (['--secret'], dict(help="""(string) 应用的密码,支持8-255位长度的ASCII可打印字符,建议使用足够复杂的密码策略

注:当TokenEndpointAuthMethod不等于none时,secret为必传参数;反之,当指定了secret时,TokenEndpointAuthMethod不能等于none
京东云将不可逆加密secret,因此您无法再次从京东云查看该密码,但您可以随时通过更新应用重新设置secret """, dest='secret', required=False)), (['--user-type'], dict(help="""(string) 能访问应用的账号类型,支持以下值:
(1)root:支持主账号访问,子用户无法访问
(2)sub:子用户账号,使用主账号不能访问

注:multiTenant和userType的组合指定了应用的用户人群,典型的应用场景如:
(1)应用向当前租户下的子用户开放(2)应用向京东云其他租户主账号开放 """, dest='userType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -200,6 +204,7 @@ def create_app(self): (['--region-id'], dict(help="""(string) 地域编码,参考OpenAPI公共说明 """, dest='regionId', required=False)), (['--client-id'], dict(help="""(string) 应用ID,应用创建时由京东云分配的16位数字ID """, dest='clientId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -247,10 +252,11 @@ def get_app(self): (['--extension'], dict(help="""(string) 应用扩展信息 """, dest='extension', required=False)), (['--access-token-validity-seconds'], dict(help="""(int) 访问令牌有效期,值的范围为 600 秒到 6x3600=21,600 秒,即10分钟-6小时 """, dest='accessTokenValiditySeconds', type=int, required=False)), (['--refresh-token-validity-seconds'], dict(help="""(int) 刷新令牌有效期,值的范围为 30x24x3600=2,592,000 秒到 365x24x3600=31,536,000 秒,即30天-365天

注:当 GrantTypes 包含 refresh_token 时,refreshTokenValiditySeconds 为必传参数 """, dest='refreshTokenValiditySeconds', type=int, required=False)), - (['--multi-tenant'], dict(help="""(bool) 是否为多租户应用
"false":该应用仅支持当前创建应用的租户访问,其他京东云租户无法访问
"true":该应用支持其他京东云租户访问,但当前创建应用的租户不能访问 """, dest='multiTenant', required=False)), + (['--multi-tenant'], dict(help="""(bool) 是否为多租户应用
"false":该应用仅支持当前创建应用的租户访问,其他京东云租户无法访问
"true":该应用支持其他京东云租户访问,但当前创建应用的租户不能访问 """, dest='multiTenant', type=bool, required=False)), (['--secret'], dict(help="""(string) 应用的密码,支持8-255位长度的ASCII可打印字符,建议使用足够复杂的密码策略

注:当TokenEndpointAuthMethod不等于none时,secret为必传参数;反之,当指定了secret时,TokenEndpointAuthMethod不能等于none
京东云将不可逆加密secret,因此您无法再次从京东云查看该密码,但您可以随时通过更新应用重新设置secret """, dest='secret', required=False)), (['--user-type'], dict(help="""(string) 能访问应用的账号类型,支持以下值:
(1)root:支持主账号访问,子用户无法访问
(2)sub:子用户账号,使用主账号不能访问

注:multiTenant和userType的组合指定了应用的用户人群,典型的应用场景如:
(1)应用向当前租户下的子用户开放(2)应用向京东云其他租户主账号开放 """, dest='userType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -284,6 +290,7 @@ def update_app(self): (['--region-id'], dict(help="""(string) 地域编码,参考OpenAPI公共说明 """, dest='regionId', required=False)), (['--client-id'], dict(help="""(string) 应用ID,应用创建时由京东云分配的16位数字ID """, dest='clientId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -316,6 +323,7 @@ def delete_app(self): arguments=[ (['--region-id'], dict(help="""(string) 地域编码,参考OpenAPI公共说明 """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, diff --git a/jdcloud_cli/controllers/services/industrydata.py b/jdcloud_cli/controllers/services/industrydata.py index 8cc64ec..cc37565 100644 --- a/jdcloud_cli/controllers/services/industrydata.py +++ b/jdcloud_cli/controllers/services/industrydata.py @@ -46,6 +46,7 @@ class Meta: (['--first-index'], dict(help="""(string) 数据对应的第一级分析指标(可选一级指标以最终授权为准) """, dest='firstIndex', required=True)), (['--second-index'], dict(help="""(string) 数据对应的第二级分析指标,如不填写,则默认把一级指标下的所有二级指标都查询出来(可选二级指标以最终授权为准) """, dest='secondIndex', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, diff --git a/jdcloud_cli/controllers/services/iotcore.py b/jdcloud_cli/controllers/services/iotcore.py index 54b7789..8addd65 100644 --- a/jdcloud_cli/controllers/services/iotcore.py +++ b/jdcloud_cli/controllers/services/iotcore.py @@ -38,31 +38,416 @@ class Meta: @expose( arguments=[ - (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), - (['--device-id'], dict(help="""(string) 设备ID """, dest='deviceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) IoT Hub实例ID信息 """, dest='instanceId', required=True)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为10,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) abilityName-功能名称,精确匹配; abilityType-功能类型,精确匹配; """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查看产品功能列表接口 ''', + description=''' + 查看产品功能列表接口。 + + 示例: jdc iotcore list-product-abilities --instance-id xxx --product-key xxx + ''', + ) + def list_product_abilities(self): + client_factory = ClientFactory('iotcore') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotcore.apis.ListProductAbilitiesRequest import ListProductAbilitiesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ListProductAbilitiesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) IoT Hub实例ID信息 """, dest='instanceId', required=True)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--thing-model'], dict(help="""(object) 物模型JSON """, dest='thingModel', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 导入物模型 ''', + description=''' + 导入物模型。 + + 示例: jdc iotcore import-thing-model --instance-id xxx --product-key xxx --thing-model '{"":""}' + ''', + ) + def import_thing_model(self): + client_factory = ClientFactory('iotcore') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotcore.apis.ImportThingModelRequest import ImportThingModelRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ImportThingModelRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) IoT Hub实例ID信息 """, dest='instanceId', required=True)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 导出物模型 ''', + description=''' + 导出物模型。 + + 示例: jdc iotcore export-thing-model --instance-id xxx --product-key xxx + ''', + ) + def export_thing_model(self): + client_factory = ClientFactory('iotcore') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotcore.apis.ExportThingModelRequest import ExportThingModelRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ExportThingModelRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--identifier'], dict(help="""(string) 设备唯一标识 """, dest='identifier', required=True)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--topic-short-name'], dict(help="""(string) Topic如/user/{productKey}/{identifier}/topicShortName; 不支持系统Topic; """, dest='topicShortName', required=True)), + (['--topic-message'], dict(help="""(string) 要发送的消息主体 """, dest='topicMessage', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设备Topic调用 ''', + description=''' + 设备Topic调用。 + + 示例: jdc iotcore invoke-thing-topic --instance-id xxx --identifier xxx --product-key xxx --topic-short-name xxx --topic-message xxx + ''', + ) + def invoke_thing_topic(self): + client_factory = ClientFactory('iotcore') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotcore.apis.InvokeThingTopicRequest import InvokeThingTopicRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = InvokeThingTopicRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--identifier'], dict(help="""(string) 设备唯一标识 """, dest='identifier', required=True)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查看设备影子 ''', + description=''' + 查看设备影子。 + + 示例: jdc iotcore describe-thing-shadow --instance-id xxx --identifier xxx --product-key xxx + ''', + ) + def describe_thing_shadow(self): + client_factory = ClientFactory('iotcore') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotcore.apis.DescribeThingShadowRequest import DescribeThingShadowRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeThingShadowRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--identifier'], dict(help="""(string) 设备唯一标识 """, dest='identifier', required=True)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--state'], dict(help="""(object) 运行状态 """, dest='state', required=False)), + (['--version'], dict(help="""(int) 设备影子版本,当前版本加1,当前版本默认其实版本为-1; 用户主动更新版本号时,设备影子会检查请求中的主动更新版本号是否大于当前版本号。; 如果大于当前版本号,则更新设备影子,并将影子版本值更新到请求的版本中,反之则会拒绝更新设备影子。; 影子版本参数为Integer型; 取值范围:0到2147483647(2的31次方-1); 当取值达到最大值2147483647(2的31次方-1)时,请求中的主动更新版本号应为-1; """, dest='version', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 更新设备影子的期望值 ''', + description=''' + 更新设备影子的期望值。 + + 示例: jdc iotcore update-thing-shadow --instance-id xxx --identifier xxx --product-key xxx + ''', + ) + def update_thing_shadow(self): + client_factory = ClientFactory('iotcore') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotcore.apis.UpdateThingShadowRequest import UpdateThingShadowRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateThingShadowRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--identifier'], dict(help="""(string) 设备唯一标识 """, dest='identifier', required=True)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--name'], dict(help="""(string) 服务名称 """, dest='name', required=True)), + (['--input'], dict(help="""(object) 输入参数,object的key为参数名称,value为参数值 """, dest='input', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设备服务调用 ''', + description=''' + 设备服务调用。 + + 示例: jdc iotcore invoke-thing-service --instance-id xxx --identifier xxx --product-key xxx --name xxx + ''', + ) + def invoke_thing_service(self): + client_factory = ClientFactory('iotcore') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotcore.apis.InvokeThingServiceRequest import InvokeThingServiceRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = InvokeThingServiceRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--parent-id'], dict(help="""(string) 父级设备Id,只允许网关设备作为父级设备 """, dest='parentId', required=True)), + (['--product-key'], dict(help="""(string) 将此产品下所有设备都设置为parentId的子设备,只允许普通设备类型的productKey """, dest='productKey', required=False)), + (['--children'], dict(help="""(array: string) 子设备Id集合,children和productKey二者至少填一个,二者都填写则同时生效,只允许普通设备类型的deviceId """, dest='children', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 建立设备间的父子关系 ''', + description=''' + 建立设备间的父子关系。 + + 示例: jdc iotcore add-device-links --instance-id xxx --parent-id xxx + ''', + ) + def add_device_links(self): + client_factory = ClientFactory('iotcore') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotcore.apis.AddDeviceLinksRequest import AddDeviceLinksRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = AddDeviceLinksRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--device-name'], dict(help="""(string) 设备名称,模糊匹配 """, dest='deviceName', required=False)), + (['--status'], dict(help="""(int) 设备状态 0-未激活,1-激活离线,2-激活在线 """, dest='status', type=int, required=False)), + (['--product-key'], dict(help="""(string) 设备所归属的产品Key """, dest='productKey', required=False)), + (['--device-type'], dict(help="""(int) 设备类型,同产品类型,0-设备,1-网关 """, dest='deviceType', type=int, required=False)), + (['--now-page'], dict(help="""(int) 当前页数 """, dest='nowPage', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页的数据条数 """, dest='pageSize', type=int, required=False)), + (['--order'], dict(help="""(string) 排序关键字--name,type,productKey,status--最多支持一个字段 """, dest='order', required=False)), + (['--direction'], dict(help="""(string) 顺序,升序降序--asc,desc """, dest='direction', required=False)), + (['--parent-id'], dict(help="""(string) 父设备Id """, dest='parentId', required=False)), + (['--order-id'], dict(help="""(int) 订单号 """, dest='orderId', type=int, required=False)), + (['--device-collector-type'], dict(help="""(string) 设备采集器类型 """, dest='deviceCollectorType', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 分页查询设备信息,支持一个或多个条件 ''', + description=''' + 分页查询设备信息,支持一个或多个条件。 + + 示例: jdc iotcore query-device-page --instance-id xxx + ''', + ) + def query_device_page(self): + client_factory = ClientFactory('iotcore') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotcore.apis.QueryDevicePageRequest import QueryDevicePageRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = QueryDevicePageRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--device-id'], dict(help="""(string) 设备Id """, dest='deviceId', required=True)), + (['--model'], dict(help="""(string) 设备型号 """, dest='model', required=False)), + (['--manufacturer'], dict(help="""(string) 设备厂商 """, dest='manufacturer', required=False)), + (['--description'], dict(help="""(string) 设备描述 """, dest='description', required=False)), + (['--status'], dict(help="""(int) 设备状态 """, dest='status', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改设备详情 ''', + description=''' + 修改设备详情。 + + 示例: jdc iotcore update-device --instance-id xxx --device-id xxx + ''', + ) + def update_device(self): + client_factory = ClientFactory('iotcore') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotcore.apis.UpdateDeviceRequest import UpdateDeviceRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateDeviceRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--device-name'], dict(help="""(string) 设备名称 """, dest='deviceName', required=False)), + (['--product-key'], dict(help="""(string) 设备所归属的产品 """, dest='productKey', required=False)), + (['--model'], dict(help="""(string) 设备型号 """, dest='model', required=False)), + (['--manufacturer'], dict(help="""(string) 厂商 """, dest='manufacturer', required=False)), + (['--description'], dict(help="""(string) 设备描述 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个设备详细信息 ''', + help=''' 注册单个设备并返回秘钥信息 ''', description=''' - 查询单个设备详细信息。 + 注册单个设备并返回秘钥信息。 - 示例: jdc iotcore device-query --instance-id xxx --device-id xxx + 示例: jdc iotcore add-device --instance-id xxx ''', ) - def device_query(self): + def add_device(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.DeviceQueryRequest import DeviceQueryRequest + from jdcloud_sdk.services.iotcore.apis.AddDeviceRequest import AddDeviceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeviceQueryRequest(params_dict, headers) + req = AddDeviceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -72,35 +457,33 @@ def device_query(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), - (['--device-meta-id'], dict(help="""(string) 设备型号标识 """, dest='deviceMetaId', required=False)), - (['--device-meta-name'], dict(help="""(string) 设备型号名称 """, dest='deviceMetaName', required=False)), - (['--node-type'], dict(help="""(int) 节点类型 """, dest='nodeType', type=int, required=False)), - (['--page-no'], dict(help="""(int) 页码 """, dest='pageNo', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示条数 """, dest='pageSize', type=int, required=False)), + (['--device-name'], dict(help="""(string) 设备名称 """, dest='deviceName', required=True)), + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询物类型列表 ''', + help=''' 查询设备详情 ''', description=''' - 查询物类型列表。 + 查询设备详情。 - 示例: jdc iotcore thing-type-list --instance-id xxx + 示例: jdc iotcore query-device-detail --device-name xxx --instance-id xxx --product-key xxx ''', ) - def thing_type_list(self): + def query_device_detail(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.ThingTypeListRequest import ThingTypeListRequest + from jdcloud_sdk.services.iotcore.apis.QueryDeviceDetailRequest import QueryDeviceDetailRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ThingTypeListRequest(params_dict, headers) + req = QueryDeviceDetailRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -110,31 +493,33 @@ def thing_type_list(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), - (['--device-meta-id'], dict(help="""(string) 设备型号标识 """, dest='deviceMetaId', required=False)), + (['--device-name'], dict(help="""(string) 设备名称 """, dest='deviceName', required=True)), + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询物类型详情 ''', + help=''' 删除设备 ''', description=''' - 查询物类型详情。 + 删除设备。 - 示例: jdc iotcore thing-type-describe --instance-id xxx + 示例: jdc iotcore remove-device --device-name xxx --instance-id xxx --product-key xxx ''', ) - def thing_type_describe(self): + def remove_device(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.ThingTypeDescribeRequest import ThingTypeDescribeRequest + from jdcloud_sdk.services.iotcore.apis.RemoveDeviceRequest import RemoveDeviceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ThingTypeDescribeRequest(params_dict, headers) + req = RemoveDeviceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -144,32 +529,34 @@ def thing_type_describe(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), - (['--thing-model-id'], dict(help="""(string) 物模型ID编号 """, dest='thingModelId', required=True)), - (['--thing-model-version'], dict(help="""(string) 版本号。如果为空,则返回最新版本 """, dest='thingModelVersion', required=False)), + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) IoT Engine实例ID信息 """, dest='instanceId', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为10,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) productName-产品名称,模糊匹配,支持单个; productKey-产品key,精确匹配,支持单个; productType-产品类型,精确匹配,支持单个; templateName-模板名称,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据模型ID查看物模型完整信息 ''', + help=''' 查看产品列表接口 ''', description=''' - 根据模型ID查看物模型完整信息。 + 查看产品列表接口。 - 示例: jdc iotcore describe-thing-model --instance-id xxx --thing-model-id xxx + 示例: jdc iotcore list-products --instance-id xxx ''', ) - def describe_thing_model(self): + def list_products(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.DescribeThingModelRequest import DescribeThingModelRequest + from jdcloud_sdk.services.iotcore.apis.ListProductsRequest import ListProductsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeThingModelRequest(params_dict, headers) + req = ListProductsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -179,31 +566,34 @@ def describe_thing_model(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), - (['--device-info-vo'], dict(help="""(deviceInfoVO) 物模型ID编号 """, dest='deviceInfoVO', required=True)), + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) IoT Engine实例ID信息 """, dest='instanceId', required=True)), + (['--product-name'], dict(help="""(string) 产品名称,名称不可为空,3-30个字符,只支持汉字、英文字母、数字、下划线“_”及中划线“-”,必须以汉字、英文字母及数字开头结尾 """, dest='productName', required=True)), + (['--product-type'], dict(help="""(int) 节点类型,取值:; 0:设备。设备不能挂载子设备。可以直连物联网平台,也可以作为网关的子设备连接物联网平台; 1:网关。网关可以挂载子设备,具有子设备管理模块,维持子设备的拓扑关系,和将拓扑关系同步到物联网平台; """, dest='productType', type=int, required=True)), + (['--product-description'], dict(help="""(string) 产品描述,80字符以内 """, dest='productDescription', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设备注册接口 ''', + help=''' 新建产品 ''', description=''' - 设备注册接口。 + 新建产品。 - 示例: jdc iotcore device-register --instance-id xxx --device-info-vo '{"":""}' + 示例: jdc iotcore create-product --instance-id xxx --product-name xxx --product-type 5 ''', ) - def device_register(self): + def create_product(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.DeviceRegisterRequest import DeviceRegisterRequest + from jdcloud_sdk.services.iotcore.apis.CreateProductRequest import CreateProductRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeviceRegisterRequest(params_dict, headers) + req = CreateProductRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -213,31 +603,32 @@ def device_register(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), - (['--device-id'], dict(help="""(string) 设备ID """, dest='deviceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) IoT Engine实例ID信息 """, dest='instanceId', required=True)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 下载设备证书接口 ''', + help=''' 查看产品 ''', description=''' - 下载设备证书接口。 + 查看产品。 - 示例: jdc iotcore download-certificate --instance-id xxx --device-id xxx + 示例: jdc iotcore describe-product --instance-id xxx --product-key xxx ''', ) - def download_certificate(self): + def describe_product(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.DownloadCertificateRequest import DownloadCertificateRequest + from jdcloud_sdk.services.iotcore.apis.DescribeProductRequest import DescribeProductRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DownloadCertificateRequest(params_dict, headers) + req = DescribeProductRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -247,31 +638,35 @@ def download_certificate(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), - (['--device-id'], dict(help="""(string) 设备ID """, dest='deviceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) IoT Engine实例ID信息 """, dest='instanceId', required=True)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--product-name'], dict(help="""(string) 产品名称,名称不可为空,3-30个字符,只支持汉字、英文字母、数字、下划线“_”及中划线“-”,必须以汉字、英文字母及数字开头结尾 """, dest='productName', required=False)), + (['--product-description'], dict(help="""(string) 产品描述,80字符以内 """, dest='productDescription', required=False)), + (['--dynamic-register'], dict(help="""(int) 动态注册,0:关闭,1:开启 """, dest='dynamicRegister', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设备删除接口 ''', + help=''' 修改产品 ''', description=''' - 设备删除接口。 + 修改产品。 - 示例: jdc iotcore delete-device --instance-id xxx --device-id xxx + 示例: jdc iotcore update-product --instance-id xxx --product-key xxx ''', ) - def delete_device(self): + def update_product(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.DeleteDeviceRequest import DeleteDeviceRequest + from jdcloud_sdk.services.iotcore.apis.UpdateProductRequest import UpdateProductRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteDeviceRequest(params_dict, headers) + req = UpdateProductRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -281,31 +676,32 @@ def delete_device(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), - (['--device-property-vo'], dict(help="""(devicePropertyVO) 设备ID """, dest='devicePropertyVO', required=True)), + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) IoT Engine实例ID信息 """, dest='instanceId', required=True)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设备控制接口 ''', + help=''' 删除产品 ''', description=''' - 设备控制接口。 + 删除产品。 - 示例: jdc iotcore device-property-set --instance-id xxx --device-property-vo '{"":""}' + 示例: jdc iotcore delete-product --instance-id xxx --product-key xxx ''', ) - def device_property_set(self): + def delete_product(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.DevicePropertySetRequest import DevicePropertySetRequest + from jdcloud_sdk.services.iotcore.apis.DeleteProductRequest import DeleteProductRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DevicePropertySetRequest(params_dict, headers) + req = DeleteProductRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -315,31 +711,38 @@ def device_property_set(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), - (['--device-function-vo'], dict(help="""(deviceFunctionVO) 设备ID """, dest='deviceFunctionVO', required=True)), + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--device-id'], dict(help="""(string) 设备Id """, dest='deviceId', required=True)), + (['--model'], dict(help="""(string) 设备型号 """, dest='model', required=False)), + (['--manufacturer'], dict(help="""(string) 设备厂商 """, dest='manufacturer', required=False)), + (['--description'], dict(help="""(string) 设备名 """, dest='description', required=False)), + (['--status'], dict(help="""(int) 设备状态 """, dest='status', type=int, required=False)), + (['--identifier'], dict(help="""(string) 连接码 """, dest='identifier', required=False)), + (['--device-name'], dict(help="""(string) 心跳 """, dest='deviceName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设备方法执行 ''', + help=''' 修改设备详情 ''', description=''' - 设备方法执行。 + 修改设备详情。 - 示例: jdc iotcore invoke-function --instance-id xxx --device-function-vo '{"":""}' + 示例: jdc iotcore update-loo-device --instance-id xxx --device-id xxx ''', ) - def invoke_function(self): + def update_loo_device(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.InvokeFunctionRequest import InvokeFunctionRequest + from jdcloud_sdk.services.iotcore.apis.UpdateLooDeviceRequest import UpdateLooDeviceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = InvokeFunctionRequest(params_dict, headers) + req = UpdateLooDeviceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -349,31 +752,87 @@ def invoke_function(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), - (['--event-report-page-bo'], dict(help="""(eventReportPageBo) 事件查询请求 """, dest='eventReportPageBo', required=True)), + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--pre-order-id'], dict(help="""(string) 申请单编号 """, dest='preOrderId', required=True)), + (['--user-pin-param'], dict(help="""(string) 用户Pin """, dest='userPinParam', required=True)), + (['--device-name'], dict(help="""(string) 心跳 """, dest='deviceName', required=False)), + (['--product-key'], dict(help="""(string) 设备所归属的产品 """, dest='productKey', required=False)), + (['--model'], dict(help="""(string) 设备型号 """, dest='model', required=False)), + (['--manufacturer'], dict(help="""(string) 厂商 """, dest='manufacturer', required=False)), + (['--identifier'], dict(help="""(string) 连接码 """, dest='identifier', required=False)), + (['--description'], dict(help="""(string) 设备名 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设备事件查询 ''', + help=''' 注册单个朗讯设备并返回秘钥信息 ''', description=''' - 设备事件查询。 + 注册单个朗讯设备并返回秘钥信息。 + + 示例: jdc iotcore add-loo-device --instance-id xxx --pre-order-id xxx --user-pin-param xxx + ''', + ) + def add_loo_device(self): + client_factory = ClientFactory('iotcore') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotcore.apis.AddLooDeviceRequest import AddLooDeviceRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = AddLooDeviceRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--device-name'], dict(help="""(string) 设备名称,模糊匹配 """, dest='deviceName', required=False)), + (['--manufacturer'], dict(help="""(string) 设备厂商,模糊匹配 """, dest='manufacturer', required=False)), + (['--model'], dict(help="""(string) 设备型号,模糊匹配 """, dest='model', required=False)), + (['--status'], dict(help="""(int) 设备状态 0-未激活,1-激活离线,2-激活在线 """, dest='status', type=int, required=False)), + (['--product-key'], dict(help="""(string) 设备所归属的产品Key """, dest='productKey', required=False)), + (['--device-type'], dict(help="""(int) 设备类型,同产品类型,0-设备,1-网关 """, dest='deviceType', type=int, required=False)), + (['--now-page'], dict(help="""(int) 当前页数 """, dest='nowPage', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页的数据条数 """, dest='pageSize', type=int, required=False)), + (['--order'], dict(help="""(string) 排序关键字--name,type,productKey,status--最多支持一个字段 """, dest='order', required=False)), + (['--direction'], dict(help="""(string) 顺序,升序降序--asc,desc """, dest='direction', required=False)), + (['--parent-id'], dict(help="""(string) 父设备Id """, dest='parentId', required=False)), + (['--order-id'], dict(help="""(int) 订单号 """, dest='orderId', type=int, required=False)), + (['--device-collector-type'], dict(help="""(string) 设备采集器类型 """, dest='deviceCollectorType', required=False)), + (['--query-user-pin'], dict(help="""(string) 查询的userPin """, dest='queryUserPin', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 朗瑞分页查询设备信息,支持一个或多个条件 ''', + description=''' + 朗瑞分页查询设备信息,支持一个或多个条件。 - 示例: jdc iotcore event-list --instance-id xxx --event-report-page-bo '{"":""}' + 示例: jdc iotcore loongray-query-page --instance-id xxx ''', ) - def event_list(self): + def loongray_query_page(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.EventListRequest import EventListRequest + from jdcloud_sdk.services.iotcore.apis.LoongrayQueryPageRequest import LoongrayQueryPageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EventListRequest(params_dict, headers) + req = LoongrayQueryPageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -383,31 +842,35 @@ def event_list(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), - (['--function-call-page-bo'], dict(help="""(functionCallPageBo) 方法查询请求 """, dest='functionCallPageBo', required=True)), + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--product-key'], dict(help="""(string) 过滤条件,产品Key """, dest='productKey', required=False)), + (['--parent-id'], dict(help="""(string) 针对parentId下的子设备进行统计 """, dest='parentId', required=False)), + (['--device-collector-type'], dict(help="""(string) 采集器类型 """, dest='deviceCollectorType', required=False)), + (['--query-user-pin'], dict(help="""(string) 查询的用户信息 """, dest='queryUserPin', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询方法调用列表信息 ''', + help=''' 设备基本数据统计,包括设备数,激活数,在线数 ''', description=''' - 查询方法调用列表信息。 + 设备基本数据统计,包括设备数,激活数,在线数。 - 示例: jdc iotcore function-list --instance-id xxx --function-call-page-bo '{"":""}' + 示例: jdc iotcore query-admin-statistics --instance-id xxx ''', ) - def function_list(self): + def query_admin_statistics(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.FunctionListRequest import FunctionListRequest + from jdcloud_sdk.services.iotcore.apis.QueryAdminStatisticsRequest import QueryAdminStatisticsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = FunctionListRequest(params_dict, headers) + req = QueryAdminStatisticsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -417,34 +880,33 @@ def function_list(self): @expose( arguments=[ + (['--device-name'], dict(help="""(string) 设备名称 """, dest='deviceName', required=True)), (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--identifier'], dict(help="""(string) 设备唯一标识 """, dest='identifier', required=True)), (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), - (['--topic-short-name'], dict(help="""(string) Topic如/user/{productKey}/{identifier}/topicShortName; 不支持系统Topic; """, dest='topicShortName', required=True)), - (['--topic-message'], dict(help="""(string) 要发送的消息主体 """, dest='topicMessage', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设备Topic调用 ''', + help=''' 删除设备 ''', description=''' - 设备Topic调用。 + 删除设备。 - 示例: jdc iotcore invoke-thing-topic --instance-id xxx --identifier xxx --product-key xxx --topic-short-name xxx --topic-message xxx + 示例: jdc iotcore remove-loongray-device --device-name xxx --instance-id xxx --product-key xxx ''', ) - def invoke_thing_topic(self): + def remove_loongray_device(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.InvokeThingTopicRequest import InvokeThingTopicRequest + from jdcloud_sdk.services.iotcore.apis.RemoveLoongrayDeviceRequest import RemoveLoongrayDeviceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = InvokeThingTopicRequest(params_dict, headers) + req = RemoveLoongrayDeviceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -454,32 +916,32 @@ def invoke_thing_topic(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--identifier'], dict(help="""(string) 设备唯一标识 """, dest='identifier', required=True)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-info-vo'], dict(help="""(deviceInfoVO) 物模型ID编号 """, dest='deviceInfoVO', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看设备影子 ''', + help=''' 设备注册接口 ''', description=''' - 查看设备影子。 + 设备注册接口。 - 示例: jdc iotcore describe-thing-shadow --instance-id xxx --identifier xxx --product-key xxx + 示例: jdc iotcore register-device --instance-id xxx --device-info-vo '{"":""}' ''', ) - def describe_thing_shadow(self): + def register_device(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.DescribeThingShadowRequest import DescribeThingShadowRequest + from jdcloud_sdk.services.iotcore.apis.RegisterDeviceRequest import RegisterDeviceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeThingShadowRequest(params_dict, headers) + req = RegisterDeviceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -489,34 +951,32 @@ def describe_thing_shadow(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--identifier'], dict(help="""(string) 设备唯一标识 """, dest='identifier', required=True)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), - (['--state'], dict(help="""(object) 运行状态 """, dest='state', required=False)), - (['--version'], dict(help="""(int) 设备影子版本,当前版本加1,当前版本默认其实版本为-1; 用户主动更新版本号时,设备影子会检查请求中的主动更新版本号是否大于当前版本号。; 如果大于当前版本号,则更新设备影子,并将影子版本值更新到请求的版本中,反之则会拒绝更新设备影子。; 影子版本参数为Integer型; 取值范围:0到2147483647(2的31次方-1); 当取值达到最大值2147483647(2的31次方-1)时,请求中的主动更新版本号应为-1; """, dest='version', type=int, required=False)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-id'], dict(help="""(string) 设备ID """, dest='deviceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新设备影子的期望值 ''', + help=''' 下载设备证书接口 ''', description=''' - 更新设备影子的期望值。 + 下载设备证书接口。 - 示例: jdc iotcore update-thing-shadow --instance-id xxx --identifier xxx --product-key xxx + 示例: jdc iotcore download-device-certificate --instance-id xxx --device-id xxx ''', ) - def update_thing_shadow(self): + def download_device_certificate(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.UpdateThingShadowRequest import UpdateThingShadowRequest + from jdcloud_sdk.services.iotcore.apis.DownloadDeviceCertificateRequest import DownloadDeviceCertificateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateThingShadowRequest(params_dict, headers) + req = DownloadDeviceCertificateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -526,35 +986,32 @@ def update_thing_shadow(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--identifier'], dict(help="""(string) 设备唯一标识 """, dest='identifier', required=True)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), - (['--name'], dict(help="""(string) 服务名称 """, dest='name', required=True)), - (['--input'], dict(help="""(object) 输入参数,object的key为参数名称,value为参数值 """, dest='input', required=False)), - (['--callback-bean-name'], dict(help="""(string) 回调spring的bean的名称 """, dest='callbackBeanName', required=False)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-id'], dict(help="""(string) 设备ID """, dest='deviceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设备服务调用 ''', + help=''' 设备删除接口 ''', description=''' - 设备服务调用。 + 设备删除接口。 - 示例: jdc iotcore invoke-thing-service --instance-id xxx --identifier xxx --product-key xxx --name xxx + 示例: jdc iotcore delete-device --instance-id xxx --device-id xxx ''', ) - def invoke_thing_service(self): + def delete_device(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.InvokeThingServiceRequest import InvokeThingServiceRequest + from jdcloud_sdk.services.iotcore.apis.DeleteDeviceRequest import DeleteDeviceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = InvokeThingServiceRequest(params_dict, headers) + req = DeleteDeviceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -564,33 +1021,32 @@ def invoke_thing_service(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--parent-id'], dict(help="""(string) 父级设备Id,只允许网关设备作为父级设备 """, dest='parentId', required=True)), - (['--product-key'], dict(help="""(string) 将此产品下所有设备都设置为parentId的子设备,只允许普通设备类型的productKey """, dest='productKey', required=False)), - (['--children'], dict(help="""(array: string) 子设备Id集合,children和productKey二者至少填一个,二者都填写则同时生效,只允许普通设备类型的deviceId """, dest='children', required=False)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-id'], dict(help="""(string) 设备ID """, dest='deviceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 建立设备间的父子关系 ''', + help=''' 查询单个设备详细信息 ''', description=''' - 建立设备间的父子关系。 + 查询单个设备详细信息。 - 示例: jdc iotcore add-device-links --instance-id xxx --parent-id xxx + 示例: jdc iotcore describe-device --instance-id xxx --device-id xxx ''', ) - def add_device_links(self): + def describe_device(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.AddDeviceLinksRequest import AddDeviceLinksRequest + from jdcloud_sdk.services.iotcore.apis.DescribeDeviceRequest import DescribeDeviceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddDeviceLinksRequest(params_dict, headers) + req = DescribeDeviceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -600,41 +1056,36 @@ def add_device_links(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--device-name'], dict(help="""(string) 设备名称,模糊匹配 """, dest='deviceName', required=False)), - (['--status'], dict(help="""(int) 设备状态 0-未激活,1-激活离线,2-激活在线 """, dest='status', type=int, required=False)), - (['--product-key'], dict(help="""(string) 设备所归属的产品Key """, dest='productKey', required=False)), - (['--device-type'], dict(help="""(int) 设备类型,同产品类型,0-设备,1-网关 """, dest='deviceType', type=int, required=False)), - (['--now-page'], dict(help="""(int) 当前页数 """, dest='nowPage', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页的数据条数 """, dest='pageSize', type=int, required=False)), - (['--order'], dict(help="""(string) 排序关键字--name,type,productKey,status--最多支持一个字段 """, dest='order', required=False)), - (['--direction'], dict(help="""(string) 顺序,升序降序--asc,desc """, dest='direction', required=False)), - (['--parent-id'], dict(help="""(string) 父设备Id """, dest='parentId', required=False)), - (['--order-id'], dict(help="""(int) 订单号 """, dest='orderId', type=int, required=False)), - (['--device-collector-type'], dict(help="""(string) 设备采集器类型 """, dest='deviceCollectorType', required=False)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-meta-id'], dict(help="""(string) 设备型号标识 """, dest='deviceMetaId', required=False)), + (['--device-meta-name'], dict(help="""(string) 设备型号名称 """, dest='deviceMetaName', required=False)), + (['--node-type'], dict(help="""(int) 节点类型 """, dest='nodeType', type=int, required=False)), + (['--page-no'], dict(help="""(int) 页码 """, dest='pageNo', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示条数 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 分页查询设备信息,支持一个或多个条件 ''', + help=''' 查询物类型列表 ''', description=''' - 分页查询设备信息,支持一个或多个条件。 + 查询物类型列表。 - 示例: jdc iotcore query-device-page --instance-id xxx + 示例: jdc iotcore describe-thing-type-list --instance-id xxx ''', ) - def query_device_page(self): + def describe_thing_type_list(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.QueryDevicePageRequest import QueryDevicePageRequest + from jdcloud_sdk.services.iotcore.apis.DescribeThingTypeListRequest import DescribeThingTypeListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDevicePageRequest(params_dict, headers) + req = DescribeThingTypeListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -644,35 +1095,32 @@ def query_device_page(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--device-id'], dict(help="""(string) 设备Id """, dest='deviceId', required=True)), - (['--model'], dict(help="""(string) 设备型号 """, dest='model', required=False)), - (['--manufacturer'], dict(help="""(string) 设备厂商 """, dest='manufacturer', required=False)), - (['--description'], dict(help="""(string) 设备描述 """, dest='description', required=False)), - (['--status'], dict(help="""(int) 设备状态 """, dest='status', type=int, required=False)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-meta-id'], dict(help="""(string) 设备型号标识 """, dest='deviceMetaId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改设备详情 ''', + help=''' 查询物类型详情 ''', description=''' - 修改设备详情。 + 查询物类型详情。 - 示例: jdc iotcore update-device --instance-id xxx --device-id xxx + 示例: jdc iotcore describe-thing-type --instance-id xxx ''', ) - def update_device(self): + def describe_thing_type(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.UpdateDeviceRequest import UpdateDeviceRequest + from jdcloud_sdk.services.iotcore.apis.DescribeThingTypeRequest import DescribeThingTypeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateDeviceRequest(params_dict, headers) + req = DescribeThingTypeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -682,35 +1130,33 @@ def update_device(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--device-name'], dict(help="""(string) 设备名称 """, dest='deviceName', required=False)), - (['--product-key'], dict(help="""(string) 设备所归属的产品 """, dest='productKey', required=False)), - (['--model'], dict(help="""(string) 设备型号 """, dest='model', required=False)), - (['--manufacturer'], dict(help="""(string) 厂商 """, dest='manufacturer', required=False)), - (['--description'], dict(help="""(string) 设备描述 """, dest='description', required=False)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--thing-type-code'], dict(help="""(string) 物类型Code """, dest='thingTypeCode', required=True)), + (['--thing-model-version'], dict(help="""(string) 版本号。如果为空,则返回最新版本 """, dest='thingModelVersion', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 注册单个设备并返回秘钥信息 ''', + help=''' 根据物类型Code查看物模型完整信息 ''', description=''' - 注册单个设备并返回秘钥信息。 + 根据物类型Code查看物模型完整信息。 - 示例: jdc iotcore add-device --instance-id xxx + 示例: jdc iotcore describe-thing-model --instance-id xxx --thing-type-code xxx ''', ) - def add_device(self): + def describe_thing_model(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.AddDeviceRequest import AddDeviceRequest + from jdcloud_sdk.services.iotcore.apis.DescribeThingModelRequest import DescribeThingModelRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddDeviceRequest(params_dict, headers) + req = DescribeThingModelRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -720,32 +1166,32 @@ def add_device(self): @expose( arguments=[ - (['--device-name'], dict(help="""(string) 设备名称 """, dest='deviceName', required=True)), - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-property-vo'], dict(help="""(devicePropertyVO) 设备ID """, dest='devicePropertyVO', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询设备详情 ''', + help=''' 设备控制接口 ''', description=''' - 查询设备详情。 + 设备控制接口。 - 示例: jdc iotcore query-device-detail --device-name xxx --instance-id xxx --product-key xxx + 示例: jdc iotcore set-device-property --instance-id xxx --device-property-vo '{"":""}' ''', ) - def query_device_detail(self): + def set_device_property(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.QueryDeviceDetailRequest import QueryDeviceDetailRequest + from jdcloud_sdk.services.iotcore.apis.SetDevicePropertyRequest import SetDevicePropertyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryDeviceDetailRequest(params_dict, headers) + req = SetDevicePropertyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -755,32 +1201,32 @@ def query_device_detail(self): @expose( arguments=[ - (['--device-name'], dict(help="""(string) 设备名称 """, dest='deviceName', required=True)), - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-function-vo'], dict(help="""(deviceFunctionVO) 设备方法 """, dest='deviceFunctionVO', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除设备 ''', + help=''' 设备方法执行 ''', description=''' - 删除设备。 + 设备方法执行。 - 示例: jdc iotcore remove-device --device-name xxx --instance-id xxx --product-key xxx + 示例: jdc iotcore invoke-function --instance-id xxx --device-function-vo '{"":""}' ''', ) - def remove_device(self): + def invoke_function(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.RemoveDeviceRequest import RemoveDeviceRequest + from jdcloud_sdk.services.iotcore.apis.InvokeFunctionRequest import InvokeFunctionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RemoveDeviceRequest(params_dict, headers) + req = InvokeFunctionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -790,31 +1236,32 @@ def remove_device(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) Hub实例Id """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 区域Id """, dest='regionId', required=False)), - (['--identifier'], dict(help="""(string) 电梯连接码 """, dest='identifier', required=False)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--event-report-page-bo'], dict(help="""(eventReportPageBo) 事件查询请求 """, dest='eventReportPageBo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取电梯运行状态 ''', + help=''' 设备事件查询 ''', description=''' - 获取电梯运行状态。 + 设备事件查询。 - 示例: jdc iotcore elevator-operating-status --instance-id xxx + 示例: jdc iotcore describe-event-list --instance-id xxx --event-report-page-bo '{"":""}' ''', ) - def elevator_operating_status(self): + def describe_event_list(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.ElevatorOperatingStatusRequest import ElevatorOperatingStatusRequest + from jdcloud_sdk.services.iotcore.apis.DescribeEventListRequest import DescribeEventListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ElevatorOperatingStatusRequest(params_dict, headers) + req = DescribeEventListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -824,32 +1271,32 @@ def elevator_operating_status(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) Hub实例Id """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 区域Id """, dest='regionId', required=False)), - (['--identifier'], dict(help="""(string) 当前的链接码 """, dest='identifier', required=True)), - (['--protocol'], dict(help="""(string) 当前的协议类型:; 语音播报控制器-输入端子,0X00000~X0007:inputTerminal; 语音播报控制器-播放信息,0X00024~X0027:playInfo; LR001-516-5B边缘数据采集器-传感器管理:sensor; LR001-516-5B边缘数据采集器-采集器属性:collectorProperty; LR001-516-5B边缘数据采集器-电梯属性:elevatorProperty; """, dest='protocol', required=True)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--function-call-page-bo'], dict(help="""(functionCallPageBo) 方法查询请求对象 """, dest='functionCallPageBo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取协议信息 ''', + help=''' 查询方法调用列表信息 ''', description=''' - 获取协议信息。 + 查询方法调用列表信息。 - 示例: jdc iotcore collector-read-message --instance-id xxx --identifier xxx --protocol xxx + 示例: jdc iotcore describe-function-list --instance-id xxx --function-call-page-bo '{"":""}' ''', ) - def collector_read_message(self): + def describe_function_list(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.CollectorReadMessageRequest import CollectorReadMessageRequest + from jdcloud_sdk.services.iotcore.apis.DescribeFunctionListRequest import DescribeFunctionListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CollectorReadMessageRequest(params_dict, headers) + req = DescribeFunctionListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -859,33 +1306,32 @@ def collector_read_message(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) Hub实例Id """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 区域Id """, dest='regionId', required=False)), - (['--identifier'], dict(help="""(string) 连接码 """, dest='identifier', required=True)), - (['--address-of-first-register'], dict(help="""(int) 起始地址,如40301 """, dest='addressOfFirstRegister', type=int, required=True)), - (['--number-of-registers'], dict(help="""(int) 寄存器数量 """, dest='numberOfRegisters', type=int, required=True)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-id'], dict(help="""(string) 设备ID """, dest='deviceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' (0x03)读保持寄存器 ''', + help=''' 查询属性接口 ''', description=''' - (0x03)读保持寄存器。 + 查询属性接口。 - 示例: jdc iotcore read-holding-registers --instance-id xxx --identifier xxx --address-of-first-register 0 --number-of-registers 0 + 示例: jdc iotcore describe-property --instance-id xxx --device-id xxx ''', ) - def read_holding_registers(self): + def describe_property(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.ReadHoldingRegistersRequest import ReadHoldingRegistersRequest + from jdcloud_sdk.services.iotcore.apis.DescribePropertyRequest import DescribePropertyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ReadHoldingRegistersRequest(params_dict, headers) + req = DescribePropertyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -895,33 +1341,32 @@ def read_holding_registers(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) Hub实例Id """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 区域Id """, dest='regionId', required=False)), - (['--identifier'], dict(help="""(string) 当前的链接码 """, dest='identifier', required=True)), - (['--protocol'], dict(help="""(string) 当前的协议类型,非必填项; """, dest='protocol', required=False)), - (['--data'], dict(help="""(object) 当前待写入的数据; 如指定播放设备,寄存地址:13对应16进制0x0D,寄存器值:2; {; "13":2; }; 如播放控制,寄存地址:14对应16进制0x0E,寄存器值:1; {; "14": 1; }; 如音量设置,寄存地址:15对应16进制0x0F,寄存器值:10,取值范围0~30; {; "15": 10; }; 如指定文件夹和文件播放,寄存地址:16对应16进制0x10,寄存器值:1; 寄存器值为两字节,第一个字节为文件夹,第二个字节为文件名; 如0x01文件夹,0x03文件名,0x0103换算为10进制为259; {; "16": 259; }; 如组合播放,寄存器地址:17、18和19,寄存器值:257、258和259,寄存器值的算法和指定文件夹和文件播放是一致的,如259可换算为0x01文件夹,0x03文件名; {; "17": 257,; "18": 258,; "19": 259; }; 如播放广告,寄存地址:32对应16进制0x20,寄存器值:259,寄存器值的算法和指定文件夹和文件播放是一致的,如259可换算为0x01文件夹,0x03文件名; {; "32": 259; }; 如指定文件夹循环播放,寄存地址:33对应16进制0x21,寄存器值:256,寄存器值的算法,如256可换算为0x0100文件夹; {; "33": 256; }; 如指定文件夹随机播放,寄存地址:34对应16进制0x22,寄存器值:256,寄存器值的算法,如256可换算为0x0100文件夹; {; "34": 256; }; 如指定曲目播放,寄存地址:35对应16进制0x23,寄存器值:13,歌曲选择范围为0~3000; {; "35": 13; }; """, dest='data', required=True)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-snapshot-request-vo'], dict(help="""(deviceSnapshotRequestVO) 方法查询请求 """, dest='deviceSnapshotRequestVO', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 写入采集器数据 ''', + help=''' 属性获取接口 ''', description=''' - 写入采集器数据。 + 属性获取接口。 - 示例: jdc iotcore collector-write-message --instance-id xxx --identifier xxx --data '{"":""}' + 示例: jdc iotcore describe-property-snapshot --instance-id xxx --device-snapshot-request-vo '{"":""}' ''', ) - def collector_write_message(self): + def describe_property_snapshot(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.CollectorWriteMessageRequest import CollectorWriteMessageRequest + from jdcloud_sdk.services.iotcore.apis.DescribePropertySnapshotRequest import DescribePropertySnapshotRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CollectorWriteMessageRequest(params_dict, headers) + req = DescribePropertySnapshotRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -931,80 +1376,67 @@ def collector_write_message(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--device-id'], dict(help="""(string) 设备Id """, dest='deviceId', required=True)), - (['--model'], dict(help="""(string) 设备型号 """, dest='model', required=False)), - (['--manufacturer'], dict(help="""(string) 设备厂商 """, dest='manufacturer', required=False)), - (['--description'], dict(help="""(string) 设备名 """, dest='description', required=False)), - (['--status'], dict(help="""(int) 设备状态 """, dest='status', type=int, required=False)), - (['--identifier'], dict(help="""(string) 连接码 """, dest='identifier', required=False)), - (['--device-name'], dict(help="""(string) 心跳 """, dest='deviceName', required=False)), - (['--device-type'], dict(help="""(string) 设备类型 """, dest='deviceType', required=True)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-topo-info-vo'], dict(help="""(deviceTopoInfoVO) 方法查询请求 """, dest='deviceTopoInfoVO', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改设备详情 ''', + help=''' 边缘代理设备与非直连设备拓扑关系创建接口 ''', description=''' - 修改设备详情。 + 边缘代理设备与非直连设备拓扑关系创建接口。 - 示例: jdc iotcore update-loo-device --instance-id xxx --device-id xxx --device-type xxx + 示例: jdc iotcore create-device-topo --instance-id xxx --device-topo-info-vo '{"":""}' ''', ) - def update_loo_device(self): + def create_device_topo(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.UpdateLooDeviceRequest import UpdateLooDeviceRequest + from jdcloud_sdk.services.iotcore.apis.CreateDeviceTopoRequest import CreateDeviceTopoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateLooDeviceRequest(params_dict, headers) + req = CreateDeviceTopoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--pre-order-id'], dict(help="""(string) 申请单编号 """, dest='preOrderId', required=True)), - (['--user-pin-param'], dict(help="""(string) 用户Pin """, dest='userPinParam', required=True)), - (['--device-name'], dict(help="""(string) 心跳 """, dest='deviceName', required=False)), - (['--product-key'], dict(help="""(string) 设备所归属的产品 """, dest='productKey', required=False)), - (['--model'], dict(help="""(string) 设备型号 """, dest='model', required=False)), - (['--manufacturer'], dict(help="""(string) 厂商 """, dest='manufacturer', required=False)), - (['--identifier'], dict(help="""(string) 连接码 """, dest='identifier', required=False)), - (['--description'], dict(help="""(string) 设备名 """, dest='description', required=False)), - (['--device-type'], dict(help="""(string) 设备类型 """, dest='deviceType', required=True)), + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-topo-page-bo'], dict(help="""(deviceTopoPageBO) 方法查询请求 """, dest='deviceTopoPageBO', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 注册单个朗讯设备并返回秘钥信息 ''', + help=''' 边缘代理设备与非直连设备拓扑关系查询接口 ''', description=''' - 注册单个朗讯设备并返回秘钥信息。 + 边缘代理设备与非直连设备拓扑关系查询接口。 - 示例: jdc iotcore add-loo-device --instance-id xxx --pre-order-id xxx --user-pin-param xxx --device-type xxx + 示例: jdc iotcore describe-device-topo --instance-id xxx --device-topo-page-bo '{"":""}' ''', ) - def add_loo_device(self): + def describe_device_topo(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.AddLooDeviceRequest import AddLooDeviceRequest + from jdcloud_sdk.services.iotcore.apis.DescribeDeviceTopoRequest import DescribeDeviceTopoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLooDeviceRequest(params_dict, headers) + req = DescribeDeviceTopoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1014,41 +1446,32 @@ def add_loo_device(self): @expose( arguments=[ - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--device-name'], dict(help="""(string) 设备名称,模糊匹配 """, dest='deviceName', required=False)), - (['--status'], dict(help="""(int) 设备状态 0-未激活,1-激活离线,2-激活在线 """, dest='status', type=int, required=False)), - (['--product-key'], dict(help="""(string) 设备所归属的产品Key """, dest='productKey', required=False)), - (['--device-type'], dict(help="""(int) 设备类型,同产品类型,0-设备,1-网关 """, dest='deviceType', type=int, required=False)), - (['--now-page'], dict(help="""(int) 当前页数 """, dest='nowPage', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页的数据条数 """, dest='pageSize', type=int, required=False)), - (['--order'], dict(help="""(string) 排序关键字--name,type,productKey,status--最多支持一个字段 """, dest='order', required=False)), - (['--direction'], dict(help="""(string) 顺序,升序降序--asc,desc """, dest='direction', required=False)), - (['--parent-id'], dict(help="""(string) 父设备Id """, dest='parentId', required=False)), - (['--order-id'], dict(help="""(int) 订单号 """, dest='orderId', type=int, required=False)), - (['--device-collector-type'], dict(help="""(string) 设备采集器类型 """, dest='deviceCollectorType', required=False)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-topo-info-vo'], dict(help="""(deviceTopoInfoVO) 方法查询请求 """, dest='deviceTopoInfoVO', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 朗瑞分页查询设备信息,支持一个或多个条件 ''', + help=''' 边缘代理设备与非直连设备拓扑关系更新接口 ''', description=''' - 朗瑞分页查询设备信息,支持一个或多个条件。 + 边缘代理设备与非直连设备拓扑关系更新接口。 - 示例: jdc iotcore loongray-query-page --instance-id xxx + 示例: jdc iotcore update-device-topo --instance-id xxx --device-topo-info-vo '{"":""}' ''', ) - def loongray_query_page(self): + def update_device_topo(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.LoongrayQueryPageRequest import LoongrayQueryPageRequest + from jdcloud_sdk.services.iotcore.apis.UpdateDeviceTopoRequest import UpdateDeviceTopoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = LoongrayQueryPageRequest(params_dict, headers) + req = UpdateDeviceTopoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1058,32 +1481,32 @@ def loongray_query_page(self): @expose( arguments=[ - (['--device-name'], dict(help="""(string) 设备名称 """, dest='deviceName', required=True)), - (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), - (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--region-id'], dict(help="""(string) 区域id """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例Id """, dest='instanceId', required=True)), + (['--device-topo-info-vo'], dict(help="""(deviceTopoInfoVO) 方法查询请求 """, dest='deviceTopoInfoVO', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除设备 ''', + help=''' 边缘代理设备与非直连设备拓扑关系删除接口 ''', description=''' - 删除设备。 + 边缘代理设备与非直连设备拓扑关系删除接口。 - 示例: jdc iotcore remove-loongray-device --device-name xxx --instance-id xxx --product-key xxx + 示例: jdc iotcore delete-device-topo --instance-id xxx --device-topo-info-vo '{"":""}' ''', ) - def remove_loongray_device(self): + def delete_device_topo(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.RemoveLoongrayDeviceRequest import RemoveLoongrayDeviceRequest + from jdcloud_sdk.services.iotcore.apis.DeleteDeviceTopoRequest import DeleteDeviceTopoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RemoveLoongrayDeviceRequest(params_dict, headers) + req = DeleteDeviceTopoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1097,6 +1520,7 @@ def remove_loongray_device(self): (['--instance-id'], dict(help="""(string) IoT Engine实例ID信息 """, dest='instanceId', required=True)), (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1134,6 +1558,7 @@ def describe_product_with_admin(self): (['--product-description'], dict(help="""(string) 产品描述,80字符以内 """, dest='productDescription', required=False)), (['--dynamic-register'], dict(help="""(int) 动态注册,0:关闭,1:开启 """, dest='dynamicRegister', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1168,6 +1593,7 @@ def update_product_with_admin(self): (['--instance-id'], dict(help="""(string) IoT Engine实例ID信息 """, dest='instanceId', required=True)), (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1204,6 +1630,7 @@ def delete_product_with_admin(self): (['--page-size'], dict(help="""(int) 分页大小,默认为10,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), (['--filters'], dict(help="""(array: filter) productName-产品名称,模糊匹配,支持单个; productKey-产品key,精确匹配,支持单个; productType-产品类型,精确匹配,支持单个; templateName-模板名称,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1239,9 +1666,9 @@ def list_products_with_admin(self): (['--product-name'], dict(help="""(string) 产品名称,名称不可为空,3-30个字符,只支持汉字、英文字母、数字、下划线“_”及中划线“-”,必须以汉字、英文字母及数字开头结尾 """, dest='productName', required=True)), (['--product-type'], dict(help="""(int) 节点类型,取值:; 0:设备。设备不能挂载子设备。可以直连物联网平台,也可以作为网关的子设备连接物联网平台; 1:网关。网关可以挂载子设备,具有子设备管理模块,维持子设备的拓扑关系,和将拓扑关系同步到物联网平台; """, dest='productType', type=int, required=True)), (['--product-description'], dict(help="""(string) 产品描述,80字符以内 """, dest='productDescription', required=False)), - (['--template-id'], dict(help="""(string) 物模型模板ID,内部参数,用户不可见,默认为自定义 """, dest='templateId', required=False)), - (['--internal-tags'], dict(help="""(object) 内部标签,内部参数,用户不可见,隐藏标签:hidden:true """, dest='internalTags', required=False)), + (['--coll-device-type'], dict(help="""(string) 产品名下所有设备的采集器类型 """, dest='collDeviceType', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1249,7 +1676,7 @@ def list_products_with_admin(self): description=''' 新建产品。 - 示例: jdc iotcore create-admin-product --instance-id xxx --product-name xxx --product-type 0 + 示例: jdc iotcore create-admin-product --instance-id xxx --product-name xxx --product-type 5 --coll-device-type xxx ''', ) def create_admin_product(self): @@ -1273,70 +1700,34 @@ def create_admin_product(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) IoT Engine实例ID信息 """, dest='instanceId', required=True)), + (['--instance-id'], dict(help="""(string) IoTCore实例ID信息 """, dest='instanceId', required=True)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为10,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) productName-产品名称,模糊匹配,支持单个; productKey-产品key,精确匹配,支持单个; productType-产品类型,精确匹配,支持单个; templateName-模板名称,精确匹配,支持多个; """, dest='filters', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查看产品列表接口 ''', - description=''' - 查看产品列表接口。 - - 示例: jdc iotcore list-products --instance-id xxx - ''', - ) - def list_products(self): - client_factory = ClientFactory('iotcore') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.iotcore.apis.ListProductsRequest import ListProductsRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = ListProductsRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) IoT Engine实例ID信息 """, dest='instanceId', required=True)), - (['--product-name'], dict(help="""(string) 产品名称,名称不可为空,3-30个字符,只支持汉字、英文字母、数字、下划线“_”及中划线“-”,必须以汉字、英文字母及数字开头结尾 """, dest='productName', required=True)), - (['--product-type'], dict(help="""(int) 节点类型,取值:; 0:设备。设备不能挂载子设备。可以直连物联网平台,也可以作为网关的子设备连接物联网平台; 1:网关。网关可以挂载子设备,具有子设备管理模块,维持子设备的拓扑关系,和将拓扑关系同步到物联网平台; """, dest='productType', type=int, required=True)), - (['--product-description'], dict(help="""(string) 产品描述,80字符以内 """, dest='productDescription', required=False)), - (['--template-id'], dict(help="""(string) 物模型模板ID,内部参数,用户不可见,默认为自定义 """, dest='templateId', required=False)), - (['--internal-tags'], dict(help="""(object) 内部标签,内部参数,用户不可见,隐藏标签:hidden:true """, dest='internalTags', required=False)), + (['--filters'], dict(help="""(array: filter) topicShortName-topic名称,模糊匹配,支持单个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 新建产品 ''', + help=''' 查看产品自定义Topic列表 ''', description=''' - 新建产品。 + 查看产品自定义Topic列表。 - 示例: jdc iotcore create-product --instance-id xxx --product-name xxx --product-type 0 + 示例: jdc iotcore describe-product-topics --instance-id xxx --product-key xxx ''', ) - def create_product(self): + def describe_product_topics(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.CreateProductRequest import CreateProductRequest + from jdcloud_sdk.services.iotcore.apis.DescribeProductTopicsRequest import DescribeProductTopicsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateProductRequest(params_dict, headers) + req = DescribeProductTopicsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1347,30 +1738,34 @@ def create_product(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) IoT Engine实例ID信息 """, dest='instanceId', required=True)), + (['--instance-id'], dict(help="""(string) IoTCore实例ID信息 """, dest='instanceId', required=True)), (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--topic-short-name'], dict(help="""(string) Topic名称为必填,同一个产品下的Topic名称不能重复; 只能包含字母,数字和下划线,最多64个字符,每个层级都不能为空; 不能以/结尾; """, dest='topicShortName', required=True)), + (['--topic-operation'], dict(help="""(string) 操作权限,设备对该Topic类的操作权限,取值; pub:发布; sub:订阅; """, dest='topicOperation', required=True)), + (['--topic-description'], dict(help="""(string) 描述, 0-50个字符 """, dest='topicDescription', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看产品 ''', + help=''' 新建产品自定义Topic ''', description=''' - 查看产品。 + 新建产品自定义Topic。 - 示例: jdc iotcore describe-product --instance-id xxx --product-key xxx + 示例: jdc iotcore create-product-topic --instance-id xxx --product-key xxx --topic-short-name xxx --topic-operation xxx ''', ) - def describe_product(self): + def create_product_topic(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.DescribeProductRequest import DescribeProductRequest + from jdcloud_sdk.services.iotcore.apis.CreateProductTopicRequest import CreateProductTopicRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeProductRequest(params_dict, headers) + req = CreateProductTopicRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1381,33 +1776,32 @@ def describe_product(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) IoT Engine实例ID信息 """, dest='instanceId', required=True)), + (['--instance-id'], dict(help="""(string) IoTCore实例ID信息 """, dest='instanceId', required=True)), (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), - (['--product-name'], dict(help="""(string) 产品名称,名称不可为空,3-30个字符,只支持汉字、英文字母、数字、下划线“_”及中划线“-”,必须以汉字、英文字母及数字开头结尾 """, dest='productName', required=False)), - (['--product-description'], dict(help="""(string) 产品描述,80字符以内 """, dest='productDescription', required=False)), - (['--dynamic-register'], dict(help="""(int) 动态注册,0:关闭,1:开启 """, dest='dynamicRegister', type=int, required=False)), + (['--topic-id'], dict(help="""(string) 自定义topic唯一标识 """, dest='topicId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改产品 ''', + help=''' 查看产品自定义Topic ''', description=''' - 修改产品。 + 查看产品自定义Topic。 - 示例: jdc iotcore update-product --instance-id xxx --product-key xxx + 示例: jdc iotcore describe-product-topic --instance-id xxx --product-key xxx --topic-id xxx ''', ) - def update_product(self): + def describe_product_topic(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.UpdateProductRequest import UpdateProductRequest + from jdcloud_sdk.services.iotcore.apis.DescribeProductTopicRequest import DescribeProductTopicRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateProductRequest(params_dict, headers) + req = DescribeProductTopicRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1417,31 +1811,36 @@ def update_product(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) IoT Engine实例ID信息 """, dest='instanceId', required=True)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--group-name'], dict(help="""(string) 组名称 """, dest='groupName', required=False)), + (['--query-user-pin'], dict(help="""(string) 查询的用户组 """, dest='queryUserPin', required=False)), + (['--tag'], dict(help="""(string) 组标签 """, dest='tag', required=False)), + (['--page-number'], dict(help="""(int) 当前页号 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页大小 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除产品 ''', + help=''' 获取分组列表 ''', description=''' - 删除产品。 + 获取分组列表。 - 示例: jdc iotcore delete-product --instance-id xxx --product-key xxx + 示例: jdc iotcore get-device-group --instance-id xxx ''', ) - def delete_product(self): + def get_device_group(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.DeleteProductRequest import DeleteProductRequest + from jdcloud_sdk.services.iotcore.apis.GetDeviceGroupRequest import GetDeviceGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteProductRequest(params_dict, headers) + req = GetDeviceGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1451,34 +1850,32 @@ def delete_product(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) IoT Hub实例ID信息 """, dest='instanceId', required=True)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为10,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) abilityName-功能名称,精确匹配; abilityType-功能类型,精确匹配; """, dest='filters', required=False)), + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--query-user-pin'], dict(help="""(string) 获取用户 NULL为当前用户 """, dest='queryUserPin', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看产品功能列表接口 ''', + help=''' 获取组列表 ''', description=''' - 查看产品功能列表接口。 + 获取组列表。 - 示例: jdc iotcore list-product-abilities --instance-id xxx --product-key xxx + 示例: jdc iotcore get-device-group-list --instance-id xxx ''', ) - def list_product_abilities(self): + def get_device_group_list(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.ListProductAbilitiesRequest import ListProductAbilitiesRequest + from jdcloud_sdk.services.iotcore.apis.GetDeviceGroupListRequest import GetDeviceGroupListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListProductAbilitiesRequest(params_dict, headers) + req = GetDeviceGroupListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1488,32 +1885,46 @@ def list_product_abilities(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) IoT Hub实例ID信息 """, dest='instanceId', required=True)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), - (['--thing-model'], dict(help="""(object) 物模型JSON """, dest='thingModel', required=True)), + (['--instance-id'], dict(help="""(string) 设备归属的实例ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=False)), + (['--device-name'], dict(help="""(string) 设备名称 """, dest='deviceName', required=False)), + (['--device-collector-type'], dict(help="""(string) 采集器类型 """, dest='deviceCollectorType', required=False)), + (['--group-name'], dict(help="""(string) 组名称 """, dest='groupName', required=False)), + (['--user-pin'], dict(help="""(string) 查询的用户组 """, dest='userPin', required=False)), + (['--tag'], dict(help="""(string) 组标签 """, dest='tag', required=False)), + (['--group-id'], dict(help="""(string) 组ID """, dest='groupId', required=False)), + (['--manufacturer'], dict(help="""(string) 厂商名称 """, dest='manufacturer', required=False)), + (['--model'], dict(help="""(string) 设备型号 """, dest='model', required=False)), + (['--order-id'], dict(help="""(int) 订单号 """, dest='orderId', type=int, required=False)), + (['--status'], dict(help="""(int) 设备状态 """, dest='status', type=int, required=False)), + (['--page-number'], dict(help="""(int) 当前页码 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页大小 """, dest='pageSize', type=int, required=False)), + (['--order'], dict(help="""(string) 排序字段 """, dest='order', required=False)), + (['--direction'], dict(help="""(string) 排序方式(asc desc) """, dest='direction', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 导入物模型 ''', + help=''' 获取分组列表 ''', description=''' - 导入物模型。 + 获取分组列表。 - 示例: jdc iotcore import-thing-model --instance-id xxx --product-key xxx --thing-model '{"":""}' + 示例: jdc iotcore find-device-group-link-page --instance-id xxx ''', ) - def import_thing_model(self): + def find_device_group_link_page(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.ImportThingModelRequest import ImportThingModelRequest + from jdcloud_sdk.services.iotcore.apis.FindDeviceGroupLinkPageRequest import FindDeviceGroupLinkPageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ImportThingModelRequest(params_dict, headers) + req = FindDeviceGroupLinkPageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1523,31 +1934,32 @@ def import_thing_model(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) IoT Hub实例ID信息 """, dest='instanceId', required=True)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--instance-id'], dict(help="""(string) Hub实例Id """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 区域Id """, dest='regionId', required=False)), + (['--identifier'], dict(help="""(string) 电梯连接码 """, dest='identifier', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 导出物模型 ''', + help=''' 获取电梯运行状态 ''', description=''' - 导出物模型。 + 获取电梯运行状态。 - 示例: jdc iotcore export-thing-model --instance-id xxx --product-key xxx + 示例: jdc iotcore elevator-operating-status --instance-id xxx ''', ) - def export_thing_model(self): + def elevator_operating_status(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.ExportThingModelRequest import ExportThingModelRequest + from jdcloud_sdk.services.iotcore.apis.ElevatorOperatingStatusRequest import ElevatorOperatingStatusRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ExportThingModelRequest(params_dict, headers) + req = ElevatorOperatingStatusRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1557,34 +1969,33 @@ def export_thing_model(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) IoTCore实例ID信息 """, dest='instanceId', required=True)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为10,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) topicShortName-topic名称,模糊匹配,支持单个; """, dest='filters', required=False)), + (['--instance-id'], dict(help="""(string) Hub实例Id """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 区域Id """, dest='regionId', required=False)), + (['--identifier'], dict(help="""(string) 当前的链接码 """, dest='identifier', required=True)), + (['--protocol'], dict(help="""(string) 当前的协议类型:; 语音播报控制器-输入端子,0X00000~X0007:inputTerminal; 语音播报控制器-播放信息,0X00024~X0027:playInfo; LR001-516-5B边缘数据采集器-传感器管理:sensor; LR001-516-5B边缘数据采集器-采集器属性:collectorProperty; LR001-516-5B边缘数据采集器-电梯属性:elevatorProperty; LR001-516-5A边缘数据采集器-水质酸碱度(PH):waterQualityPh; LR001-516-5A水质监测采集器-水质电导率:waterQualityElectroConductivity; """, dest='protocol', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看产品自定义Topic列表 ''', + help=''' 获取协议信息 ''', description=''' - 查看产品自定义Topic列表。 + 获取协议信息。 - 示例: jdc iotcore describe-product-topics --instance-id xxx --product-key xxx + 示例: jdc iotcore collector-read-message --instance-id xxx --identifier xxx --protocol xxx ''', ) - def describe_product_topics(self): + def collector_read_message(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.DescribeProductTopicsRequest import DescribeProductTopicsRequest + from jdcloud_sdk.services.iotcore.apis.CollectorReadMessageRequest import CollectorReadMessageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeProductTopicsRequest(params_dict, headers) + req = CollectorReadMessageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1594,34 +2005,34 @@ def describe_product_topics(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) IoTCore实例ID信息 """, dest='instanceId', required=True)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), - (['--topic-short-name'], dict(help="""(string) Topic名称为必填,同一个产品下的Topic名称不能重复; 只能包含字母,数字和下划线,最多64个字符,每个层级都不能为空; 不能以/结尾; """, dest='topicShortName', required=True)), - (['--topic-operation'], dict(help="""(string) 操作权限,设备对该Topic类的操作权限,取值; pub:发布; sub:订阅; """, dest='topicOperation', required=True)), - (['--topic-description'], dict(help="""(string) 描述, 0-50个字符 """, dest='topicDescription', required=False)), + (['--instance-id'], dict(help="""(string) Hub实例Id """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 区域Id """, dest='regionId', required=False)), + (['--identifier'], dict(help="""(string) 连接码 """, dest='identifier', required=True)), + (['--address-of-first-register'], dict(help="""(int) 起始地址,如40301 """, dest='addressOfFirstRegister', type=int, required=True)), + (['--number-of-registers'], dict(help="""(int) 寄存器数量 """, dest='numberOfRegisters', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 新建产品自定义Topic ''', + help=''' (0x03)读保持寄存器 ''', description=''' - 新建产品自定义Topic。 + (0x03)读保持寄存器。 - 示例: jdc iotcore create-product-topic --instance-id xxx --product-key xxx --topic-short-name xxx --topic-operation xxx + 示例: jdc iotcore read-holding-registers --instance-id xxx --identifier xxx --address-of-first-register 5 --number-of-registers 5 ''', ) - def create_product_topic(self): + def read_holding_registers(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.CreateProductTopicRequest import CreateProductTopicRequest + from jdcloud_sdk.services.iotcore.apis.ReadHoldingRegistersRequest import ReadHoldingRegistersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateProductTopicRequest(params_dict, headers) + req = ReadHoldingRegistersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1631,32 +2042,34 @@ def create_product_topic(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) IoTCore实例ID信息 """, dest='instanceId', required=True)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), - (['--topic-id'], dict(help="""(string) 自定义topic唯一标识 """, dest='topicId', required=True)), + (['--instance-id'], dict(help="""(string) Hub实例Id """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 区域Id """, dest='regionId', required=False)), + (['--identifier'], dict(help="""(string) 当前的链接码 """, dest='identifier', required=True)), + (['--protocol'], dict(help="""(string) 当前的协议类型,非必填项; """, dest='protocol', required=False)), + (['--data'], dict(help="""(object) 当前待写入的数据; 如语音播报控制器-指定播放设备,寄存地址:13对应16进制0x0D,寄存器值:2; {; "13":2; }; 如语音播报控制器-播放控制,寄存地址:14对应16进制0x0E,寄存器值:1; {; "14": 1; }; 如语音播报控制器-音量设置,寄存地址:15对应16进制0x0F,寄存器值:10,取值范围0~30; {; "15": 10; }; 如语音播报控制器-指定文件夹和文件播放,寄存地址:16对应16进制0x10,寄存器值:1; 寄存器值为两字节,第一个字节为文件夹,第二个字节为文件名; 如0x01文件夹,0x03文件名,0x0103换算为10进制为259; {; "16": 259; }; 如语音播报控制器-组合播放,寄存器地址:17、18和19,寄存器值:257、258和259,寄存器值的算法和指定文件夹和文件播放是一致的,如259可换算为0x01文件夹,0x03文件名; {; "17": 257,; "18": 258,; "19": 259; }; 如语音播报控制器-播放广告,寄存地址:32对应16进制0x20,寄存器值:259,寄存器值的算法和指定文件夹和文件播放是一致的,如259可换算为0x01文件夹,0x03文件名; {; "32": 259; }; 如语音播报控制器-指定文件夹循环播放,寄存地址:33对应16进制0x21,寄存器值:256,寄存器值的算法,如256可换算为0x0100文件夹; {; "33": 256; }; 如语音播报控制器-指定文件夹随机播放,寄存地址:34对应16进制0x22,寄存器值:256,寄存器值的算法,如256可换算为0x0100文件夹; {; "34": 256; }; 如语音播报控制器-指定曲目播放,寄存地址:35对应16进制0x23,寄存器值:13,歌曲选择范围为0~3000; {; "35": 13; }; 如电梯数据采集器-传感器管理数据更新; {; "40426": 1,; "40427": 1,; "40428": 1,; "40429": 1,; "40430": 1,; "40431": 1,; "40432": 1,; "40433": 1,; "40434": 1,; "40435": 1,; "40436": 1,; "40437": 1,; "40438": 1,; "40439": 1,; "40440": 1; }; 如电梯数据采集器-采集器属性数据更新; {; "40441": 40441,; "40443": 40443,; "40444": 40444,; "40445": 40445,; "40446": 40446,; "40447": 40447,; "40448": 40448,; "40449": 40449,; "40450": 40450; }; 如电梯数据采集器-电梯属性数据更新; {; "40801": 1,; "40802": 1,; "40803": 1,; "40804": 1,; "40805": 1,; "40806": 1,; "40807": 1,; "40808": 1,; "40809": 1,; "40810": 1; }; 如电梯数据采集器-楼层数据更新; {; "40797": 1,; "40798": 1,; "40799": 1; }; """, dest='data', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看产品自定义Topic ''', + help=''' 写入采集器数据 ''', description=''' - 查看产品自定义Topic。 + 写入采集器数据。 - 示例: jdc iotcore describe-product-topic --instance-id xxx --product-key xxx --topic-id xxx + 示例: jdc iotcore collector-write-message --instance-id xxx --identifier xxx --data '{"":""}' ''', ) - def describe_product_topic(self): + def collector_write_message(self): client_factory = ClientFactory('iotcore') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.iotcore.apis.DescribeProductTopicRequest import DescribeProductTopicRequest + from jdcloud_sdk.services.iotcore.apis.CollectorWriteMessageRequest import CollectorWriteMessageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeProductTopicRequest(params_dict, headers) + req = CollectorWriteMessageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1666,7 +2079,7 @@ def describe_product_topic(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['device-query','thing-type-list','thing-type-describe','describe-thing-model','device-register','download-certificate','delete-device','device-property-set','invoke-function','event-list','function-list','invoke-thing-topic','describe-thing-shadow','update-thing-shadow','invoke-thing-service','add-device-links','query-device-page','update-device','add-device','query-device-detail','remove-device','elevator-operating-status','collector-read-message','read-holding-registers','collector-write-message','update-loo-device','add-loo-device','loongray-query-page','remove-loongray-device','describe-product-with-admin','update-product-with-admin','delete-product-with-admin','list-products-with-admin','create-admin-product','list-products','create-product','describe-product','update-product','delete-product','list-product-abilities','import-thing-model','export-thing-model','describe-product-topics','create-product-topic','describe-product-topic',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['list-product-abilities','import-thing-model','export-thing-model','invoke-thing-topic','describe-thing-shadow','update-thing-shadow','invoke-thing-service','add-device-links','query-device-page','update-device','add-device','query-device-detail','remove-device','list-products','create-product','describe-product','update-product','delete-product','update-loo-device','add-loo-device','loongray-query-page','query-admin-statistics','remove-loongray-device','register-device','download-device-certificate','delete-device','describe-device','describe-thing-type-list','describe-thing-type','describe-thing-model','set-device-property','invoke-function','describe-event-list','describe-function-list','describe-property','describe-property-snapshot','create-device-topo','describe-device-topo','update-device-topo','delete-device-topo','describe-product-with-admin','update-product-with-admin','delete-product-with-admin','list-products-with-admin','create-admin-product','describe-product-topics','create-product-topic','describe-product-topic','get-device-group','get-device-group-list','find-device-group-link-page','elevator-operating-status','collector-read-message','read-holding-registers','collector-write-message',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/iothub.py b/jdcloud_cli/controllers/services/iothub.py index 304a443..9dc52bf 100644 --- a/jdcloud_cli/controllers/services/iothub.py +++ b/jdcloud_cli/controllers/services/iothub.py @@ -36,12 +36,119 @@ class Meta: stacked_on = 'base' stacked_type = 'nested' + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为10,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) abilityName-功能名称,精确匹配; abilityType-功能类型,精确匹配; """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查看产品功能列表接口 ''', + description=''' + 查看产品功能列表接口。 + + 示例: jdc iothub list-product-abilities --product-key xxx + ''', + ) + def list_product_abilities(self): + client_factory = ClientFactory('iothub') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iothub.apis.ListProductAbilitiesRequest import ListProductAbilitiesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ListProductAbilitiesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--thing-model'], dict(help="""(object) 物模型JSON """, dest='thingModel', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 导入物模型 ''', + description=''' + 导入物模型。 + + 示例: jdc iothub import-thing-model --product-key xxx --thing-model '{"":""}' + ''', + ) + def import_thing_model(self): + client_factory = ClientFactory('iothub') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iothub.apis.ImportThingModelRequest import ImportThingModelRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ImportThingModelRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 导出物模型 ''', + description=''' + 导出物模型。 + + 示例: jdc iothub export-thing-model --product-key xxx + ''', + ) + def export_thing_model(self): + client_factory = ClientFactory('iothub') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iothub.apis.ExportThingModelRequest import ExportThingModelRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ExportThingModelRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), (['--identifier'], dict(help="""(string) 设备唯一标识 """, dest='identifier', required=True)), (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -78,6 +185,7 @@ def describe_thing_shadow(self): (['--state'], dict(help="""(object) 运行状态 """, dest='state', required=False)), (['--version'], dict(help="""(int) 设备影子版本,当前版本加1,当前版本默认其实版本为-1; 用户主动更新版本号时,设备影子会检查请求中的主动更新版本号是否大于当前版本号。; 如果大于当前版本号,则更新设备影子,并将影子版本值更新到请求的版本中,反之则会拒绝更新设备影子。; 影子版本参数为Integer型; 取值范围:0到2147483647(2的31次方-1); 当取值达到最大值2147483647(2的31次方-1)时,请求中的主动更新版本号应为-1; """, dest='version', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -114,6 +222,7 @@ def update_thing_shadow(self): (['--name'], dict(help="""(string) 服务名称 """, dest='name', required=False)), (['--input'], dict(help="""(object) 输入参数,object的key为参数名称,value为参数值 """, dest='input', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -155,6 +264,7 @@ def invoke_thing_service(self): (['--direction'], dict(help="""(string) 顺序,升序降序--asc,desc """, dest='direction', required=False)), (['--parent-id'], dict(help="""(string) 父设备Id """, dest='parentId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -192,6 +302,7 @@ def query_device_page(self): (['--description'], dict(help="""(string) 设备描述 """, dest='description', required=False)), (['--status'], dict(help="""(int) 设备状态 """, dest='status', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -229,6 +340,7 @@ def update_device(self): (['--manufacturer'], dict(help="""(string) 厂商 """, dest='manufacturer', required=False)), (['--description'], dict(help="""(string) 设备描述 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -263,6 +375,7 @@ def add_device(self): (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -297,6 +410,7 @@ def query_device_detail(self): (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -330,6 +444,7 @@ def remove_device(self): (['--region-id'], dict(help="""(string) 设备归属的实例所在区域 """, dest='regionId', required=False)), (['--device-id'], dict(help="""(string) 设备Id """, dest='deviceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -365,6 +480,7 @@ def remove_device_by_id(self): (['--page-size'], dict(help="""(int) 分页大小,默认为10,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), (['--filters'], dict(help="""(array: filter) productName-产品名称,精确匹配,支持单个; productKey-产品key,精确匹配,支持单个; productType-产品类型,精确匹配,支持单个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -399,8 +515,8 @@ def list_products(self): (['--product-name'], dict(help="""(string) 产品名称,名称不可为空,3-30个字符,只支持汉字、英文字母、数字、下划线“_”及中划线“-”,必须以汉字、英文字母及数字开头结尾 """, dest='productName', required=True)), (['--product-type'], dict(help="""(int) 节点类型,取值:; 0:设备。设备不能挂载子设备。可以直连物联网平台,也可以作为网关的子设备连接物联网平台; 1:网关。网关可以挂载子设备,具有子设备管理模块,维持子设备的拓扑关系,和将拓扑关系同步到物联网平台; """, dest='productType', type=int, required=True)), (['--product-description'], dict(help="""(string) 产品描述,80字符以内 """, dest='productDescription', required=False)), - (['--template-id'], dict(help="""(string) 物模型模板ID,内部参数,用户不可见,默认为自定义 """, dest='templateId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -408,7 +524,7 @@ def list_products(self): description=''' 新建产品。 - 示例: jdc iothub create-product --product-name xxx --product-type 0 + 示例: jdc iothub create-product --product-name xxx --product-type 5 ''', ) def create_product(self): @@ -434,6 +550,7 @@ def create_product(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -470,6 +587,7 @@ def describe_product(self): (['--product-description'], dict(help="""(string) 产品描述,80字符以内 """, dest='productDescription', required=False)), (['--dynamic-register'], dict(help="""(int) 动态注册,0:关闭,1:开启 """, dest='dynamicRegister', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -503,6 +621,7 @@ def update_product(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -533,110 +652,7 @@ def delete_product(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为10,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) abilityName-功能名称,精确匹配; abilityType-功能类型,精确匹配; """, dest='filters', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查看产品功能列表接口 ''', - description=''' - 查看产品功能列表接口。 - - 示例: jdc iothub list-product-abilities --product-key xxx - ''', - ) - def list_product_abilities(self): - client_factory = ClientFactory('iothub') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.iothub.apis.ListProductAbilitiesRequest import ListProductAbilitiesRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = ListProductAbilitiesRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), - (['--thing-model'], dict(help="""(object) 物模型JSON """, dest='thingModel', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 导入物模型 ''', - description=''' - 导入物模型。 - - 示例: jdc iothub import-thing-model --product-key xxx --thing-model '{"":""}' - ''', - ) - def import_thing_model(self): - client_factory = ClientFactory('iothub') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.iothub.apis.ImportThingModelRequest import ImportThingModelRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = ImportThingModelRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--product-key'], dict(help="""(string) 产品Key """, dest='productKey', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 导出物模型 ''', - description=''' - 导出物模型。 - - 示例: jdc iothub export-thing-model --product-key xxx - ''', - ) - def export_thing_model(self): - client_factory = ClientFactory('iothub') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.iothub.apis.ExportThingModelRequest import ExportThingModelRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = ExportThingModelRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-thing-shadow','update-thing-shadow','invoke-thing-service','query-device-page','update-device','add-device','query-device-detail','remove-device','remove-device-by-id','list-products','create-product','describe-product','update-product','delete-product','list-product-abilities','import-thing-model','export-thing-model',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['list-product-abilities','import-thing-model','export-thing-model','describe-thing-shadow','update-thing-shadow','invoke-thing-service','query-device-page','update-device','add-device','query-device-detail','remove-device','remove-device-by-id','list-products','create-product','describe-product','update-product','delete-product',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/iotlink.py b/jdcloud_cli/controllers/services/iotlink.py index 3b81c54..de1569f 100644 --- a/jdcloud_cli/controllers/services/iotlink.py +++ b/jdcloud_cli/controllers/services/iotlink.py @@ -41,6 +41,211 @@ class Meta: (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--iccid'], dict(help="""(string) 物联网卡iccid """, dest='iccid', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 根据物联网卡iccid查询该卡的基本信息 ''', + description=''' + 根据物联网卡iccid查询该卡的基本信息。 + + 示例: jdc iotlink card-info --iccid xxx + ''', + ) + def card_info(self): + client_factory = ClientFactory('iotlink') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotlink.apis.CardInfoRequest import CardInfoRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CardInfoRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--iccid'], dict(help="""(string) 物联网卡iccid """, dest='iccid', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 根据物联网卡iccid查询该卡的实名认证信息 ''', + description=''' + 根据物联网卡iccid查询该卡的实名认证信息。 + + 示例: jdc iotlink real-name-query-iot --iccid xxx + ''', + ) + def real_name_query_iot(self): + client_factory = ClientFactory('iotlink') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotlink.apis.RealNameQueryIotRequest import RealNameQueryIotRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = RealNameQueryIotRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--imsi'], dict(help="""(string) 物联网卡IMSI """, dest='imsi', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 根据物联网卡IMSI查询该卡的GPRS状态信息 ''', + description=''' + 根据物联网卡IMSI查询该卡的GPRS状态信息。 + + 示例: jdc iotlink gprs-status-by-imsi --imsi xxx + ''', + ) + def gprs_status_by_imsi(self): + client_factory = ClientFactory('iotlink') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotlink.apis.GprsStatusByIMSIRequest import GprsStatusByIMSIRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = GprsStatusByIMSIRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--imsi'], dict(help="""(string) 物联网卡imsi """, dest='imsi', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 根据物联网卡imsi查询该卡的开关机状态信息 ''', + description=''' + 根据物联网卡imsi查询该卡的开关机状态信息。 + + 示例: jdc iotlink on-off-status-by-imsi --imsi xxx + ''', + ) + def on_off_status_by_imsi(self): + client_factory = ClientFactory('iotlink') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotlink.apis.OnOffStatusByIMSIRequest import OnOffStatusByIMSIRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = OnOffStatusByIMSIRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--imsi'], dict(help="""(string) 物联网卡imsi """, dest='imsi', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 根据物联网卡imsi查询该卡的生命周期信息 ''', + description=''' + 根据物联网卡imsi查询该卡的生命周期信息。 + + 示例: jdc iotlink life-status-by-imsi --imsi xxx + ''', + ) + def life_status_by_imsi(self): + client_factory = ClientFactory('iotlink') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotlink.apis.LifeStatusByIMSIRequest import LifeStatusByIMSIRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = LifeStatusByIMSIRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--imsi'], dict(help="""(string) 物联网卡imsi """, dest='imsi', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 根据物联网卡imsi查询该卡的当月套餐内的GPRS实时使用量 ''', + description=''' + 根据物联网卡imsi查询该卡的当月套餐内的GPRS实时使用量。 + + 示例: jdc iotlink gprs-realtime-info-by-imsi --imsi xxx + ''', + ) + def gprs_realtime_info_by_imsi(self): + client_factory = ClientFactory('iotlink') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.iotlink.apis.GprsRealtimeInfoByIMSIRequest import GprsRealtimeInfoByIMSIRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = GprsRealtimeInfoByIMSIRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--iccid'], dict(help="""(string) 物联网卡iccid """, dest='iccid', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -74,6 +279,7 @@ def gprs_status(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--iccid'], dict(help="""(string) 物联网卡iccid """, dest='iccid', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -107,6 +313,7 @@ def on_off_status(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--iccid'], dict(help="""(string) 物联网卡iccid """, dest='iccid', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -140,6 +347,7 @@ def life_status(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--iccid'], dict(help="""(string) 物联网卡iccid """, dest='iccid', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -173,6 +381,7 @@ def gprs_realtime_info(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--iccids'], dict(help="""(array: string) 物联网卡号码列表(单次提交最多不超过200个号码) """, dest='iccids', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -206,6 +415,7 @@ def open_iot_card(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--iccids'], dict(help="""(array: string) 物联网卡号码列表(单次提交最多不超过200个号码) """, dest='iccids', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -239,6 +449,7 @@ def close_iot_card(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--iccids'], dict(help="""(array: string) 物联网卡号码列表(单次提交最多不超过200个号码) """, dest='iccids', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -272,6 +483,7 @@ def open_iot_flow(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--iccids'], dict(help="""(array: string) 物联网卡号码列表(单次提交最多不超过200个号码) """, dest='iccids', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -306,6 +518,7 @@ def close_iot_flow(self): (['--request-type'], dict(help="""(string) 物联网卡查询请求类型 """, dest='requestType', required=True)), (['--request-param'], dict(help="""(string) 物联网卡查询请求参数json串 """, dest='requestParam', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -340,6 +553,7 @@ def search(self): (['--request-type'], dict(help="""(string) 物联网卡操作请求类型 """, dest='requestType', required=True)), (['--request-param'], dict(help="""(string) 物联网卡操作请求参数json串 """, dest='requestParam', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -370,7 +584,7 @@ def operate(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['gprs-status','on-off-status','life-status','gprs-realtime-info','open-iot-card','close-iot-card','open-iot-flow','close-iot-flow','search','operate',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['card-info','real-name-query-iot','gprs-status-by-imsi','on-off-status-by-imsi','life-status-by-imsi','gprs-realtime-info-by-imsi','gprs-status','on-off-status','life-status','gprs-realtime-info','open-iot-card','close-iot-card','open-iot-flow','close-iot-flow','search','operate',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/ipanti.py b/jdcloud_cli/controllers/services/ipanti.py index 2d46926..ff952ea 100644 --- a/jdcloud_cli/controllers/services/ipanti.py +++ b/jdcloud_cli/controllers/services/ipanti.py @@ -39,33 +39,35 @@ class Meta: @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), - (['--instance-id'], dict(help="""(array: string) 高防实例 ID """, dest='instanceId', required=False)), + (['--search-type'], dict(help="""(string) 查询类型名称, domain:源站域名, ip:源站 IP, port: 转发端口, originPort: 源站端口, serviceIp: 高防IP(仅支持BGP线路的实例) """, dest='searchType', required=False)), + (['--search-value'], dict(help="""(string) 查询类型值 """, dest='searchValue', required=False)), + (['--sorts'], dict(help="""(array: sort) 排序属性:; port - 按转发端口排序,默认不排序,asc表示按转发端口升序,desc表示按转发端口降序; """, dest='sorts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询 DDoS 攻击日志 ''', + help=''' 查询某个实例下的非网站转发配置 ''', description=''' - 查询 DDoS 攻击日志。 + 查询某个实例下的非网站转发配置。 - 示例: jdc ipanti describe-ddo-sattack-logs --start-time xxx + 示例: jdc ipanti describe-forward-rules --instance-id xxx ''', ) - def describe_ddo_sattack_logs(self): + def describe_forward_rules(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeDDoSAttackLogsRequest import DescribeDDoSAttackLogsRequest + from jdcloud_sdk.services.ipanti.apis.DescribeForwardRulesRequest import DescribeForwardRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDDoSAttackLogsRequest(params_dict, headers) + req = DescribeForwardRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -76,33 +78,31 @@ def describe_ddo_sattack_logs(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), - (['--instance-id'], dict(help="""(array: string) 高防实例 ID """, dest='instanceId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--forward-rule-spec'], dict(help="""(forwardRuleSpec) 添加非网站类规则请求参数 """, dest='forwardRuleSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询 CC 攻击日志 ''', + help=''' 添加非网站类规则 ''', description=''' - 查询 CC 攻击日志。 + 添加非网站类规则。 - 示例: jdc ipanti describe-ccattack-logs --start-time xxx + 示例: jdc ipanti create-forward-rule --instance-id xxx --forward-rule-spec '{"":""}' ''', ) - def describe_ccattack_logs(self): + def create_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeCCAttackLogsRequest import DescribeCCAttackLogsRequest + from jdcloud_sdk.services.ipanti.apis.CreateForwardRuleRequest import CreateForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCCAttackLogsRequest(params_dict, headers) + req = CreateForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -113,35 +113,31 @@ def describe_ccattack_logs(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ, attackId 为空时必传 """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), - (['--instance-id'], dict(help="""(string) 高防实例 ID """, dest='instanceId', required=False)), - (['--sub-domain'], dict(help="""(array: string) 查询的子域名, 只有选中某一个实例后才能多选子域名 """, dest='subDomain', required=False)), - (['--attack-id'], dict(help="""(string) CC 攻击记录 Id, 不为空时忽略 startTime, endTime """, dest='attackId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--forward-rule-spec-list'], dict(help="""(array: forwardRuleSpec) 批量添加非网站类规则请求参数 """, dest='forwardRuleSpecList', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询 CC 攻击日志详情.; - 参数 attackId 优先级高于 instanceId, attackId 不为空时, 忽略 instanceId; ''', + help=''' 批量添加非网站类规则 ''', description=''' - 查询 CC 攻击日志详情.; - 参数 attackId 优先级高于 instanceId, attackId 不为空时, 忽略 instanceId; 。 + 批量添加非网站类规则。 - 示例: jdc ipanti describe-ccattack-log-details + 示例: jdc ipanti create-forward-rules --instance-id xxx --forward-rule-spec-list ['{"":""}'] ''', ) - def describe_ccattack_log_details(self): + def create_forward_rules(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeCCAttackLogDetailsRequest import DescribeCCAttackLogDetailsRequest + from jdcloud_sdk.services.ipanti.apis.CreateForwardRulesRequest import CreateForwardRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCCAttackLogDetailsRequest(params_dict, headers) + req = CreateForwardRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -152,32 +148,31 @@ def describe_ccattack_log_details(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), - (['--instance-id'], dict(help="""(array: string) 高防实例 ID """, dest='instanceId', required=False)), - (['--type'], dict(help="""(int) 攻击类型, 0 为 DDoS, 1 为 CC """, dest='type', type=int, required=True)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询攻击次数及流量峰值 ''', + help=''' 查询非网站类规则 ''', description=''' - 查询攻击次数及流量峰值。 + 查询非网站类规则。 - 示例: jdc ipanti describe-attack-statistics --start-time xxx --type 0 + 示例: jdc ipanti describe-forward-rule --instance-id xxx --forward-rule-id xxx ''', ) - def describe_attack_statistics(self): + def describe_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeAttackStatisticsRequest import DescribeAttackStatisticsRequest + from jdcloud_sdk.services.ipanti.apis.DescribeForwardRuleRequest import DescribeForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAttackStatisticsRequest(params_dict, headers) + req = DescribeForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -188,31 +183,32 @@ def describe_attack_statistics(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), - (['--instance-id'], dict(help="""(array: string) 高防实例 ID """, dest='instanceId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), + (['--forward-rule-spec'], dict(help="""(forwardRuleSpec) 更新非网站类规则请求参数 """, dest='forwardRuleSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询各类型攻击次数 ''', + help=''' 更新非网站类规则 ''', description=''' - 查询各类型攻击次数。 + 更新非网站类规则。 - 示例: jdc ipanti describe-attack-type-count --start-time xxx + 示例: jdc ipanti modify-forward-rule --instance-id xxx --forward-rule-id xxx --forward-rule-spec '{"":""}' ''', ) - def describe_attack_type_count(self): + def modify_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeAttackTypeCountRequest import DescribeAttackTypeCountRequest + from jdcloud_sdk.services.ipanti.apis.ModifyForwardRuleRequest import ModifyForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAttackTypeCountRequest(params_dict, headers) + req = ModifyForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -223,31 +219,31 @@ def describe_attack_type_count(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), - (['--instance-id'], dict(help="""(array: string) 高防实例 Id 列表 """, dest='instanceId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' DDos 防护流量报表 ''', + help=''' 删除非网站规则, 批量操作时, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', description=''' - DDos 防护流量报表。 + 删除非网站规则, 批量操作时, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 - 示例: jdc ipanti describe-ddo-sgraph --start-time xxx + 示例: jdc ipanti delete-forward-rule --instance-id xxx --forward-rule-id xxx ''', ) - def describe_ddo_sgraph(self): + def delete_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeDDoSGraphRequest import DescribeDDoSGraphRequest + from jdcloud_sdk.services.ipanti.apis.DeleteForwardRuleRequest import DeleteForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDDoSGraphRequest(params_dict, headers) + req = DeleteForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -258,31 +254,31 @@ def describe_ddo_sgraph(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), - (['--instance-id'], dict(help="""(array: string) 高防实例 Id 列表 """, dest='instanceId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 转发流量报表 ''', + help=''' 非网站类规则切换成防御状态。支持批量操作, 批量操作时 forwardRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', description=''' - 转发流量报表。 + 非网站类规则切换成防御状态。支持批量操作, 批量操作时 forwardRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 - 示例: jdc ipanti describe-fwd-graph --start-time xxx + 示例: jdc ipanti switch-forward-rule-protect --instance-id xxx --forward-rule-id xxx ''', ) - def describe_fwd_graph(self): + def switch_forward_rule_protect(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeFwdGraphRequest import DescribeFwdGraphRequest + from jdcloud_sdk.services.ipanti.apis.SwitchForwardRuleProtectRequest import SwitchForwardRuleProtectRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeFwdGraphRequest(params_dict, headers) + req = SwitchForwardRuleProtectRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -293,32 +289,31 @@ def describe_fwd_graph(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), - (['--instance-id'], dict(help="""(array: string) 高防实例 Id 列表 """, dest='instanceId', required=False)), - (['--sub-domain'], dict(help="""(array: string) 规则域名列表 """, dest='subDomain', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' CC 防护流量报表 ''', + help=''' 非网站类规则切换成回源状态。支持批量操作, 批量操作时 forwardRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', description=''' - CC 防护流量报表。 + 非网站类规则切换成回源状态。支持批量操作, 批量操作时 forwardRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 - 示例: jdc ipanti describe-ccgraph --start-time xxx + 示例: jdc ipanti switch-forward-rule-origin --instance-id xxx --forward-rule-id xxx ''', ) - def describe_ccgraph(self): + def switch_forward_rule_origin(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeCCGraphRequest import DescribeCCGraphRequest + from jdcloud_sdk.services.ipanti.apis.SwitchForwardRuleOriginRequest import SwitchForwardRuleOriginRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCCGraphRequest(params_dict, headers) + req = SwitchForwardRuleOriginRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -330,32 +325,30 @@ def describe_ccgraph(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--search-type'], dict(help="""(string) 查询类型名称, domain:源站域名, ip:源站 IP, port: 转发端口, originPort: 源站端口 """, dest='searchType', required=False)), - (['--search-value'], dict(help="""(string) 查询类型值 """, dest='searchValue', required=False)), + (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询某个实例下的非网站转发配置 ''', + help=''' 查询非网站类转发规则的防护规则 ''', description=''' - 查询某个实例下的非网站转发配置。 + 查询非网站类转发规则的防护规则。 - 示例: jdc ipanti describe-forward-rules --instance-id xxx + 示例: jdc ipanti describe-protection-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx ''', ) - def describe_forward_rules(self): + def describe_protection_rule_of_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeForwardRulesRequest import DescribeForwardRulesRequest + from jdcloud_sdk.services.ipanti.apis.DescribeProtectionRuleOfForwardRuleRequest import DescribeProtectionRuleOfForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeForwardRulesRequest(params_dict, headers) + req = DescribeProtectionRuleOfForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -367,29 +360,31 @@ def describe_forward_rules(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--forward-rule-spec'], dict(help="""(forwardRuleSpec) 添加非网站类规则请求参数 """, dest='forwardRuleSpec', required=True)), + (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), + (['--forward-protection-rule-spec'], dict(help="""(forwardProtectionRuleSpec) 修改非网站类转发规则的防护规则请求参数 """, dest='forwardProtectionRuleSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加非网站类规则 ''', + help=''' 修改非网站类转发规则的防护规则 ''', description=''' - 添加非网站类规则。 + 修改非网站类转发规则的防护规则。 - 示例: jdc ipanti create-forward-rule --instance-id xxx --forward-rule-spec '{"":""}' + 示例: jdc ipanti modify-protection-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx --forward-protection-rule-spec '{"":""}' ''', ) - def create_forward_rule(self): + def modify_protection_rule_of_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.CreateForwardRuleRequest import CreateForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.ModifyProtectionRuleOfForwardRuleRequest import ModifyProtectionRuleOfForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateForwardRuleRequest(params_dict, headers) + req = ModifyProtectionRuleOfForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -400,30 +395,29 @@ def create_forward_rule(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询非网站类规则 ''', + help=''' 查询非网站类转发规则的防护规则 Geo 拦截可设置区域编码 ''', description=''' - 查询非网站类规则。 + 查询非网站类转发规则的防护规则 Geo 拦截可设置区域编码。 - 示例: jdc ipanti describe-forward-rule --instance-id xxx --forward-rule-id xxx + 示例: jdc ipanti describe-geo-areas ''', ) - def describe_forward_rule(self): + def describe_geo_areas(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeForwardRuleRequest import DescribeForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.DescribeGeoAreasRequest import DescribeGeoAreasRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeForwardRuleRequest(params_dict, headers) + req = DescribeGeoAreasRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -436,29 +430,29 @@ def describe_forward_rule(self): (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), - (['--forward-rule-spec'], dict(help="""(forwardRuleSpec) 更新非网站类规则请求参数 """, dest='forwardRuleSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新非网站类规则 ''', + help=''' 查询转发规则的黑名单规则 ''', description=''' - 更新非网站类规则。 + 查询转发规则的黑名单规则。 - 示例: jdc ipanti modify-forward-rule --instance-id xxx --forward-rule-id xxx --forward-rule-spec '{"":""}' + 示例: jdc ipanti describe-black-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx ''', ) - def modify_forward_rule(self): + def describe_black_list_rule_of_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.ModifyForwardRuleRequest import ModifyForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.DescribeBlackListRuleOfForwardRuleRequest import DescribeBlackListRuleOfForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyForwardRuleRequest(params_dict, headers) + req = DescribeBlackListRuleOfForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -471,28 +465,30 @@ def modify_forward_rule(self): (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), + (['--modify-spec'], dict(help="""(modifyBlackListRuleOfForwardRuleSpec) 修改转发规则的黑名单规则请求参数 """, dest='modifySpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除非网站规则, 批量操作时, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', + help=''' 修改转发规则的黑名单规则 ''', description=''' - 删除非网站规则, 批量操作时, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 + 修改转发规则的黑名单规则。 - 示例: jdc ipanti delete-forward-rule --instance-id xxx --forward-rule-id xxx + 示例: jdc ipanti modify-black-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx --modify-spec '{"":""}' ''', ) - def delete_forward_rule(self): + def modify_black_list_rule_of_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DeleteForwardRuleRequest import DeleteForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.ModifyBlackListRuleOfForwardRuleRequest import ModifyBlackListRuleOfForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteForwardRuleRequest(params_dict, headers) + req = ModifyBlackListRuleOfForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -506,27 +502,28 @@ def delete_forward_rule(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 非网站类规则切换成防御状态 ''', + help=''' 开启转发规则的黑名单规则 ''', description=''' - 非网站类规则切换成防御状态。 + 开启转发规则的黑名单规则。 - 示例: jdc ipanti switch-forward-rule-protect --instance-id xxx --forward-rule-id xxx + 示例: jdc ipanti enable-black-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx ''', ) - def switch_forward_rule_protect(self): + def enable_black_list_rule_of_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.SwitchForwardRuleProtectRequest import SwitchForwardRuleProtectRequest + from jdcloud_sdk.services.ipanti.apis.EnableBlackListRuleOfForwardRuleRequest import EnableBlackListRuleOfForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SwitchForwardRuleProtectRequest(params_dict, headers) + req = EnableBlackListRuleOfForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -540,27 +537,28 @@ def switch_forward_rule_protect(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 非网站类规则切换成回源状态 ''', + help=''' 关闭转发规则的黑名单规则 ''', description=''' - 非网站类规则切换成回源状态。 + 关闭转发规则的黑名单规则。 - 示例: jdc ipanti switch-forward-rule-origin --instance-id xxx --forward-rule-id xxx + 示例: jdc ipanti disable-black-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx ''', ) - def switch_forward_rule_origin(self): + def disable_black_list_rule_of_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.SwitchForwardRuleOriginRequest import SwitchForwardRuleOriginRequest + from jdcloud_sdk.services.ipanti.apis.DisableBlackListRuleOfForwardRuleRequest import DisableBlackListRuleOfForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SwitchForwardRuleOriginRequest(params_dict, headers) + req = DisableBlackListRuleOfForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -574,27 +572,28 @@ def switch_forward_rule_origin(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询非网站类转发规则的防护规则 ''', + help=''' 查询转发规则的白名单规则 ''', description=''' - 查询非网站类转发规则的防护规则。 + 查询转发规则的白名单规则。 - 示例: jdc ipanti describe-protection-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx + 示例: jdc ipanti describe-white-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx ''', ) - def describe_protection_rule_of_forward_rule(self): + def describe_white_list_rule_of_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeProtectionRuleOfForwardRuleRequest import DescribeProtectionRuleOfForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.DescribeWhiteListRuleOfForwardRuleRequest import DescribeWhiteListRuleOfForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeProtectionRuleOfForwardRuleRequest(params_dict, headers) + req = DescribeWhiteListRuleOfForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -607,29 +606,30 @@ def describe_protection_rule_of_forward_rule(self): (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), - (['--forward-protection-rule-spec'], dict(help="""(forwardProtectionRuleSpec) 修改非网站类转发规则的防护规则请求参数 """, dest='forwardProtectionRuleSpec', required=True)), + (['--modify-spec'], dict(help="""(modifyWhiteListRuleOfForwardRuleSpec) 修改转发规则的黑名单规则请求参数 """, dest='modifySpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改非网站类转发规则的防护规则 ''', + help=''' 修改转发规则的白名单规则 ''', description=''' - 修改非网站类转发规则的防护规则。 + 修改转发规则的白名单规则。 - 示例: jdc ipanti modify-protection-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx --forward-protection-rule-spec '{"":""}' + 示例: jdc ipanti modify-white-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx --modify-spec '{"":""}' ''', ) - def modify_protection_rule_of_forward_rule(self): + def modify_white_list_rule_of_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.ModifyProtectionRuleOfForwardRuleRequest import ModifyProtectionRuleOfForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.ModifyWhiteListRuleOfForwardRuleRequest import ModifyWhiteListRuleOfForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyProtectionRuleOfForwardRuleRequest(params_dict, headers) + req = ModifyWhiteListRuleOfForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -640,28 +640,31 @@ def modify_protection_rule_of_forward_rule(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询非网站类转发规则的防护规则 Geo 拦截可设置区域编码 ''', + help=''' 开启转发规则的白名单规则 ''', description=''' - 查询非网站类转发规则的防护规则 Geo 拦截可设置区域编码。 + 开启转发规则的白名单规则。 - 示例: jdc ipanti describe-geo-areas + 示例: jdc ipanti enable-white-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx ''', ) - def describe_geo_areas(self): + def enable_white_list_rule_of_forward_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeGeoAreasRequest import DescribeGeoAreasRequest + from jdcloud_sdk.services.ipanti.apis.EnableWhiteListRuleOfForwardRuleRequest import EnableWhiteListRuleOfForwardRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeGeoAreasRequest(params_dict, headers) + req = EnableWhiteListRuleOfForwardRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -675,27 +678,1389 @@ def describe_geo_areas(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询转发规则的黑名单规则 ''', + help=''' 关闭转发规则的白名单规则 ''', + description=''' + 关闭转发规则的白名单规则。 + + 示例: jdc ipanti disable-white-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx + ''', + ) + def disable_white_list_rule_of_forward_rule(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DisableWhiteListRuleOfForwardRuleRequest import DisableWhiteListRuleOfForwardRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DisableWhiteListRuleOfForwardRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(array: string) 高防实例 Id 列表 """, dest='instanceId', required=False)), + (['--service-ip'], dict(help="""(array: string) 高防IP列表.
- 使用 describeServiceIpList 接口查询实例的高防 IP """, dest='serviceIp', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' DDos 防护流量报表; 参数 serviceIp 优先级大于 instanceId.; - 指定 serviceIp 参数时, 忽略 instanceId 参数, 查询 ip 相关报表; - 未指定 serviceIp 时, 查询 instanceId 指定实例相关报表; - serviceIp 和 instanceId 均未指定时, 查询用户所有实例报表; ''', + description=''' + DDos 防护流量报表; 参数 serviceIp 优先级大于 instanceId.; - 指定 serviceIp 参数时, 忽略 instanceId 参数, 查询 ip 相关报表; - 未指定 serviceIp 时, 查询 instanceId 指定实例相关报表; - serviceIp 和 instanceId 均未指定时, 查询用户所有实例报表; 。 + + 示例: jdc ipanti describe-ddo-sgraph --start-time xxx + ''', + ) + def describe_ddo_sgraph(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeDDoSGraphRequest import DescribeDDoSGraphRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeDDoSGraphRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(array: string) 高防实例 Id 列表 """, dest='instanceId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 转发流量报表 ''', + description=''' + 转发流量报表。 + + 示例: jdc ipanti describe-fwd-graph --start-time xxx + ''', + ) + def describe_fwd_graph(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeFwdGraphRequest import DescribeFwdGraphRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeFwdGraphRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(array: string) 高防实例 Id 列表 """, dest='instanceId', required=False)), + (['--service-ip'], dict(help="""(array: string) 高防IP列表.
- 使用 describeServiceIpList 接口查询实例的高防 IP """, dest='serviceIp', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 业务流量报表 ; 参数 serviceIp 优先级大于 instanceId.; - 指定 serviceIp 参数时, 忽略 instanceId 参数, 查询 ip 相关报表; - 未指定 serviceIp 时, 查询 instanceId 指定实例相关报表; - serviceIp 和 instanceId 均未指定时, 查询用户所有实例报表; ''', + description=''' + 业务流量报表 ; 参数 serviceIp 优先级大于 instanceId.; - 指定 serviceIp 参数时, 忽略 instanceId 参数, 查询 ip 相关报表; - 未指定 serviceIp 时, 查询 instanceId 指定实例相关报表; - serviceIp 和 instanceId 均未指定时, 查询用户所有实例报表; 。 + + 示例: jdc ipanti describe-business-graph --start-time xxx + ''', + ) + def describe_business_graph(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeBusinessGraphRequest import DescribeBusinessGraphRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeBusinessGraphRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(array: string) 高防实例 Id 列表 """, dest='instanceId', required=False)), + (['--sub-domain'], dict(help="""(array: string) 规则域名列表 """, dest='subDomain', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' CC 防护流量报表 ''', + description=''' + CC 防护流量报表。 + + 示例: jdc ipanti describe-ccgraph --start-time xxx + ''', + ) + def describe_ccgraph(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeCCGraphRequest import DescribeCCGraphRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeCCGraphRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 7 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(array: string) 高防实例 Id 列表 """, dest='instanceId', required=False)), + (['--sub-domain'], dict(help="""(array: string) 规则域名列表 """, dest='subDomain', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 高防返回客户端状态码报表 ''', + description=''' + 高防返回客户端状态码报表。 + + 示例: jdc ipanti describe-status-graph --start-time xxx + ''', + ) + def describe_status_graph(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeStatusGraphRequest import DescribeStatusGraphRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeStatusGraphRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(array: string) 高防实例 Id 列表 """, dest='instanceId', required=False)), + (['--service-ip'], dict(help="""(array: string) 高防IP列表.
- 使用 describeServiceIpList 接口查询实例的高防 IP """, dest='serviceIp', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 新建与并发连接数统计报表 ; 参数 serviceIp 优先级大于 instanceId.; - 指定 serviceIp 参数时, 忽略 instanceId 参数, 查询 ip 相关报表; - 未指定 serviceIp 时, 查询 instanceId 指定实例相关报表; - serviceIp 和 instanceId 均未指定时, 查询用户所有实例报表; ''', + description=''' + 新建与并发连接数统计报表 ; 参数 serviceIp 优先级大于 instanceId.; - 指定 serviceIp 参数时, 忽略 instanceId 参数, 查询 ip 相关报表; - 未指定 serviceIp 时, 查询 instanceId 指定实例相关报表; - serviceIp 和 instanceId 均未指定时, 查询用户所有实例报表; 。 + + 示例: jdc ipanti describe-conn-stat-graph --start-time xxx + ''', + ) + def describe_conn_stat_graph(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeConnStatGraphRequest import DescribeConnStatGraphRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeConnStatGraphRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(array: string) 高防实例 ID """, dest='instanceId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询 DDoS 攻击日志, 仅能查询非BGP实例的攻击记录, 同时查询BGP和非BGP实例请使用 describeDDoSIpAttackLogs ''', + description=''' + 查询 DDoS 攻击日志, 仅能查询非BGP实例的攻击记录, 同时查询BGP和非BGP实例请使用 describeDDoSIpAttackLogs。 + + 示例: jdc ipanti describe-ddo-sattack-logs --start-time xxx + ''', + ) + def describe_ddo_sattack_logs(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeDDoSAttackLogsRequest import DescribeDDoSAttackLogsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeDDoSAttackLogsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(array: string) 高防实例 ID """, dest='instanceId', required=False)), + (['--service-ip'], dict(help="""(array: string) 高防IP列表.
- 使用 describeServiceIpList 接口查询实例的高防 IP """, dest='serviceIp', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询高防IP的 DDoS 攻击日志, 仅BGP实例返回的是IP级别的攻击记录, 非BGP实例返回的仍是实例级别的攻击记录(serviceIp 字段为空); 参数 serviceIp 优先级大于 instanceId.; - 指定 serviceIp 参数时, 忽略 instanceId 参数, 查询 ip 相关攻击记录.; - 未指定 serviceIp 时, 查询 instanceId 指定实例相关攻击记录.; - serviceIp 和 instanceId 均未指定时, 查询用户所有攻击记录; ''', + description=''' + 查询高防IP的 DDoS 攻击日志, 仅BGP实例返回的是IP级别的攻击记录, 非BGP实例返回的仍是实例级别的攻击记录(serviceIp 字段为空); 参数 serviceIp 优先级大于 instanceId.; - 指定 serviceIp 参数时, 忽略 instanceId 参数, 查询 ip 相关攻击记录.; - 未指定 serviceIp 时, 查询 instanceId 指定实例相关攻击记录.; - serviceIp 和 instanceId 均未指定时, 查询用户所有攻击记录; 。 + + 示例: jdc ipanti describe-ddo-sip-attack-logs --start-time xxx + ''', + ) + def describe_ddo_sip_attack_logs(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeDDoSIpAttackLogsRequest import DescribeDDoSIpAttackLogsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeDDoSIpAttackLogsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(array: string) 高防实例 ID """, dest='instanceId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询 CC 攻击日志 ''', + description=''' + 查询 CC 攻击日志。 + + 示例: jdc ipanti describe-ccattack-logs --start-time xxx + ''', + ) + def describe_ccattack_logs(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeCCAttackLogsRequest import DescribeCCAttackLogsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeCCAttackLogsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ, attackId 为空时必传 """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 ID """, dest='instanceId', required=False)), + (['--sub-domain'], dict(help="""(array: string) 查询的子域名, 只有选中某一个实例后才能多选子域名 """, dest='subDomain', required=False)), + (['--attack-id'], dict(help="""(string) CC 攻击记录 Id, 不为空时忽略 startTime, endTime """, dest='attackId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询 CC 攻击日志详情.; - 参数 attackId 优先级高于 instanceId, attackId 不为空时, 忽略 instanceId; ''', + description=''' + 查询 CC 攻击日志详情.; - 参数 attackId 优先级高于 instanceId, attackId 不为空时, 忽略 instanceId; 。 + + 示例: jdc ipanti describe-ccattack-log-details + ''', + ) + def describe_ccattack_log_details(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeCCAttackLogDetailsRequest import DescribeCCAttackLogDetailsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeCCAttackLogDetailsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(array: string) 高防实例 ID """, dest='instanceId', required=False)), + (['--service-ip'], dict(help="""(array: string) 高防IP列表.
- 使用 describeServiceIpList 接口查询实例的高防 IP """, dest='serviceIp', required=False)), + (['--type'], dict(help="""(int) 攻击类型, 0 为 DDoS, 1 为 CC """, dest='type', type=int, required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询攻击次数及流量峰值; 参数 serviceIp 优先级大于 instanceId.; - 指定 serviceIp 参数时, 忽略 instanceId 参数, 统计 ip 相关攻击; - 未指定 serviceIp 时, 统计 instanceId 指定实例相关攻击; - serviceIp 和 instanceId 均未指定时, 统计用户所有攻击记录; CC攻击为实例级别, 查询类型 type 为 cc 时, 参数 serviceIp 无效; ''', + description=''' + 查询攻击次数及流量峰值; 参数 serviceIp 优先级大于 instanceId.; - 指定 serviceIp 参数时, 忽略 instanceId 参数, 统计 ip 相关攻击; - 未指定 serviceIp 时, 统计 instanceId 指定实例相关攻击; - serviceIp 和 instanceId 均未指定时, 统计用户所有攻击记录; CC攻击为实例级别, 查询类型 type 为 cc 时, 参数 serviceIp 无效; 。 + + 示例: jdc ipanti describe-attack-statistics --start-time xxx --type 5 + ''', + ) + def describe_attack_statistics(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeAttackStatisticsRequest import DescribeAttackStatisticsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAttackStatisticsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--start-time'], dict(help="""(string) 开始时间, 只能查询最近 90 天以内的数据, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询的结束时间, UTC 时间, 格式: yyyy-MM-dd'T'HH:mm:ssZ """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(array: string) 高防实例 ID """, dest='instanceId', required=False)), + (['--service-ip'], dict(help="""(array: string) 高防IP列表.
- 使用 describeServiceIpList 接口查询实例的高防 IP """, dest='serviceIp', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询各类型攻击次数; 参数 serviceIp 优先级大于 instanceId.; - 指定 serviceIp 参数时, 忽略 instanceId 参数, 统计 ip 相关攻击; - 未指定 serviceIp 时, 统计 instanceId 指定实例相关攻击; - serviceIp 和 instanceId 均未指定时, 统计用户所有攻击记录; ''', + description=''' + 查询各类型攻击次数; 参数 serviceIp 优先级大于 instanceId.; - 指定 serviceIp 参数时, 忽略 instanceId 参数, 统计 ip 相关攻击; - 未指定 serviceIp 时, 统计 instanceId 指定实例相关攻击; - serviceIp 和 instanceId 均未指定时, 统计用户所有攻击记录; 。 + + 示例: jdc ipanti describe-attack-type-count --start-time xxx + ''', + ) + def describe_attack_type_count(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeAttackTypeCountRequest import DescribeAttackTypeCountRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAttackTypeCountRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--name'], dict(help="""(string) 实例名称, 可模糊匹配 """, dest='name', required=False)), + (['--inner-ip'], dict(help="""(string) 云内IP, 可模糊匹配 """, dest='innerIp', required=False)), + (['--service-ip'], dict(help="""(string) 高防IP, 可模糊匹配 """, dest='serviceIp', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询某个实例下的防护调度规则 ''', + description=''' + 查询某个实例下的防护调度规则。 + + 示例: jdc ipanti describe-dispatch-rules --instance-id xxx + ''', + ) + def describe_dispatch_rules(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeDispatchRulesRequest import DescribeDispatchRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeDispatchRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--create-dispatch-rule-spec'], dict(help="""(createDispatchRuleSpec) 添加防护调度规则请求参数 """, dest='createDispatchRuleSpec', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 添加防护调度规则 ''', + description=''' + 添加防护调度规则。 + + 示例: jdc ipanti create-dispatch-rule --instance-id xxx --create-dispatch-rule-spec '{"":""}' + ''', + ) + def create_dispatch_rule(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.CreateDispatchRuleRequest import CreateDispatchRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateDispatchRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--dispatch-rule-spec-list'], dict(help="""(array: createDispatchRuleSpec) 批量添加防护调度规则请求参数 """, dest='dispatchRuleSpecList', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 批量添加防护调度规则 ''', + description=''' + 批量添加防护调度规则。 + + 示例: jdc ipanti create-dispatch-rules --instance-id xxx --dispatch-rule-spec-list ['{"":""}'] + ''', + ) + def create_dispatch_rules(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.CreateDispatchRulesRequest import CreateDispatchRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateDispatchRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--dispatch-rule-id'], dict(help="""(string) 防护调度规则 Id """, dest='dispatchRuleId', required=True)), + (['--modify-dispatch-rule-spec'], dict(help="""(modifyDispatchRuleSpec) 更新防护调度规则请求参数 """, dest='modifyDispatchRuleSpec', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 更新防护调度规则 ''', + description=''' + 更新防护调度规则。 + + 示例: jdc ipanti modify-dispatch-rule --instance-id xxx --dispatch-rule-id xxx --modify-dispatch-rule-spec '{"":""}' + ''', + ) + def modify_dispatch_rule(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.ModifyDispatchRuleRequest import ModifyDispatchRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyDispatchRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--dispatch-rule-id'], dict(help="""(string) 防护调度规则 Id """, dest='dispatchRuleId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除防护调度规则 ''', + description=''' + 删除防护调度规则。 + + 示例: jdc ipanti delete-dispatch-rule --instance-id xxx --dispatch-rule-id xxx + ''', + ) + def delete_dispatch_rule(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DeleteDispatchRuleRequest import DeleteDispatchRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteDispatchRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--dispatch-rule-id'], dict(help="""(string) 防护调度规则 Id """, dest='dispatchRuleId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 防护调度规则切换成防御状态 ''', + description=''' + 防护调度规则切换成防御状态。 + + 示例: jdc ipanti switch-dispatch-rule-protect --instance-id xxx --dispatch-rule-id xxx + ''', + ) + def switch_dispatch_rule_protect(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.SwitchDispatchRuleProtectRequest import SwitchDispatchRuleProtectRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = SwitchDispatchRuleProtectRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--dispatch-rule-id'], dict(help="""(string) 防护调度规则 Id """, dest='dispatchRuleId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 防护调度规则切换成回源状态 ''', + description=''' + 防护调度规则切换成回源状态。 + + 示例: jdc ipanti switch-dispatch-rule-origin --instance-id xxx --dispatch-rule-id xxx + ''', + ) + def switch_dispatch_rule_origin(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.SwitchDispatchRuleOriginRequest import SwitchDispatchRuleOriginRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = SwitchDispatchRuleOriginRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询实例全局访问控制配置,包括全局的IP黑白名单和geo拦截配置 ''', + description=''' + 查询实例全局访问控制配置,包括全局的IP黑白名单和geo拦截配置。 + + 示例: jdc ipanti describe-instance-acl --instance-id xxx + ''', + ) + def describe_instance_acl(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeInstanceAclRequest import DescribeInstanceAclRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeInstanceAclRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--instance-acl-spec'], dict(help="""(instanceAclSpec) 修改实例全局访问控制配置参数 """, dest='instanceAclSpec', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改实例全局访问控制配置,包括全局的IP黑白名单和geo拦截配置 ''', + description=''' + 修改实例全局访问控制配置,包括全局的IP黑白名单和geo拦截配置。 + + 示例: jdc ipanti modify-instance-acl --instance-id xxx --instance-acl-spec '{"":""}' + ''', + ) + def modify_instance_acl(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.ModifyInstanceAclRequest import ModifyInstanceAclRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyInstanceAclRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 实例全局访问控制配置可以恢复到上一次下发成功的配置时,调用此接口回滚到上一次下发成功的配置 ''', + description=''' + 实例全局访问控制配置可以恢复到上一次下发成功的配置时,调用此接口回滚到上一次下发成功的配置。 + + 示例: jdc ipanti recover-instance-acl --instance-id xxx + ''', + ) + def recover_instance_acl(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.RecoverInstanceAclRequest import RecoverInstanceAclRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = RecoverInstanceAclRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--status'], dict(help="""(string) 自定义页面状态, 可取值approving: 审批中, refused: 审批不通过, approved: 审批通过, 为空时查询全部 """, dest='status', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询自定义页面列表 ''', + description=''' + 查询自定义页面列表。 + + 示例: jdc ipanti describe-custom-pages --instance-id xxx + ''', + ) + def describe_custom_pages(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeCustomPagesRequest import DescribeCustomPagesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeCustomPagesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--custom-page-spec'], dict(help="""(customPageSpec) 添加自定义页面请求参数 """, dest='customPageSpec', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 添加自定义页面 ''', + description=''' + 添加自定义页面。 + + 示例: jdc ipanti create-custom-page --instance-id xxx --custom-page-spec '{"":""}' + ''', + ) + def create_custom_page(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.CreateCustomPageRequest import CreateCustomPageRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateCustomPageRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--page-id'], dict(help="""(string) 自定义页面Id """, dest='pageId', required=True)), + (['--custom-page-spec'], dict(help="""(customPageSpec) 修改自定义页面请求参数 """, dest='customPageSpec', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改自定义页面 ''', + description=''' + 修改自定义页面。 + + 示例: jdc ipanti modify-custom-page --instance-id xxx --page-id xxx --custom-page-spec '{"":""}' + ''', + ) + def modify_custom_page(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.ModifyCustomPageRequest import ModifyCustomPageRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyCustomPageRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--page-id'], dict(help="""(string) 自定义页面Id """, dest='pageId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除自定义页面, 使用中的不允许删除 ''', + description=''' + 删除自定义页面, 使用中的不允许删除。 + + 示例: jdc ipanti delete-custom-page --instance-id xxx --page-id xxx + ''', + ) + def delete_custom_page(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DeleteCustomPageRequest import DeleteCustomPageRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteCustomPageRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--page-id'], dict(help="""(string) 自定义页面Id """, dest='pageId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改实例错误状态码返回页面为自定义页面 ''', + description=''' + 修改实例错误状态码返回页面为自定义页面。 + + 示例: jdc ipanti modify-instance-custom-page --instance-id xxx --page-id xxx + ''', + ) + def modify_instance_custom_page(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.ModifyInstanceCustomPageRequest import ModifyInstanceCustomPageRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyInstanceCustomPageRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改实例页面错误状态码返回页面为为默认页面 ''', + description=''' + 修改实例页面错误状态码返回页面为为默认页面。 + + 示例: jdc ipanti modify-instance-custom-page-default --instance-id xxx + ''', + ) + def modify_instance_custom_page_default(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.ModifyInstanceCustomPageDefaultRequest import ModifyInstanceCustomPageDefaultRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyInstanceCustomPageDefaultRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 开启实例错误状态码返回页面, 错误状态码返回默认页面或自定义页面 ''', + description=''' + 开启实例错误状态码返回页面, 错误状态码返回默认页面或自定义页面。 + + 示例: jdc ipanti enable-instance-custom-page --instance-id xxx + ''', + ) + def enable_instance_custom_page(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.EnableInstanceCustomPageRequest import EnableInstanceCustomPageRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = EnableInstanceCustomPageRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 关闭实例错误状态码返回页面, 透传错误状态码 ''', + description=''' + 关闭实例错误状态码返回页面, 透传错误状态码。 + + 示例: jdc ipanti disable-instance-custom-page --instance-id xxx + ''', + ) + def disable_instance_custom_page(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DisableInstanceCustomPageRequest import DisableInstanceCustomPageRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DisableInstanceCustomPageRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为 1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为 10, 取值范围[10, 100], 0 表示全量 """, dest='pageSize', type=int, required=False)), + (['--name'], dict(help="""(string) 实例名称, 可模糊匹配 """, dest='name', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询实例列表 ''', + description=''' + 查询实例列表。 + + 示例: jdc ipanti describe-instances + ''', + ) + def describe_instances(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeInstancesRequest import DescribeInstancesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeInstancesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--create-instance-spec'], dict(help="""(createInstanceSpec) 新购或升级实例请求参数 """, dest='createInstanceSpec', required=True)), + (['--auto-renewal-spec'], dict(help="""(autoRenewalSpec) 自动续费配置, 默认不开通, 仅新购实例时可设置 """, dest='autoRenewalSpec', required=False)), + (['--auto-pay'], dict(help="""(bool) 自动支付标识 """, dest='autoPay', type=bool, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 新购或升级高防实例 ''', + description=''' + 新购或升级高防实例。 + + 示例: jdc ipanti create-instance --create-instance-spec '{"":""}' + ''', + ) + def create_instance(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.CreateInstanceRequest import CreateInstanceRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateInstanceRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询实例 ''', + description=''' + 查询实例。 + + 示例: jdc ipanti describe-instance --instance-id xxx + ''', + ) + def describe_instance(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeInstanceRequest import DescribeInstanceRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeInstanceRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--rename-instance-spec'], dict(help="""(renameInstanceSpec) 修改实例名称请求参数 """, dest='renameInstanceSpec', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改实例名称 ''', + description=''' + 修改实例名称。 + + 示例: jdc ipanti modify-instance-name --instance-id xxx --rename-instance-spec '{"":""}' + ''', + ) + def modify_instance_name(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.ModifyInstanceNameRequest import ModifyInstanceNameRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyInstanceNameRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--modify-instance-epbspec'], dict(help="""(modifyInstanceEPBSpec) 修改实例名称请求参数 """, dest='modifyInstanceEPBSpec', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 更新实例弹性防护带宽 ''', + description=''' + 更新实例弹性防护带宽。 + + 示例: jdc ipanti modify-epb --instance-id xxx --modify-instance-epbspec '{"":""}' + ''', + ) + def modify_epb(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.ModifyEPBRequest import ModifyEPBRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyEPBRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询告警配置 ''', + description=''' + 查询告警配置。 + + 示例: jdc ipanti describe-alarm-config --instance-id xxx + ''', + ) + def describe_alarm_config(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DescribeAlarmConfigRequest import DescribeAlarmConfigRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAlarmConfigRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--alarm-config-spec'], dict(help="""(alarmConfigSpec) 更新告警配置请求参数 """, dest='alarmConfigSpec', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 更新告警配置 ''', + description=''' + 更新告警配置。 + + 示例: jdc ipanti modify-alarm-config --instance-id xxx --alarm-config-spec '{"":""}' + ''', + ) + def modify_alarm_config(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.ModifyAlarmConfigRequest import ModifyAlarmConfigRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyAlarmConfigRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询高防实例回源 IP 白名单列表 ''', description=''' - 查询转发规则的黑名单规则。 + 查询高防实例回源 IP 白名单列表。 - 示例: jdc ipanti describe-black-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx + 示例: jdc ipanti describe-origin-white-ip-list --instance-id xxx ''', ) - def describe_black_list_rule_of_forward_rule(self): + def describe_origin_white_ip_list(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeBlackListRuleOfForwardRuleRequest import DescribeBlackListRuleOfForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.DescribeOriginWhiteIpListRequest import DescribeOriginWhiteIpListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBlackListRuleOfForwardRuleRequest(params_dict, headers) + req = DescribeOriginWhiteIpListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -706,31 +2071,32 @@ def describe_black_list_rule_of_forward_rule(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), - (['--modify-spec'], dict(help="""(modifyBlackListRuleOfForwardRuleSpec) 修改转发规则的黑名单规则请求参数 """, dest='modifySpec', required=True)), + (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为 1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为 10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改转发规则的黑名单规则 ''', + help=''' 查询实例高防 IP 列表 ''', description=''' - 修改转发规则的黑名单规则。 + 查询实例高防 IP 列表。 - 示例: jdc ipanti modify-black-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx --modify-spec '{"":""}' + 示例: jdc ipanti describe-service-ip-list --instance-id xxx ''', ) - def modify_black_list_rule_of_forward_rule(self): + def describe_service_ip_list(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.ModifyBlackListRuleOfForwardRuleRequest import ModifyBlackListRuleOfForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.DescribeServiceIpListRequest import DescribeServiceIpListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyBlackListRuleOfForwardRuleRequest(params_dict, headers) + req = DescribeServiceIpListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -741,30 +2107,30 @@ def modify_black_list_rule_of_forward_rule(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), + (['--resource-id'], dict(help="""(string) 高防实例计费资源ID """, dest='resourceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启转发规则的黑名单规则 ''', + help=''' 根据高防计费资源ID查询对应的实例Id, 调用 createInstance 接口成功后,跟据message字段返回的计费资源Id查询对应的高防实例ID, 需要高防实例实际创建成功以后才可查询得到 ''', description=''' - 开启转发规则的黑名单规则。 + 根据高防计费资源ID查询对应的实例Id, 调用 createInstance 接口成功后,跟据message字段返回的计费资源Id查询对应的高防实例ID, 需要高防实例实际创建成功以后才可查询得到。 - 示例: jdc ipanti enable-black-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx + 示例: jdc ipanti describe-instance-id-by-resource-id --resource-id xxx ''', ) - def enable_black_list_rule_of_forward_rule(self): + def describe_instance_id_by_resource_id(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.EnableBlackListRuleOfForwardRuleRequest import EnableBlackListRuleOfForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.DescribeInstanceIdByResourceIdRequest import DescribeInstanceIdByResourceIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableBlackListRuleOfForwardRuleRequest(params_dict, headers) + req = DescribeInstanceIdByResourceIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -775,30 +2141,33 @@ def enable_black_list_rule_of_forward_rule(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), + (['--id'], dict(help="""(string) 高防实例 ID, 为空则查询所有实例名称 """, dest='id', required=False)), + (['--name'], dict(help="""(string) 实例名称, 可模糊匹配 """, dest='name', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为 1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为 10, 取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 关闭转发规则的黑名单规则 ''', + help=''' 查询高防实例名称列表 ''', description=''' - 关闭转发规则的黑名单规则。 + 查询高防实例名称列表。 - 示例: jdc ipanti disable-black-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx + 示例: jdc ipanti describe-name-list ''', ) - def disable_black_list_rule_of_forward_rule(self): + def describe_name_list(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DisableBlackListRuleOfForwardRuleRequest import DisableBlackListRuleOfForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.DescribeNameListRequest import DescribeNameListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisableBlackListRuleOfForwardRuleRequest(params_dict, headers) + req = DescribeNameListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -809,30 +2178,29 @@ def disable_black_list_rule_of_forward_rule(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询转发规则的白名单规则 ''', + help=''' 查询高防实例防护统计信息 ''', description=''' - 查询转发规则的白名单规则。 + 查询高防实例防护统计信息。 - 示例: jdc ipanti describe-white-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx + 示例: jdc ipanti describe-protection-statistics ''', ) - def describe_white_list_rule_of_forward_rule(self): + def describe_protection_statistics(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeWhiteListRuleOfForwardRuleRequest import DescribeWhiteListRuleOfForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.DescribeProtectionStatisticsRequest import DescribeProtectionStatisticsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeWhiteListRuleOfForwardRuleRequest(params_dict, headers) + req = DescribeProtectionStatisticsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -843,31 +2211,29 @@ def describe_white_list_rule_of_forward_rule(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), - (['--modify-spec'], dict(help="""(modifyWhiteListRuleOfForwardRuleSpec) 修改转发规则的黑名单规则请求参数 """, dest='modifySpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改转发规则的白名单规则 ''', + help=''' 查询高防实例防护概要 ''', description=''' - 修改转发规则的白名单规则。 + 查询高防实例防护概要。 - 示例: jdc ipanti modify-white-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx --modify-spec '{"":""}' + 示例: jdc ipanti describe-protection-outline ''', ) - def modify_white_list_rule_of_forward_rule(self): + def describe_protection_outline(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.ModifyWhiteListRuleOfForwardRuleRequest import ModifyWhiteListRuleOfForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.DescribeProtectionOutlineRequest import DescribeProtectionOutlineRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyWhiteListRuleOfForwardRuleRequest(params_dict, headers) + req = DescribeProtectionOutlineRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -878,30 +2244,30 @@ def modify_white_list_rule_of_forward_rule(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), + (['--name'], dict(help="""(string) 待检测实例名称 """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启转发规则的白名单规则 ''', + help=''' 检测实例名称是否合法 ''', description=''' - 开启转发规则的白名单规则。 + 检测实例名称是否合法。 - 示例: jdc ipanti enable-white-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx + 示例: jdc ipanti check-name --name xxx ''', ) - def enable_white_list_rule_of_forward_rule(self): + def check_name(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.EnableWhiteListRuleOfForwardRuleRequest import EnableWhiteListRuleOfForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.CheckNameRequest import CheckNameRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableWhiteListRuleOfForwardRuleRequest(params_dict, headers) + req = CheckNameRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -912,30 +2278,31 @@ def enable_white_list_rule_of_forward_rule(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--forward-rule-id'], dict(help="""(string) 转发规则 Id """, dest='forwardRuleId', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为 1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为 10, 取值范围 [0, 100], 0 表示全量 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 关闭转发规则的白名单规则 ''', + help=''' 查询用户可设置为网站类规则回源 IP 的京东云云内弹性公网 IP 资源 ''', description=''' - 关闭转发规则的白名单规则。 + 查询用户可设置为网站类规则回源 IP 的京东云云内弹性公网 IP 资源。 - 示例: jdc ipanti disable-white-list-rule-of-forward-rule --instance-id xxx --forward-rule-id xxx + 示例: jdc ipanti describe-vpc-ip-list ''', ) - def disable_white_list_rule_of_forward_rule(self): + def describe_vpc_ip_list(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DisableWhiteListRuleOfForwardRuleRequest import DisableWhiteListRuleOfForwardRuleRequest + from jdcloud_sdk.services.ipanti.apis.DescribeVpcIpListRequest import DescribeVpcIpListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisableWhiteListRuleOfForwardRuleRequest(params_dict, headers) + req = DescribeVpcIpListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -947,30 +2314,30 @@ def disable_white_list_rule_of_forward_rule(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码, 默认为 1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小, 默认为 10, 取值范围[10, 100], 0 表示全量 """, dest='pageSize', type=int, required=False)), - (['--name'], dict(help="""(string) 实例名称, 可模糊匹配 """, dest='name', required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为 10, 取值范围 [0, 100], 0 表示全量 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询实例列表 ''', + help=''' 查询用户可设置为网站类规则回源 IP 的京东云云物理服务器公网 IP 资源 ''', description=''' - 查询实例列表。 + 查询用户可设置为网站类规则回源 IP 的京东云云物理服务器公网 IP 资源。 - 示例: jdc ipanti describe-instances + 示例: jdc ipanti describe-cps-ip-list ''', ) - def describe_instances(self): + def describe_cps_ip_list(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeInstancesRequest import DescribeInstancesRequest + from jdcloud_sdk.services.ipanti.apis.DescribeCpsIpListRequest import DescribeCpsIpListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstancesRequest(params_dict, headers) + req = DescribeCpsIpListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -981,29 +2348,31 @@ def describe_instances(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--create-instance-spec'], dict(help="""(createInstanceSpec) 新购或升级实例请求参数 """, dest='createInstanceSpec', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为 1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为 10, 取值范围 [0, 100], 0 表示全量 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 新购或升级高防实例 ''', + help=''' 查询用户可设置为网站类规则回源 IP 的京东云托管区公网 IP 资源 ''', description=''' - 新购或升级高防实例。 + 查询用户可设置为网站类规则回源 IP 的京东云托管区公网 IP 资源。 - 示例: jdc ipanti create-instance --create-instance-spec '{"":""}' + 示例: jdc ipanti describe-ccs-ip-list ''', ) - def create_instance(self): + def describe_ccs_ip_list(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.CreateInstanceRequest import CreateInstanceRequest + from jdcloud_sdk.services.ipanti.apis.DescribeCcsIpListRequest import DescribeCcsIpListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateInstanceRequest(params_dict, headers) + req = DescribeCcsIpListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1014,29 +2383,32 @@ def create_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询实例 ''', + help=''' 查询实例的 IP 黑白名单库列表 ''', description=''' - 查询实例。 + 查询实例的 IP 黑白名单库列表。 - 示例: jdc ipanti describe-instance --instance-id xxx + 示例: jdc ipanti describe-ip-sets --instance-id xxx ''', ) - def describe_instance(self): + def describe_ip_sets(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeInstanceRequest import DescribeInstanceRequest + from jdcloud_sdk.services.ipanti.apis.DescribeIpSetsRequest import DescribeIpSetsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceRequest(params_dict, headers) + req = DescribeIpSetsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1047,30 +2419,31 @@ def describe_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), - (['--rename-instance-spec'], dict(help="""(renameInstanceSpec) 修改实例名称请求参数 """, dest='renameInstanceSpec', required=True)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--ip-set-spec'], dict(help="""(ipSetSpec) 添加实例的 IP 黑白名单请求参数 """, dest='ipSetSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改实例名称 ''', + help=''' 添加实例的 IP 黑白名单, 预定义的 IP 黑白名单绑定到转发规则的黑名单或白名单后生效 ''', description=''' - 修改实例名称。 + 添加实例的 IP 黑白名单, 预定义的 IP 黑白名单绑定到转发规则的黑名单或白名单后生效。 - 示例: jdc ipanti modify-instance-name --instance-id xxx --rename-instance-spec '{"":""}' + 示例: jdc ipanti create-ip-set --instance-id xxx --ip-set-spec '{"":""}' ''', ) - def modify_instance_name(self): + def create_ip_set(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.ModifyInstanceNameRequest import ModifyInstanceNameRequest + from jdcloud_sdk.services.ipanti.apis.CreateIpSetRequest import CreateIpSetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyInstanceNameRequest(params_dict, headers) + req = CreateIpSetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1081,30 +2454,31 @@ def modify_instance_name(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), - (['--modify-instance-epbspec'], dict(help="""(modifyInstanceEPBSpec) 修改实例名称请求参数 """, dest='modifyInstanceEPBSpec', required=True)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--ip-set-id'], dict(help="""(string) IP 黑白名单 Id """, dest='ipSetId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新实例弹性防护带宽 ''', + help=''' 查询实例的 IP 黑白名单 ''', description=''' - 更新实例弹性防护带宽。 + 查询实例的 IP 黑白名单。 - 示例: jdc ipanti modify-epb --instance-id xxx --modify-instance-epbspec '{"":""}' + 示例: jdc ipanti describe-ip-set --instance-id xxx --ip-set-id xxx ''', ) - def modify_epb(self): + def describe_ip_set(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.ModifyEPBRequest import ModifyEPBRequest + from jdcloud_sdk.services.ipanti.apis.DescribeIpSetRequest import DescribeIpSetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyEPBRequest(params_dict, headers) + req = DescribeIpSetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1115,29 +2489,31 @@ def modify_epb(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--ip-set-id'], dict(help="""(string) IP 黑白名单 Id """, dest='ipSetId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询告警配置 ''', + help=''' 删除实例的 IP 黑白名单. 支持批量操作, 批量操作时 ipSetId 传多个, 以 ',' 分隔. IP 黑白名单规则被引用时不允许删除 ''', description=''' - 查询告警配置。 + 删除实例的 IP 黑白名单. 支持批量操作, 批量操作时 ipSetId 传多个, 以 ',' 分隔. IP 黑白名单规则被引用时不允许删除。 - 示例: jdc ipanti describe-alarm-config --instance-id xxx + 示例: jdc ipanti delete-ip-set --instance-id xxx --ip-set-id xxx ''', ) - def describe_alarm_config(self): + def delete_ip_set(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeAlarmConfigRequest import DescribeAlarmConfigRequest + from jdcloud_sdk.services.ipanti.apis.DeleteIpSetRequest import DeleteIpSetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAlarmConfigRequest(params_dict, headers) + req = DeleteIpSetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1148,30 +2524,30 @@ def describe_alarm_config(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例 ID """, dest='instanceId', required=True)), - (['--alarm-config-spec'], dict(help="""(alarmConfigSpec) 更新告警配置请求参数 """, dest='alarmConfigSpec', required=True)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新告警配置 ''', + help=''' 查询实例的 IP 黑白名单用量信息 ''', description=''' - 更新告警配置。 + 查询实例的 IP 黑白名单用量信息。 - 示例: jdc ipanti modify-alarm-config --instance-id xxx --alarm-config-spec '{"":""}' + 示例: jdc ipanti describe-ip-set-usage --instance-id xxx ''', ) - def modify_alarm_config(self): + def describe_ip_set_usage(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.ModifyAlarmConfigRequest import ModifyAlarmConfigRequest + from jdcloud_sdk.services.ipanti.apis.DescribeIpSetUsageRequest import DescribeIpSetUsageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyAlarmConfigRequest(params_dict, headers) + req = DescribeIpSetUsageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1182,32 +2558,34 @@ def modify_alarm_config(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 高防实例 ID, 为空则查询所有实例名称 """, dest='id', required=False)), - (['--name'], dict(help="""(string) 实例名称, 可模糊匹配 """, dest='name', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为 1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小, 默认为 10, 取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--search-type'], dict(help="""(string) 查询类型名称, domain:源站域名, ip:源站 IP, rawDomain: 域名, serviceIp: 高防IP(仅支持BGP线路的实例) """, dest='searchType', required=False)), + (['--search-value'], dict(help="""(string) 查询类型值 """, dest='searchValue', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询高防实例名称列表 ''', + help=''' 查询某个实例下的网站类规则 ''', description=''' - 查询高防实例名称列表。 + 查询某个实例下的网站类规则。 - 示例: jdc ipanti describe-name-list + 示例: jdc ipanti describe-web-rules --instance-id xxx ''', ) - def describe_name_list(self): + def describe_web_rules(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeNameListRequest import DescribeNameListRequest + from jdcloud_sdk.services.ipanti.apis.DescribeWebRulesRequest import DescribeWebRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeNameListRequest(params_dict, headers) + req = DescribeWebRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1218,28 +2596,31 @@ def describe_name_list(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--web-rule-spec'], dict(help="""(webRuleSpec) 添加网站类规则请求参数 """, dest='webRuleSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询高防实例防护统计信息 ''', + help=''' 添加网站类规则 ''', description=''' - 查询高防实例防护统计信息。 + 添加网站类规则。 - 示例: jdc ipanti describe-protection-statistics + 示例: jdc ipanti create-web-rule --instance-id xxx --web-rule-spec '{"":""}' ''', ) - def describe_protection_statistics(self): + def create_web_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeProtectionStatisticsRequest import DescribeProtectionStatisticsRequest + from jdcloud_sdk.services.ipanti.apis.CreateWebRuleRequest import CreateWebRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeProtectionStatisticsRequest(params_dict, headers) + req = CreateWebRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1250,29 +2631,31 @@ def describe_protection_statistics(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) 待检测实例名称 """, dest='name', required=True)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--web-rule-spec-list'], dict(help="""(array: webRuleSpec) 批量添加网站类规则请求参数 """, dest='webRuleSpecList', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 检测实例名称是否合法 ''', + help=''' 批量添加网站类规则 ''', description=''' - 检测实例名称是否合法。 + 批量添加网站类规则。 - 示例: jdc ipanti check-name --name xxx + 示例: jdc ipanti create-web-rules --instance-id xxx --web-rule-spec-list ['{"":""}'] ''', ) - def check_name(self): + def create_web_rules(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.CheckNameRequest import CheckNameRequest + from jdcloud_sdk.services.ipanti.apis.CreateWebRulesRequest import CreateWebRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CheckNameRequest(params_dict, headers) + req = CreateWebRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1283,30 +2666,31 @@ def check_name(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为 1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小, 默认为 10, 取值范围 [0, 100], 0 表示全量 """, dest='pageSize', type=int, required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户可设置为网站类规则回源 IP 的京东云云内弹性公网 IP 资源 ''', + help=''' 查询网站类规则 ''', description=''' - 查询用户可设置为网站类规则回源 IP 的京东云云内弹性公网 IP 资源。 + 查询网站类规则。 - 示例: jdc ipanti describe-vpc-ip-list + 示例: jdc ipanti describe-web-rule --instance-id xxx --web-rule-id xxx ''', ) - def describe_vpc_ip_list(self): + def describe_web_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeVpcIpListRequest import DescribeVpcIpListRequest + from jdcloud_sdk.services.ipanti.apis.DescribeWebRuleRequest import DescribeWebRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeVpcIpListRequest(params_dict, headers) + req = DescribeWebRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1317,30 +2701,32 @@ def describe_vpc_ip_list(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为 1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小, 默认为 10, 取值范围 [0, 100], 0 表示全量 """, dest='pageSize', type=int, required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), + (['--web-rule-spec'], dict(help="""(webRuleSpec) 更新网站类规则请求参数 """, dest='webRuleSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户可设置为网站类规则回源 IP 的京东云云物理服务器公网 IP 资源 ''', + help=''' 修改网站类规则 ''', description=''' - 查询用户可设置为网站类规则回源 IP 的京东云云物理服务器公网 IP 资源。 + 修改网站类规则。 - 示例: jdc ipanti describe-cps-ip-list + 示例: jdc ipanti modify-web-rule --instance-id xxx --web-rule-id xxx --web-rule-spec '{"":""}' ''', ) - def describe_cps_ip_list(self): + def modify_web_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeCpsIpListRequest import DescribeCpsIpListRequest + from jdcloud_sdk.services.ipanti.apis.ModifyWebRuleRequest import ModifyWebRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCpsIpListRequest(params_dict, headers) + req = ModifyWebRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1352,30 +2738,30 @@ def describe_cps_ip_list(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询实例的 IP 黑白名单库列表 ''', + help=''' 删除网站规则。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', description=''' - 查询实例的 IP 黑白名单库列表。 + 删除网站规则。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 - 示例: jdc ipanti describe-ip-sets --instance-id xxx + 示例: jdc ipanti delete-web-rule --instance-id xxx --web-rule-id xxx ''', ) - def describe_ip_sets(self): + def delete_web_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeIpSetsRequest import DescribeIpSetsRequest + from jdcloud_sdk.services.ipanti.apis.DeleteWebRuleRequest import DeleteWebRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeIpSetsRequest(params_dict, headers) + req = DeleteWebRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1387,29 +2773,31 @@ def describe_ip_sets(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--ip-set-spec'], dict(help="""(ipSetSpec) 添加实例的 IP 黑白名单请求参数 """, dest='ipSetSpec', required=True)), + (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), + (['--cert-id'], dict(help="""(string) 证书 Id. 使用 describeCerts 接口, 按照域名检索可绑定的证书, 域名不匹配将导致证书配置失败 """, dest='certId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加实例的 IP 黑白名单, 预定义的 IP 黑白名单绑定到转发规则的黑名单或白名单后生效 ''', + help=''' 网站类规则绑定 SSL 证书 ''', description=''' - 添加实例的 IP 黑白名单, 预定义的 IP 黑白名单绑定到转发规则的黑名单或白名单后生效。 + 网站类规则绑定 SSL 证书。 - 示例: jdc ipanti create-ip-set --instance-id xxx --ip-set-spec '{"":""}' + 示例: jdc ipanti bind-cert --instance-id xxx --web-rule-id xxx --cert-id xxx ''', ) - def create_ip_set(self): + def bind_cert(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.CreateIpSetRequest import CreateIpSetRequest + from jdcloud_sdk.services.ipanti.apis.BindCertRequest import BindCertRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateIpSetRequest(params_dict, headers) + req = BindCertRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1421,29 +2809,30 @@ def create_ip_set(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--ip-set-id'], dict(help="""(string) IP 黑白名单 Id """, dest='ipSetId', required=True)), + (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询实例的 IP 黑白名单 ''', + help=''' 网站类规则切换成防御状态。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', description=''' - 查询实例的 IP 黑白名单。 + 网站类规则切换成防御状态。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 - 示例: jdc ipanti describe-ip-set --instance-id xxx --ip-set-id xxx + 示例: jdc ipanti switch-web-rule-protect --instance-id xxx --web-rule-id xxx ''', ) - def describe_ip_set(self): + def switch_web_rule_protect(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeIpSetRequest import DescribeIpSetRequest + from jdcloud_sdk.services.ipanti.apis.SwitchWebRuleProtectRequest import SwitchWebRuleProtectRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeIpSetRequest(params_dict, headers) + req = SwitchWebRuleProtectRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1455,29 +2844,30 @@ def describe_ip_set(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--ip-set-id'], dict(help="""(string) IP 黑白名单 Id """, dest='ipSetId', required=True)), + (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除实例的 IP 黑白名单. 支持批量操作, 批量操作时 ipSetId 传多个, 以 ',' 分隔. IP 黑白名单规则被引用时不允许删除 ''', + help=''' 网站类规则切换成回源状态。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', description=''' - 删除实例的 IP 黑白名单. 支持批量操作, 批量操作时 ipSetId 传多个, 以 ',' 分隔. IP 黑白名单规则被引用时不允许删除。 + 网站类规则切换成回源状态。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 - 示例: jdc ipanti delete-ip-set --instance-id xxx --ip-set-id xxx + 示例: jdc ipanti switch-web-rule-origin --instance-id xxx --web-rule-id xxx ''', ) - def delete_ip_set(self): + def switch_web_rule_origin(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DeleteIpSetRequest import DeleteIpSetRequest + from jdcloud_sdk.services.ipanti.apis.SwitchWebRuleOriginRequest import SwitchWebRuleOriginRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteIpSetRequest(params_dict, headers) + req = SwitchWebRuleOriginRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1489,28 +2879,30 @@ def delete_ip_set(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询实例的 IP 黑白名单用量信息 ''', + help=''' 网站类规则开启 CC 防护, 开启后网站类规则已配置的防护规则和 CC 防护配置生效, 若没有配置过 CC 防护, 默认的 CC 防护配置生效。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', description=''' - 查询实例的 IP 黑白名单用量信息。 + 网站类规则开启 CC 防护, 开启后网站类规则已配置的防护规则和 CC 防护配置生效, 若没有配置过 CC 防护, 默认的 CC 防护配置生效。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 - 示例: jdc ipanti describe-ip-set-usage --instance-id xxx + 示例: jdc ipanti enable-web-rule-cc --instance-id xxx --web-rule-id xxx ''', ) - def describe_ip_set_usage(self): + def enable_web_rule_cc(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeIpSetUsageRequest import DescribeIpSetUsageRequest + from jdcloud_sdk.services.ipanti.apis.EnableWebRuleCCRequest import EnableWebRuleCCRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeIpSetUsageRequest(params_dict, headers) + req = EnableWebRuleCCRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1522,32 +2914,30 @@ def describe_ip_set_usage(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--search-type'], dict(help="""(string) 查询类型名称, domain:源站域名, ip:源站 IP, rawDomain: 域名 """, dest='searchType', required=False)), - (['--search-value'], dict(help="""(string) 查询类型值 """, dest='searchValue', required=False)), + (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询某个实例下的网站类规则 ''', + help=''' 关闭网站类规则 CC 防护, 网站类规则的 CC 防护规则和 CC 防护配置失效。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', description=''' - 查询某个实例下的网站类规则。 + 关闭网站类规则 CC 防护, 网站类规则的 CC 防护规则和 CC 防护配置失效。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 - 示例: jdc ipanti describe-web-rules --instance-id xxx + 示例: jdc ipanti disable-web-rule-cc --instance-id xxx --web-rule-id xxx ''', ) - def describe_web_rules(self): + def disable_web_rule_cc(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeWebRulesRequest import DescribeWebRulesRequest + from jdcloud_sdk.services.ipanti.apis.DisableWebRuleCCRequest import DisableWebRuleCCRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeWebRulesRequest(params_dict, headers) + req = DisableWebRuleCCRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1559,29 +2949,30 @@ def describe_web_rules(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), - (['--web-rule-spec'], dict(help="""(webRuleSpec) 添加网站类规则请求参数 """, dest='webRuleSpec', required=True)), + (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加网站类规则 ''', + help=''' 开启网站类规则 CC 观察者模式, 观察模式下, CC 防护只告警不防御。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', description=''' - 添加网站类规则。 + 开启网站类规则 CC 观察者模式, 观察模式下, CC 防护只告警不防御。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 - 示例: jdc ipanti create-web-rule --instance-id xxx --web-rule-spec '{"":""}' + 示例: jdc ipanti enable-web-rule-ccobserver-mode --instance-id xxx --web-rule-id xxx ''', ) - def create_web_rule(self): + def enable_web_rule_ccobserver_mode(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.CreateWebRuleRequest import CreateWebRuleRequest + from jdcloud_sdk.services.ipanti.apis.EnableWebRuleCCObserverModeRequest import EnableWebRuleCCObserverModeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateWebRuleRequest(params_dict, headers) + req = EnableWebRuleCCObserverModeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1595,27 +2986,28 @@ def create_web_rule(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询网站类规则 ''', + help=''' 关闭网站类规则 CC 观察者模式, 观察模式下, CC 防护只告警不防御。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', description=''' - 查询网站类规则。 + 关闭网站类规则 CC 观察者模式, 观察模式下, CC 防护只告警不防御。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 - 示例: jdc ipanti describe-web-rule --instance-id xxx --web-rule-id xxx + 示例: jdc ipanti disable-web-rule-ccobserver-mode --instance-id xxx --web-rule-id xxx ''', ) - def describe_web_rule(self): + def disable_web_rule_ccobserver_mode(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DescribeWebRuleRequest import DescribeWebRuleRequest + from jdcloud_sdk.services.ipanti.apis.DisableWebRuleCCObserverModeRequest import DisableWebRuleCCObserverModeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeWebRuleRequest(params_dict, headers) + req = DisableWebRuleCCObserverModeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1628,29 +3020,31 @@ def describe_web_rule(self): (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), - (['--web-rule-spec'], dict(help="""(webRuleSpec) 更新网站类规则请求参数 """, dest='webRuleSpec', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改网站类规则 ''', + help=''' 查询网站类规则允许插入JS指纹的页面 ''', description=''' - 修改网站类规则。 + 查询网站类规则允许插入JS指纹的页面。 - 示例: jdc ipanti modify-web-rule --instance-id xxx --web-rule-id xxx --web-rule-spec '{"":""}' + 示例: jdc ipanti describe-js-pages-of-web-rule --instance-id xxx --web-rule-id xxx ''', ) - def modify_web_rule(self): + def describe_js_pages_of_web_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.ModifyWebRuleRequest import ModifyWebRuleRequest + from jdcloud_sdk.services.ipanti.apis.DescribeJsPagesOfWebRuleRequest import DescribeJsPagesOfWebRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyWebRuleRequest(params_dict, headers) + req = DescribeJsPagesOfWebRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1663,28 +3057,30 @@ def modify_web_rule(self): (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), + (['--js-page-spec'], dict(help="""(jsPageSpec) 添加 JS 指纹页面请求参数 """, dest='jsPageSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除网站规则。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', + help=''' 添加网站类规则允许插入JS指纹的页面 ''', description=''' - 删除网站规则。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 + 添加网站类规则允许插入JS指纹的页面。 - 示例: jdc ipanti delete-web-rule --instance-id xxx --web-rule-id xxx + 示例: jdc ipanti create-js-page-of-web-rule --instance-id xxx --web-rule-id xxx --js-page-spec '{"":""}' ''', ) - def delete_web_rule(self): + def create_js_page_of_web_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DeleteWebRuleRequest import DeleteWebRuleRequest + from jdcloud_sdk.services.ipanti.apis.CreateJsPageOfWebRuleRequest import CreateJsPageOfWebRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteWebRuleRequest(params_dict, headers) + req = CreateJsPageOfWebRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1697,29 +3093,30 @@ def delete_web_rule(self): (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), - (['--cert-id'], dict(help="""(string) 证书 Id. 使用 describeCerts 接口, 按照域名检索可绑定的证书, 域名不匹配将导致证书配置失败 """, dest='certId', required=True)), + (['--js-pages-spec'], dict(help="""(jsPagesSpec) 添加 JS 指纹页面请求参数 """, dest='jsPagesSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 网站类规则绑定 SSL 证书 ''', + help=''' 批量添加网站类规则允许插入JS指纹的页面 ''', description=''' - 网站类规则绑定 SSL 证书。 + 批量添加网站类规则允许插入JS指纹的页面。 - 示例: jdc ipanti bind-cert --instance-id xxx --web-rule-id xxx --cert-id xxx + 示例: jdc ipanti create-js-pages-of-web-rule --instance-id xxx --web-rule-id xxx --js-pages-spec '{"":""}' ''', ) - def bind_cert(self): + def create_js_pages_of_web_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.BindCertRequest import BindCertRequest + from jdcloud_sdk.services.ipanti.apis.CreateJsPagesOfWebRuleRequest import CreateJsPagesOfWebRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BindCertRequest(params_dict, headers) + req = CreateJsPagesOfWebRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1732,28 +3129,31 @@ def bind_cert(self): (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), + (['--js-page-id'], dict(help="""(string) 支持插入JS指纹的页面 Id """, dest='jsPageId', required=True)), + (['--js-page-spec'], dict(help="""(jsPageSpec) 修改网站类规则允许插入 JS 指纹的页面请求参数 """, dest='jsPageSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 网站类规则切换成防御状态 ''', + help=''' 修改网站类规则允许插入 JS 指纹的页面 ''', description=''' - 网站类规则切换成防御状态。 + 修改网站类规则允许插入 JS 指纹的页面。 - 示例: jdc ipanti switch-web-rule-protect --instance-id xxx --web-rule-id xxx + 示例: jdc ipanti modify-js-page-of-web-rule --instance-id xxx --web-rule-id xxx --js-page-id xxx --js-page-spec '{"":""}' ''', ) - def switch_web_rule_protect(self): + def modify_js_page_of_web_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.SwitchWebRuleProtectRequest import SwitchWebRuleProtectRequest + from jdcloud_sdk.services.ipanti.apis.ModifyJsPageOfWebRuleRequest import ModifyJsPageOfWebRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SwitchWebRuleProtectRequest(params_dict, headers) + req = ModifyJsPageOfWebRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1766,28 +3166,30 @@ def switch_web_rule_protect(self): (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), + (['--js-page-id'], dict(help="""(string) 支持插入JS指纹的页面 Id """, dest='jsPageId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 网站类规则切换成回源状态 ''', + help=''' 删除网站类规则允许插入 JS 指纹的页面。支持批量操作, 批量操作时 jsPageId 传多个, 以 ',' 分隔 ''', description=''' - 网站类规则切换成回源状态。 + 删除网站类规则允许插入 JS 指纹的页面。支持批量操作, 批量操作时 jsPageId 传多个, 以 ',' 分隔。 - 示例: jdc ipanti switch-web-rule-origin --instance-id xxx --web-rule-id xxx + 示例: jdc ipanti delete-js-page-of-web-rule --instance-id xxx --web-rule-id xxx --js-page-id xxx ''', ) - def switch_web_rule_origin(self): + def delete_js_page_of_web_rule(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.SwitchWebRuleOriginRequest import SwitchWebRuleOriginRequest + from jdcloud_sdk.services.ipanti.apis.DeleteJsPageOfWebRuleRequest import DeleteJsPageOfWebRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SwitchWebRuleOriginRequest(params_dict, headers) + req = DeleteJsPageOfWebRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1801,27 +3203,28 @@ def switch_web_rule_origin(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 网站类规则开启 CC 防护, 开启后网站类规则已配置的防护规则和 CC 防护配置生效, 若没有配置过 CC 防护, 默认的 CC 防护配置生效。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', + help=''' 关闭网站类规则的JS指纹开关 ''', description=''' - 网站类规则开启 CC 防护, 开启后网站类规则已配置的防护规则和 CC 防护配置生效, 若没有配置过 CC 防护, 默认的 CC 防护配置生效。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 + 关闭网站类规则的JS指纹开关。 - 示例: jdc ipanti enable-web-rule-cc --instance-id xxx --web-rule-id xxx + 示例: jdc ipanti disable-web-rule-js-page --instance-id xxx --web-rule-id xxx ''', ) - def enable_web_rule_cc(self): + def disable_web_rule_js_page(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.EnableWebRuleCCRequest import EnableWebRuleCCRequest + from jdcloud_sdk.services.ipanti.apis.DisableWebRuleJsPageRequest import DisableWebRuleJsPageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableWebRuleCCRequest(params_dict, headers) + req = DisableWebRuleJsPageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1835,27 +3238,28 @@ def enable_web_rule_cc(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 关闭网站类规则 CC 防护, 网站类规则的 CC 防护规则和 CC 防护配置失效。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', + help=''' 打开网站类规则的JS指纹开关 ''', description=''' - 关闭网站类规则 CC 防护, 网站类规则的 CC 防护规则和 CC 防护配置失效。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 + 打开网站类规则的JS指纹开关。 - 示例: jdc ipanti disable-web-rule-cc --instance-id xxx --web-rule-id xxx + 示例: jdc ipanti enable-web-rule-js-page --instance-id xxx --web-rule-id xxx ''', ) - def disable_web_rule_cc(self): + def enable_web_rule_js_page(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DisableWebRuleCCRequest import DisableWebRuleCCRequest + from jdcloud_sdk.services.ipanti.apis.EnableWebRuleJsPageRequest import EnableWebRuleJsPageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisableWebRuleCCRequest(params_dict, headers) + req = EnableWebRuleJsPageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1869,27 +3273,28 @@ def disable_web_rule_cc(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启网站类规则 CC 观察者模式, 观察模式下, CC 防护只告警不防御。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', + help=''' 插入JS指纹到所有页面, 需要打开网站类规则的JS指纹开关 ''', description=''' - 开启网站类规则 CC 观察者模式, 观察模式下, CC 防护只告警不防御。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 + 插入JS指纹到所有页面, 需要打开网站类规则的JS指纹开关。 - 示例: jdc ipanti enable-web-rule-ccobserver-mode --instance-id xxx --web-rule-id xxx + 示例: jdc ipanti modify-web-rule-js-page-to-all --instance-id xxx --web-rule-id xxx ''', ) - def enable_web_rule_ccobserver_mode(self): + def modify_web_rule_js_page_to_all(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.EnableWebRuleCCObserverModeRequest import EnableWebRuleCCObserverModeRequest + from jdcloud_sdk.services.ipanti.apis.ModifyWebRuleJsPageToAllRequest import ModifyWebRuleJsPageToAllRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableWebRuleCCObserverModeRequest(params_dict, headers) + req = ModifyWebRuleJsPageToAllRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1903,27 +3308,28 @@ def enable_web_rule_ccobserver_mode(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 关闭网站类规则 CC 观察者模式, 观察模式下, CC 防护只告警不防御。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败 ''', + help=''' 插入JS指纹到配置的自定义页面, 需要打开网站类规则的JS指纹开关 ''', description=''' - 关闭网站类规则 CC 观察者模式, 观察模式下, CC 防护只告警不防御。支持批量操作, 批量操作时 webRuleId 传多个, 以 ',' 分隔, 返回 result.code 为 1 表示操作成功, 为 0 时可能全部失败, 也可能部分失败。 + 插入JS指纹到配置的自定义页面, 需要打开网站类规则的JS指纹开关。 - 示例: jdc ipanti disable-web-rule-ccobserver-mode --instance-id xxx --web-rule-id xxx + 示例: jdc ipanti modify-web-rule-js-page-to-custom --instance-id xxx --web-rule-id xxx ''', ) - def disable_web_rule_ccobserver_mode(self): + def modify_web_rule_js_page_to_custom(self): client_factory = ClientFactory('ipanti') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.ipanti.apis.DisableWebRuleCCObserverModeRequest import DisableWebRuleCCObserverModeRequest + from jdcloud_sdk.services.ipanti.apis.ModifyWebRuleJsPageToCustomRequest import ModifyWebRuleJsPageToCustomRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisableWebRuleCCObserverModeRequest(params_dict, headers) + req = ModifyWebRuleJsPageToCustomRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1937,6 +3343,7 @@ def disable_web_rule_ccobserver_mode(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1972,6 +3379,7 @@ def describe_ccprotection_rules_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--cc-protection-rule-spec'], dict(help="""(cCProtectionRuleSpec) 添加 CC 防护规则请求参数 """, dest='ccProtectionRuleSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2007,6 +3415,7 @@ def create_ccprotection_rule_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--cc-protection-rule-id'], dict(help="""(string) 网站类规则的 CC 防护规则 Id """, dest='ccProtectionRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2043,6 +3452,7 @@ def describe_ccprotection_rule_of_web_rule(self): (['--cc-protection-rule-id'], dict(help="""(string) 网站类规则的 CC 防护规则 Id """, dest='ccProtectionRuleId', required=True)), (['--cc-protection-rule-spec'], dict(help="""(cCProtectionRuleSpec) 修改 CC 防护规则请求参数 """, dest='ccProtectionRuleSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2078,6 +3488,7 @@ def modify_ccprotection_rule_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--cc-protection-rule-id'], dict(help="""(string) 网站类规则的 CC 防护规则 Id """, dest='ccProtectionRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2113,6 +3524,7 @@ def delete_ccprotection_rule_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--cc-protection-rule-id'], dict(help="""(string) 网站类规则的 CC 防护规则 Id """, dest='ccProtectionRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2148,6 +3560,7 @@ def enable_ccprotection_rule_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--cc-protection-rule-id'], dict(help="""(string) 网站类规则的 CC 防护规则 Id """, dest='ccProtectionRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2182,6 +3595,77 @@ def disable_ccprotection_rule_of_web_rule(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 开启网站类规则的自定义 CC 防护规则总开关, 状态为开启的自定义 CC 防护规则生效 ''', + description=''' + 开启网站类规则的自定义 CC 防护规则总开关, 状态为开启的自定义 CC 防护规则生效。 + + 示例: jdc ipanti enable-web-rule-ccprotection-rule --instance-id xxx --web-rule-id xxx + ''', + ) + def enable_web_rule_ccprotection_rule(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.EnableWebRuleCCProtectionRuleRequest import EnableWebRuleCCProtectionRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = EnableWebRuleCCProtectionRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 关闭网站类规则的自定义 CC 防护规则总开关, 所有自定义 CC 防护规则失效 ''', + description=''' + 关闭网站类规则的自定义 CC 防护规则总开关, 所有自定义 CC 防护规则失效。 + + 示例: jdc ipanti disable-web-rule-ccprotection-rule --instance-id xxx --web-rule-id xxx + ''', + ) + def disable_web_rule_ccprotection_rule(self): + client_factory = ClientFactory('ipanti') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ipanti.apis.DisableWebRuleCCProtectionRuleRequest import DisableWebRuleCCProtectionRuleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DisableWebRuleCCProtectionRuleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), + (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2217,6 +3701,7 @@ def describe_ccprotection_config_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--cc-protection-config-spec'], dict(help="""(cCProtectionConfigSpec) 修改 CC 防护配置请求参数 """, dest='ccProtectionConfigSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2251,6 +3736,7 @@ def modify_ccprotection_config_of_web_rule(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2286,6 +3772,7 @@ def describe_ccprotection_default_config_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--cert-info-modify-spec'], dict(help="""(certInfoModifySpec) 编辑网站规则证书信息请求参数 """, dest='certInfoModifySpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2320,6 +3807,7 @@ def modify_cert_info(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2356,6 +3844,7 @@ def describe_web_rule_black_list_usage(self): (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2391,6 +3880,7 @@ def describe_black_list_rules_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--web-black-list-rule-spec'], dict(help="""(webBlackListRuleSpec) 添加网站类规则的黑名单规则请求参数 """, dest='webBlackListRuleSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2426,6 +3916,7 @@ def create_black_list_rule_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--web-black-list-rule-id'], dict(help="""(string) 网站类规则的黑名单规则 Id """, dest='webBlackListRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2462,6 +3953,7 @@ def describe_black_list_rule_of_web_rule(self): (['--web-black-list-rule-id'], dict(help="""(string) 网站类规则的黑名单规则 Id """, dest='webBlackListRuleId', required=True)), (['--web-black-list-rule-spec'], dict(help="""(webBlackListRuleSpec) 修改网站类规则的黑名单规则请求参数 """, dest='webBlackListRuleSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2497,6 +3989,7 @@ def modify_black_list_rule_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--web-black-list-rule-id'], dict(help="""(string) 网站类规则的黑名单规则 Id """, dest='webBlackListRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2531,6 +4024,7 @@ def delete_black_list_rule_of_web_rule(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2566,6 +4060,7 @@ def enable_web_rule_black_list(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--web-black-list-rule-id'], dict(help="""(string) 网站类规则的黑名单规则 Id """, dest='webBlackListRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2600,6 +4095,7 @@ def enable_black_list_rule_of_web_rule(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2635,6 +4131,7 @@ def disable_web_rule_black_list(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--web-black-list-rule-id'], dict(help="""(string) 网站类规则的黑名单规则 Id """, dest='webBlackListRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2669,6 +4166,7 @@ def disable_black_list_rule_of_web_rule(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2705,6 +4203,7 @@ def describe_web_rule_white_list_usage(self): (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小, 默认为10, 取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2740,6 +4239,7 @@ def describe_white_list_rules_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--web-white-list-rule-spec'], dict(help="""(webWhiteListRuleSpec) 添加网站类规则的白名单规则请求参数 """, dest='webWhiteListRuleSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2775,6 +4275,7 @@ def create_white_list_rule_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--web-white-list-rule-id'], dict(help="""(string) 网站类规则的白名单规则 Id """, dest='webWhiteListRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2811,6 +4312,7 @@ def describe_white_list_rule_of_web_rule(self): (['--web-white-list-rule-id'], dict(help="""(string) 网站类规则的白名单规则 Id """, dest='webWhiteListRuleId', required=True)), (['--web-white-list-rule-spec'], dict(help="""(webWhiteListRuleSpec) 修改网站类规则的白名单规则请求参数 """, dest='webWhiteListRuleSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2846,6 +4348,7 @@ def modify_white_list_rule_of_web_rule(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--web-white-list-rule-id'], dict(help="""(string) 网站类规则的白名单规则 Id """, dest='webWhiteListRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2880,6 +4383,7 @@ def delete_white_list_rule_of_web_rule(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2915,6 +4419,7 @@ def enable_web_rule_white_list(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--web-white-list-rule-id'], dict(help="""(string) 网站类规则的白名单规则 Id """, dest='webWhiteListRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2949,6 +4454,7 @@ def enable_white_list_rule_of_web_rule(self): (['--instance-id'], dict(help="""(string) 高防实例 Id """, dest='instanceId', required=True)), (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2984,6 +4490,7 @@ def disable_web_rule_white_list(self): (['--web-rule-id'], dict(help="""(string) 网站规则 Id """, dest='webRuleId', required=True)), (['--web-white-list-rule-id'], dict(help="""(string) 网站类规则的白名单规则 Id """, dest='webWhiteListRuleId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -3016,6 +4523,7 @@ def disable_white_list_rule_of_web_rule(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -3048,6 +4556,7 @@ def describe_web_rule_black_list_geo_areas(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -3080,6 +4589,7 @@ def describe_web_rule_white_list_geo_areas(self): arguments=[ (['--region-id'], dict(help="""(string) 区域 ID, 高防不区分区域, 传 cn-north-1 即可 """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -3110,7 +4620,7 @@ def describe_web_rule_rsgeo_areas(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-ddo-sattack-logs','describe-ccattack-logs','describe-ccattack-log-details','describe-attack-statistics','describe-attack-type-count','describe-ddo-sgraph','describe-fwd-graph','describe-ccgraph','describe-forward-rules','create-forward-rule','describe-forward-rule','modify-forward-rule','delete-forward-rule','switch-forward-rule-protect','switch-forward-rule-origin','describe-protection-rule-of-forward-rule','modify-protection-rule-of-forward-rule','describe-geo-areas','describe-black-list-rule-of-forward-rule','modify-black-list-rule-of-forward-rule','enable-black-list-rule-of-forward-rule','disable-black-list-rule-of-forward-rule','describe-white-list-rule-of-forward-rule','modify-white-list-rule-of-forward-rule','enable-white-list-rule-of-forward-rule','disable-white-list-rule-of-forward-rule','describe-instances','create-instance','describe-instance','modify-instance-name','modify-epb','describe-alarm-config','modify-alarm-config','describe-name-list','describe-protection-statistics','check-name','describe-vpc-ip-list','describe-cps-ip-list','describe-ip-sets','create-ip-set','describe-ip-set','delete-ip-set','describe-ip-set-usage','describe-web-rules','create-web-rule','describe-web-rule','modify-web-rule','delete-web-rule','bind-cert','switch-web-rule-protect','switch-web-rule-origin','enable-web-rule-cc','disable-web-rule-cc','enable-web-rule-ccobserver-mode','disable-web-rule-ccobserver-mode','describe-ccprotection-rules-of-web-rule','create-ccprotection-rule-of-web-rule','describe-ccprotection-rule-of-web-rule','modify-ccprotection-rule-of-web-rule','delete-ccprotection-rule-of-web-rule','enable-ccprotection-rule-of-web-rule','disable-ccprotection-rule-of-web-rule','describe-ccprotection-config-of-web-rule','modify-ccprotection-config-of-web-rule','describe-ccprotection-default-config-of-web-rule','modify-cert-info','describe-web-rule-black-list-usage','describe-black-list-rules-of-web-rule','create-black-list-rule-of-web-rule','describe-black-list-rule-of-web-rule','modify-black-list-rule-of-web-rule','delete-black-list-rule-of-web-rule','enable-web-rule-black-list','enable-black-list-rule-of-web-rule','disable-web-rule-black-list','disable-black-list-rule-of-web-rule','describe-web-rule-white-list-usage','describe-white-list-rules-of-web-rule','create-white-list-rule-of-web-rule','describe-white-list-rule-of-web-rule','modify-white-list-rule-of-web-rule','delete-white-list-rule-of-web-rule','enable-web-rule-white-list','enable-white-list-rule-of-web-rule','disable-web-rule-white-list','disable-white-list-rule-of-web-rule','describe-web-rule-black-list-geo-areas','describe-web-rule-white-list-geo-areas','describe-web-rule-rsgeo-areas',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-forward-rules','create-forward-rule','create-forward-rules','describe-forward-rule','modify-forward-rule','delete-forward-rule','switch-forward-rule-protect','switch-forward-rule-origin','describe-protection-rule-of-forward-rule','modify-protection-rule-of-forward-rule','describe-geo-areas','describe-black-list-rule-of-forward-rule','modify-black-list-rule-of-forward-rule','enable-black-list-rule-of-forward-rule','disable-black-list-rule-of-forward-rule','describe-white-list-rule-of-forward-rule','modify-white-list-rule-of-forward-rule','enable-white-list-rule-of-forward-rule','disable-white-list-rule-of-forward-rule','describe-ddo-sgraph','describe-fwd-graph','describe-business-graph','describe-ccgraph','describe-status-graph','describe-conn-stat-graph','describe-ddo-sattack-logs','describe-ddo-sip-attack-logs','describe-ccattack-logs','describe-ccattack-log-details','describe-attack-statistics','describe-attack-type-count','describe-dispatch-rules','create-dispatch-rule','create-dispatch-rules','modify-dispatch-rule','delete-dispatch-rule','switch-dispatch-rule-protect','switch-dispatch-rule-origin','describe-instance-acl','modify-instance-acl','recover-instance-acl','describe-custom-pages','create-custom-page','modify-custom-page','delete-custom-page','modify-instance-custom-page','modify-instance-custom-page-default','enable-instance-custom-page','disable-instance-custom-page','describe-instances','create-instance','describe-instance','modify-instance-name','modify-epb','describe-alarm-config','modify-alarm-config','describe-origin-white-ip-list','describe-service-ip-list','describe-instance-id-by-resource-id','describe-name-list','describe-protection-statistics','describe-protection-outline','check-name','describe-vpc-ip-list','describe-cps-ip-list','describe-ccs-ip-list','describe-ip-sets','create-ip-set','describe-ip-set','delete-ip-set','describe-ip-set-usage','describe-web-rules','create-web-rule','create-web-rules','describe-web-rule','modify-web-rule','delete-web-rule','bind-cert','switch-web-rule-protect','switch-web-rule-origin','enable-web-rule-cc','disable-web-rule-cc','enable-web-rule-ccobserver-mode','disable-web-rule-ccobserver-mode','describe-js-pages-of-web-rule','create-js-page-of-web-rule','create-js-pages-of-web-rule','modify-js-page-of-web-rule','delete-js-page-of-web-rule','disable-web-rule-js-page','enable-web-rule-js-page','modify-web-rule-js-page-to-all','modify-web-rule-js-page-to-custom','describe-ccprotection-rules-of-web-rule','create-ccprotection-rule-of-web-rule','describe-ccprotection-rule-of-web-rule','modify-ccprotection-rule-of-web-rule','delete-ccprotection-rule-of-web-rule','enable-ccprotection-rule-of-web-rule','disable-ccprotection-rule-of-web-rule','enable-web-rule-ccprotection-rule','disable-web-rule-ccprotection-rule','describe-ccprotection-config-of-web-rule','modify-ccprotection-config-of-web-rule','describe-ccprotection-default-config-of-web-rule','modify-cert-info','describe-web-rule-black-list-usage','describe-black-list-rules-of-web-rule','create-black-list-rule-of-web-rule','describe-black-list-rule-of-web-rule','modify-black-list-rule-of-web-rule','delete-black-list-rule-of-web-rule','enable-web-rule-black-list','enable-black-list-rule-of-web-rule','disable-web-rule-black-list','disable-black-list-rule-of-web-rule','describe-web-rule-white-list-usage','describe-white-list-rules-of-web-rule','create-white-list-rule-of-web-rule','describe-white-list-rule-of-web-rule','modify-white-list-rule-of-web-rule','delete-white-list-rule-of-web-rule','enable-web-rule-white-list','enable-white-list-rule-of-web-rule','disable-web-rule-white-list','disable-white-list-rule-of-web-rule','describe-web-rule-black-list-geo-areas','describe-web-rule-white-list-geo-areas','describe-web-rule-rsgeo-areas',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/jcq.py b/jdcloud_cli/controllers/services/jcq.py index cae2c5e..8b85234 100644 --- a/jdcloud_cli/controllers/services/jcq.py +++ b/jdcloud_cli/controllers/services/jcq.py @@ -41,6 +41,7 @@ class Meta: (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -72,28 +73,33 @@ def describe_access_point(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), + (['--topic-filter'], dict(help="""(string) topic名称的过滤条件,大小写不敏感 """, dest='topicFilter', required=False)), + (['--tag-filters'], dict(help="""(array: tagFilter) 标签过滤条件 """, dest='tagFilters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' consumerGroupId列表 ''', + help=''' 查询topic列表 ''', description=''' - consumerGroupId列表。 + 查询topic列表。 - 示例: jdc jcq describe-consumer-group-ids + 示例: jdc jcq describe-topics ''', ) - def describe_consumer_group_ids(self): + def describe_topics(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.DescribeConsumerGroupIdsRequest import DescribeConsumerGroupIdsRequest + from jdcloud_sdk.services.jcq.apis.DescribeTopicsRequest import DescribeTopicsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeConsumerGroupIdsRequest(params_dict, headers) + req = DescribeTopicsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -104,31 +110,32 @@ def describe_consumer_group_ids(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), - (['--consumer-group-id'], dict(help="""(string) consumerGroupId为空则显示该用户所有订阅关系里的死信数量 """, dest='consumerGroupId', required=False)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--topic-name'], dict(help="""(string) topic名称 """, dest='topicName', required=True)), + (['--type'], dict(help="""(string) 类型,[normal,global_order] """, dest='type', required=True)), + (['--description'], dict(help="""(string) 描述,长度不大于255 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 死信消息数(按照用户或者consumerGroupId) ''', + help=''' 创建一个指定名称的topic ''', description=''' - 死信消息数(按照用户或者consumerGroupId)。 + 创建一个指定名称的topic。 - 示例: jdc jcq describe-dead-letter-numbers + 示例: jdc jcq create-topic --topic-name xxx --type xxx ''', ) - def describe_dead_letter_numbers(self): + def create_topic(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.DescribeDeadLetterNumbersRequest import DescribeDeadLetterNumbersRequest + from jdcloud_sdk.services.jcq.apis.CreateTopicRequest import CreateTopicRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDeadLetterNumbersRequest(params_dict, headers) + req = CreateTopicRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -140,31 +147,29 @@ def describe_dead_letter_numbers(self): arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), - (['--consumer-group-id'], dict(help="""(string) consumerGroupId为空则显示该Topic下所有订阅关系里的死信数量 """, dest='consumerGroupId', required=False)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 死信消息数 ''', + help=''' 查询topic详情 ''', description=''' - 死信消息数。 + 查询topic详情。 - 示例: jdc jcq describe-dead-letter-numbers-with-topic --topic-name xxx + 示例: jdc jcq describe-topic --topic-name xxx ''', ) - def describe_dead_letter_numbers_with_topic(self): + def describe_topic(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.DescribeDeadLetterNumbersWithTopicRequest import DescribeDeadLetterNumbersWithTopicRequest + from jdcloud_sdk.services.jcq.apis.DescribeTopicRequest import DescribeTopicRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDeadLetterNumbersWithTopicRequest(params_dict, headers) + req = DescribeTopicRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -176,33 +181,29 @@ def describe_dead_letter_numbers_with_topic(self): arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), - (['--consumer-group-id'], dict(help="""(string) consumerGroupId """, dest='consumerGroupId', required=True)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--start-time'], dict(help="""(string) 开始时间 """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间 """, dest='endTime', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 死信队列列表 ''', + help=''' 删除单个topic ''', description=''' - 死信队列列表。 + 删除单个topic。 - 示例: jdc jcq list-dead-letters --topic-name xxx --consumer-group-id xxx --start-time xxx --end-time xxx + 示例: jdc jcq delete-topic --topic-name xxx ''', ) - def list_dead_letters(self): + def delete_topic(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.ListDeadLettersRequest import ListDeadLettersRequest + from jdcloud_sdk.services.jcq.apis.DeleteTopicRequest import DeleteTopicRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListDeadLettersRequest(params_dict, headers) + req = DeleteTopicRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -213,31 +214,32 @@ def list_dead_letters(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), - (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), - (['--consumer-group-id'], dict(help="""(string) consumerGroupId """, dest='consumerGroupId', required=True)), - (['--message-ids'], dict(help="""(string) messageIds,多个逗号隔开,不传该值就是删除所有的死信 """, dest='messageIds', required=False)), + (['--consumer-group-id'], dict(help="""(string) consumerGroupId为空则显示该用户所有订阅关系里的死信数量 """, dest='consumerGroupId', required=False)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除死信消息 ''', + help=''' 死信消息数(按照用户或者consumerGroupId) ''', description=''' - 删除死信消息。 + 死信消息数(按照用户或者consumerGroupId)。 - 示例: jdc jcq delete-dead-letters --topic-name xxx --consumer-group-id xxx + 示例: jdc jcq describe-dead-letter-numbers ''', ) - def delete_dead_letters(self): + def describe_dead_letter_numbers(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.DeleteDeadLettersRequest import DeleteDeadLettersRequest + from jdcloud_sdk.services.jcq.apis.DescribeDeadLetterNumbersRequest import DescribeDeadLetterNumbersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteDeadLettersRequest(params_dict, headers) + req = DescribeDeadLetterNumbersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -249,30 +251,32 @@ def delete_dead_letters(self): arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), - (['--consumer-group-id'], dict(help="""(string) consumerGroupId """, dest='consumerGroupId', required=True)), - (['--message-ids'], dict(help="""(string) messageIds,多个逗号隔开,不传该值就是重发所有死信 """, dest='messageIds', required=False)), + (['--consumer-group-id'], dict(help="""(string) consumerGroupId为空则显示该Topic下所有订阅关系里的死信数量 """, dest='consumerGroupId', required=False)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 重发死信消息 ''', + help=''' 死信消息数 ''', description=''' - 重发死信消息。 + 死信消息数。 - 示例: jdc jcq resend-dead-letters --topic-name xxx --consumer-group-id xxx + 示例: jdc jcq describe-dead-letter-numbers-with-topic --topic-name xxx ''', ) - def resend_dead_letters(self): + def describe_dead_letter_numbers_with_topic(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.ResendDeadLettersRequest import ResendDeadLettersRequest + from jdcloud_sdk.services.jcq.apis.DescribeDeadLetterNumbersWithTopicRequest import DescribeDeadLetterNumbersWithTopicRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ResendDeadLettersRequest(params_dict, headers) + req = DescribeDeadLetterNumbersWithTopicRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -284,32 +288,34 @@ def resend_dead_letters(self): arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), + (['--consumer-group-id'], dict(help="""(string) consumerGroupId """, dest='consumerGroupId', required=True)), + (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--start-time'], dict(help="""(string) 开始时间 """, dest='startTime', required=True)), (['--end-time'], dict(help="""(string) 结束时间 """, dest='endTime', required=True)), - (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 消息列表 ''', + help=''' 死信队列列表 ''', description=''' - 消息列表。 + 死信队列列表。 - 示例: jdc jcq describe-messages --topic-name xxx --start-time xxx --end-time xxx + 示例: jdc jcq list-dead-letters --topic-name xxx --consumer-group-id xxx --start-time xxx --end-time xxx ''', ) - def describe_messages(self): + def list_dead_letters(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.DescribeMessagesRequest import DescribeMessagesRequest + from jdcloud_sdk.services.jcq.apis.ListDeadLettersRequest import ListDeadLettersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeMessagesRequest(params_dict, headers) + req = ListDeadLettersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -321,29 +327,31 @@ def describe_messages(self): arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), - (['--message-id'], dict(help="""(string) message Id """, dest='messageId', required=True)), + (['--consumer-group-id'], dict(help="""(string) consumerGroupId """, dest='consumerGroupId', required=True)), + (['--message-ids'], dict(help="""(string) messageIds,多个逗号隔开,不传该值就是删除所有的死信 """, dest='messageIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询message详情 ''', + help=''' 删除死信消息 ''', description=''' - 查询message详情。 + 删除死信消息。 - 示例: jdc jcq describe-message --topic-name xxx --message-id xxx + 示例: jdc jcq delete-dead-letters --topic-name xxx --consumer-group-id xxx ''', ) - def describe_message(self): + def delete_dead_letters(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.DescribeMessageRequest import DescribeMessageRequest + from jdcloud_sdk.services.jcq.apis.DeleteDeadLettersRequest import DeleteDeadLettersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeMessageRequest(params_dict, headers) + req = DeleteDeadLettersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -355,29 +363,31 @@ def describe_message(self): arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), - (['--message-id'], dict(help="""(string) message Id """, dest='messageId', required=True)), + (['--consumer-group-id'], dict(help="""(string) consumerGroupId """, dest='consumerGroupId', required=True)), + (['--message-ids'], dict(help="""(string) messageIds,多个逗号隔开,不传该值就是重发所有死信 """, dest='messageIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询消息轨迹 ''', + help=''' 重发死信消息 ''', description=''' - 查询消息轨迹。 + 重发死信消息。 - 示例: jdc jcq describe-message-trace --topic-name xxx --message-id xxx + 示例: jdc jcq resend-dead-letters --topic-name xxx --consumer-group-id xxx ''', ) - def describe_message_trace(self): + def resend_dead_letters(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.DescribeMessageTraceRequest import DescribeMessageTraceRequest + from jdcloud_sdk.services.jcq.apis.ResendDeadLettersRequest import ResendDeadLettersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeMessageTraceRequest(params_dict, headers) + req = ResendDeadLettersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -389,29 +399,29 @@ def describe_message_trace(self): arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), - (['--business-id'], dict(help="""(string) business id """, dest='businessId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据businessId查询消息 ''', + help=''' 查看当前topic授予了哪些用户哪些权限 ''', description=''' - 根据businessId查询消息。 + 查看当前topic授予了哪些用户哪些权限。 - 示例: jdc jcq describe-messages-by-business-id --topic-name xxx --business-id xxx + 示例: jdc jcq describe-permission --topic-name xxx ''', ) - def describe_messages_by_business_id(self): + def describe_permission(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.DescribeMessagesByBusinessIdRequest import DescribeMessagesByBusinessIdRequest + from jdcloud_sdk.services.jcq.apis.DescribePermissionRequest import DescribePermissionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeMessagesByBusinessIdRequest(params_dict, headers) + req = DescribePermissionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -423,28 +433,31 @@ def describe_messages_by_business_id(self): arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), + (['--permission'], dict(help="""(string) 权限类型,[PUB,SUB,PUBSUB] """, dest='permission', required=True)), + (['--target-user-id'], dict(help="""(string) 目标用户UserId """, dest='targetUserId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看当前topic授予了哪些用户哪些权限 ''', + help=''' 对当前topic授予目标用户特定权限 ''', description=''' - 查看当前topic授予了哪些用户哪些权限。 + 对当前topic授予目标用户特定权限。 - 示例: jdc jcq describe-permission --topic-name xxx + 示例: jdc jcq add-permission --topic-name xxx --permission xxx --target-user-id xxx ''', ) - def describe_permission(self): + def add_permission(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.DescribePermissionRequest import DescribePermissionRequest + from jdcloud_sdk.services.jcq.apis.AddPermissionRequest import AddPermissionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribePermissionRequest(params_dict, headers) + req = AddPermissionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -456,30 +469,31 @@ def describe_permission(self): arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), - (['--permission'], dict(help="""(string) 权限类型,[PUB,SUB,PUBSUB] """, dest='permission', required=True)), + (['--permission'], dict(help="""(string) 权限类型, [PUB, SUB, PUBSUB] """, dest='permission', required=True)), (['--target-user-id'], dict(help="""(string) 目标用户UserId """, dest='targetUserId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 对当前topic授予目标用户特定权限 ''', + help=''' 删除当前topic对目标用户授权的权限 ''', description=''' - 对当前topic授予目标用户特定权限。 + 删除当前topic对目标用户授权的权限。 - 示例: jdc jcq add-permission --topic-name xxx --permission xxx --target-user-id xxx + 示例: jdc jcq remove-permission --topic-name xxx --permission xxx --target-user-id xxx ''', ) - def add_permission(self): + def remove_permission(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.AddPermissionRequest import AddPermissionRequest + from jdcloud_sdk.services.jcq.apis.RemovePermissionRequest import RemovePermissionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddPermissionRequest(params_dict, headers) + req = RemovePermissionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -490,31 +504,29 @@ def add_permission(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), - (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), - (['--permission'], dict(help="""(string) 权限类型, [PUB, SUB, PUBSUB] """, dest='permission', required=True)), - (['--target-user-id'], dict(help="""(string) 目标用户UserId """, dest='targetUserId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除当前topic对目标用户授权的权限 ''', + help=''' consumerGroupId列表 ''', description=''' - 删除当前topic对目标用户授权的权限。 + consumerGroupId列表。 - 示例: jdc jcq remove-permission --topic-name xxx --permission xxx --target-user-id xxx + 示例: jdc jcq describe-consumer-group-ids ''', ) - def remove_permission(self): + def describe_consumer_group_ids(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.RemovePermissionRequest import RemovePermissionRequest + from jdcloud_sdk.services.jcq.apis.DescribeConsumerGroupIdsRequest import DescribeConsumerGroupIdsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RemovePermissionRequest(params_dict, headers) + req = DescribeConsumerGroupIdsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -530,6 +542,7 @@ def remove_permission(self): (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -564,9 +577,10 @@ def describe_subscriptions(self): (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), (['--consumer-group-id'], dict(help="""(string) consumerGroupId """, dest='consumerGroupId', required=True)), (['--message-invisible-time-in-seconds'], dict(help="""(int) 消息隐藏时间单位秒 """, dest='messageInvisibleTimeInSeconds', type=int, required=False)), - (['--dlq-enable'], dict(help="""(bool) 是否开启死信队列[true, false] """, dest='dlqEnable', required=False)), + (['--dlq-enable'], dict(help="""(bool) 是否开启死信队列[true, false] """, dest='dlqEnable', type=bool, required=False)), (['--max-retry-times'], dict(help="""(int) 最大重试次数dlqEnable为true必填,范围[0,16] """, dest='maxRetryTimes', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -601,6 +615,7 @@ def create_subscription(self): (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), (['--consumer-group-id'], dict(help="""(string) consumerGroupId """, dest='consumerGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -636,8 +651,9 @@ def describe_subscription(self): (['--consumer-group-id'], dict(help="""(string) consumerGroupId """, dest='consumerGroupId', required=True)), (['--max-retry-times'], dict(help="""(int) 最大重试次数 """, dest='maxRetryTimes', type=int, required=False)), (['--message-invisible-time-in-seconds'], dict(help="""(int) 消息ack超时时间 """, dest='messageInvisibleTimeInSeconds', type=int, required=False)), - (['--dlq-enable'], dict(help="""(bool) 是否开启死信队列[true, false] """, dest='dlqEnable', required=False)), + (['--dlq-enable'], dict(help="""(bool) 是否开启死信队列[true, false] """, dest='dlqEnable', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -672,6 +688,7 @@ def modify_subscription_attribute(self): (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), (['--consumer-group-id'], dict(help="""(string) consumerGroupId """, dest='consumerGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -706,6 +723,7 @@ def delete_subscription(self): (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), (['--consumer-group-id'], dict(help="""(string) consumerGroupId """, dest='consumerGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -741,6 +759,7 @@ def clean_messages(self): (['--consumer-group-id'], dict(help="""(string) consumerGroupId """, dest='consumerGroupId', required=True)), (['--time'], dict(help="""(string) 时间 """, dest='time', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -772,32 +791,34 @@ def reset_consume_offset(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), + (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), + (['--start-time'], dict(help="""(string) 开始时间 """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间 """, dest='endTime', required=True)), (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--page-number'], dict(help="""(int) 页码 """, dest='pageNumber', type=int, required=False)), - (['--topic-filter'], dict(help="""(string) topic名称的过滤条件,大小写不敏感 """, dest='topicFilter', required=False)), - (['--tag-filters'], dict(help="""(array: tagFilter) 标签过滤条件 """, dest='tagFilters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询topic列表 ''', + help=''' 消息列表 ''', description=''' - 查询topic列表。 + 消息列表。 - 示例: jdc jcq describe-topics + 示例: jdc jcq describe-messages --topic-name xxx --start-time xxx --end-time xxx ''', ) - def describe_topics(self): + def describe_messages(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.DescribeTopicsRequest import DescribeTopicsRequest + from jdcloud_sdk.services.jcq.apis.DescribeMessagesRequest import DescribeMessagesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeTopicsRequest(params_dict, headers) + req = DescribeMessagesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -808,31 +829,31 @@ def describe_topics(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), - (['--topic-name'], dict(help="""(string) topic名称 """, dest='topicName', required=True)), - (['--type'], dict(help="""(string) 类型,[normal,global_order] """, dest='type', required=True)), - (['--description'], dict(help="""(string) 描述,长度不大于255 """, dest='description', required=False)), + (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), + (['--message-id'], dict(help="""(string) message Id """, dest='messageId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个指定名称的topic ''', + help=''' 查询message详情 ''', description=''' - 创建一个指定名称的topic。 + 查询message详情。 - 示例: jdc jcq create-topic --topic-name xxx --type xxx + 示例: jdc jcq describe-message --topic-name xxx --message-id xxx ''', ) - def create_topic(self): + def describe_message(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.CreateTopicRequest import CreateTopicRequest + from jdcloud_sdk.services.jcq.apis.DescribeMessageRequest import DescribeMessageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateTopicRequest(params_dict, headers) + req = DescribeMessageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -844,28 +865,30 @@ def create_topic(self): arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), + (['--message-id'], dict(help="""(string) message Id """, dest='messageId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询topic详情 ''', + help=''' 查询消息轨迹 ''', description=''' - 查询topic详情。 + 查询消息轨迹。 - 示例: jdc jcq describe-topic --topic-name xxx + 示例: jdc jcq describe-message-trace --topic-name xxx --message-id xxx ''', ) - def describe_topic(self): + def describe_message_trace(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.DescribeTopicRequest import DescribeTopicRequest + from jdcloud_sdk.services.jcq.apis.DescribeMessageTraceRequest import DescribeMessageTraceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeTopicRequest(params_dict, headers) + req = DescribeMessageTraceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -877,28 +900,30 @@ def describe_topic(self): arguments=[ (['--region-id'], dict(help="""(string) 所在区域的Region ID """, dest='regionId', required=False)), (['--topic-name'], dict(help="""(string) topic 名称 """, dest='topicName', required=True)), + (['--business-id'], dict(help="""(string) business id """, dest='businessId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除单个topic ''', + help=''' 根据businessId查询消息 ''', description=''' - 删除单个topic。 + 根据businessId查询消息。 - 示例: jdc jcq delete-topic --topic-name xxx + 示例: jdc jcq describe-messages-by-business-id --topic-name xxx --business-id xxx ''', ) - def delete_topic(self): + def describe_messages_by_business_id(self): client_factory = ClientFactory('jcq') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jcq.apis.DeleteTopicRequest import DeleteTopicRequest + from jdcloud_sdk.services.jcq.apis.DescribeMessagesByBusinessIdRequest import DescribeMessagesByBusinessIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteTopicRequest(params_dict, headers) + req = DescribeMessagesByBusinessIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -908,7 +933,7 @@ def delete_topic(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-access-point','describe-consumer-group-ids','describe-dead-letter-numbers','describe-dead-letter-numbers-with-topic','list-dead-letters','delete-dead-letters','resend-dead-letters','describe-messages','describe-message','describe-message-trace','describe-messages-by-business-id','describe-permission','add-permission','remove-permission','describe-subscriptions','create-subscription','describe-subscription','modify-subscription-attribute','delete-subscription','clean-messages','reset-consume-offset','describe-topics','create-topic','describe-topic','delete-topic',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-access-point','describe-topics','create-topic','describe-topic','delete-topic','describe-dead-letter-numbers','describe-dead-letter-numbers-with-topic','list-dead-letters','delete-dead-letters','resend-dead-letters','describe-permission','add-permission','remove-permission','describe-consumer-group-ids','describe-subscriptions','create-subscription','describe-subscription','modify-subscription-attribute','delete-subscription','clean-messages','reset-consume-offset','describe-messages','describe-message','describe-message-trace','describe-messages-by-business-id',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/jdccs.py b/jdcloud_cli/controllers/services/jdccs.py index e2a4aa9..1065ef9 100644 --- a/jdcloud_cli/controllers/services/jdccs.py +++ b/jdcloud_cli/controllers/services/jdccs.py @@ -36,13 +36,366 @@ class Meta: stacked_on = 'base' stacked_type = 'nested' + @expose( + arguments=[ + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询可用监控项列表 ''', + description=''' + 查询可用监控项列表。 + + 示例: jdc jdccs describe-metrics + ''', + ) + def describe_metrics(self): + client_factory = ClientFactory('jdccs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jdccs.apis.DescribeMetricsRequest import DescribeMetricsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeMetricsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), + (['--metric'], dict(help="""(string) 监控项英文标识(id) """, dest='metric', required=True)), + (['--resource-id'], dict(help="""(string) 资源ID """, dest='resourceId', required=True)), + (['--start-time'], dict(help="""(int) 查询时间范围的开始时间, UNIX时间戳,(机柜电流最多支持最近90天数据查询、带宽流量最多支持最近30天数据查询) """, dest='startTime', type=int, required=True)), + (['--end-time'], dict(help="""(int) 查询时间范围的结束时间, UNIX时间戳,(机柜电流最多支持最近90天数据查询、带宽流量最多支持最近30天数据查询) """, dest='endTime', type=int, required=True)), + (['--time-interval'], dict(help="""(string) 时间间隔:分钟m、小时h、天d,如: 10分钟=10m、1小时=1h,3天=3d;默认5m,最小支持5m,最大90d 目前带宽上、下行流量查询,时间间隔:1m、5m,默认5m。1m时间间隔支持的最大时间范围为2小时 """, dest='timeInterval', required=False)), + (['--ip'], dict(help="""(string) 交换机IP,指定ip时须同时指定port """, dest='ip', required=False)), + (['--port'], dict(help="""(string) 端口,指定port时须同时指定ip """, dest='port', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查看某资源单个监控项数据 ''', + description=''' + 查看某资源单个监控项数据。 + + 示例: jdc jdccs describe-metric-data --idc xxx --metric xxx --resource-id xxx --start-time 5 --end-time 5 + ''', + ) + def describe_metric_data(self): + client_factory = ClientFactory('jdccs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jdccs.apis.DescribeMetricDataRequest import DescribeMetricDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeMetricDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), + (['--metric'], dict(help="""(string) 监控项英文标识(id) """, dest='metric', required=True)), + (['--resource-id'], dict(help="""(string) 资源ID,支持多个resourceId批量查询,每个id用英文竖线分隔 """, dest='resourceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查看某资源的最后一个监控数据点(目前只支持机柜电流) ''', + description=''' + 查看某资源的最后一个监控数据点(目前只支持机柜电流)。 + + 示例: jdc jdccs last-downsample --idc xxx --metric xxx --resource-id xxx + ''', + ) + def last_downsample(self): + client_factory = ClientFactory('jdccs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jdccs.apis.LastDownsampleRequest import LastDownsampleRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = LastDownsampleRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20 """, dest='pageSize', type=int, required=False)), + (['--bandwidth-name'], dict(help="""(string) 带宽(出口)名称 """, dest='bandwidthName', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询带宽(出口)流量列表 ''', + description=''' + 查询带宽(出口)流量列表。 + + 示例: jdc jdccs describe-bandwidth-traffics --idc xxx + ''', + ) + def describe_bandwidth_traffics(self): + client_factory = ClientFactory('jdccs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jdccs.apis.DescribeBandwidthTrafficsRequest import DescribeBandwidthTrafficsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeBandwidthTrafficsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), + (['--bandwidth-id'], dict(help="""(string) 带宽(出口)实例ID """, dest='bandwidthId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询带宽(出口)流量(资源)详情 ''', + description=''' + 查询带宽(出口)流量(资源)详情。 + + 示例: jdc jdccs describe-bandwidth-traffic --idc xxx --bandwidth-id xxx + ''', + ) + def describe_bandwidth_traffic(self): + client_factory = ClientFactory('jdccs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jdccs.apis.DescribeBandwidthTrafficRequest import DescribeBandwidthTrafficRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeBandwidthTrafficRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--resource-id'], dict(help="""(string) 资源ID,支持多个resourceId批量查询,每个id用英文竖线分隔 """, dest='resourceId', required=True)), + (['--start-time'], dict(help="""(int) 查询时间范围的开始时间, UNIX时间戳,(支持查询最近30分钟数据且时间范围不超过5分钟) """, dest='startTime', type=int, required=True)), + (['--end-time'], dict(help="""(int) 查询时间范围的结束时间, UNIX时间戳,(支持查询最近30分钟数据且时间范围不超过5分钟) """, dest='endTime', type=int, required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 根据IP网段查询流量采样数据 ''', + description=''' + 根据IP网段查询流量采样数据。 + + 示例: jdc jdccs describe-traffic-sampling --resource-id xxx --start-time 5 --end-time 5 + ''', + ) + def describe_traffic_sampling(self): + client_factory = ClientFactory('jdccs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jdccs.apis.DescribeTrafficSamplingRequest import DescribeTrafficSamplingRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeTrafficSamplingRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询开放设备列表 ''', + description=''' + 查询开放设备列表。 + + 示例: jdc jdccs describe-open-devices + ''', + ) + def describe_open_devices(self): + client_factory = ClientFactory('jdccs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jdccs.apis.DescribeOpenDevicesRequest import DescribeOpenDevicesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeOpenDevicesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--device-codes'], dict(help="""(string) 设备编码,支持多个deviceCode批量查询,每个id用英文竖线分隔 """, dest='deviceCodes', required=False)), + (['--device-type'], dict(help="""(string) 设备类型 """, dest='deviceType', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询开放设备数据信息接口 ''', + description=''' + 查询开放设备数据信息接口。 + + 示例: jdc jdccs describe-open-devices-data --device-type xxx + ''', + ) + def describe_open_devices_data(self): + client_factory = ClientFactory('jdccs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jdccs.apis.DescribeOpenDevicesDataRequest import DescribeOpenDevicesDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeOpenDevicesDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), + (['--resource-id'], dict(help="""(string) 机柜资源ID """, dest='resourceId', required=True)), + (['--start-time'], dict(help="""(int) 查询时间范围的开始时间, UNIX时间戳,(最多支持最近90天数据查询) """, dest='startTime', type=int, required=True)), + (['--end-time'], dict(help="""(int) 查询时间范围的结束时间, UNIX时间戳,(最多支持最近90天数据查询) """, dest='endTime', type=int, required=True)), + (['--time-interval'], dict(help="""(string) 时间间隔:分钟m、小时h、天d,如: 10分钟=10m、1小时=1h,3天=3d;默认5m,最小支持5m,最大90d 目前带宽上、下行流量查询,时间间隔:1m、5m,默认5m。时间间隔支持的最大时间范围为2小时 """, dest='timeInterval', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 按照时间段查询单个机柜AB路电流 ''', + description=''' + 按照时间段查询单个机柜AB路电流。 + + 示例: jdc jdccs describe-rangetime-cabinet-current --idc xxx --resource-id xxx --start-time 5 --end-time 5 + ''', + ) + def describe_rangetime_cabinet_current(self): + client_factory = ClientFactory('jdccs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jdccs.apis.DescribeRangetimeCabinetCurrentRequest import DescribeRangetimeCabinetCurrentRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeRangetimeCabinetCurrentRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), + (['--resource-id'], dict(help="""(string) 资源ID,支持多个resourceId批量查询,每个id用英文竖线分隔 """, dest='resourceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询多个机柜AB路实时电流 ''', + description=''' + 查询多个机柜AB路实时电流。 + + 示例: jdc jdccs describe-realtime-cabinet-current --idc xxx --resource-id xxx + ''', + ) + def describe_realtime_cabinet_current(self): + client_factory = ClientFactory('jdccs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jdccs.apis.DescribeRealtimeCabinetCurrentRequest import DescribeRealtimeCabinetCurrentRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeRealtimeCabinetCurrentRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20 """, dest='pageSize', type=int, required=False)), (['--resource-type'], dict(help="""(string) 资源类型 bandwidth:带宽 """, dest='resourceType', required=False)), (['--resource-id'], dict(help="""(string) 资源ID,指定resourceId时须指定resourceType """, dest='resourceId', required=False)), + (['--idc'], dict(help="""(string) 机房英文标识 """, dest='idc', required=False)), + (['--status'], dict(help="""(string) 规则状态 disabled:禁用 enabled:启用 """, dest='status', required=False)), + (['--filters'], dict(help="""(array: filter) alarmId - 规则实施ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -71,10 +424,59 @@ def describe_alarms(self): except Exception as e: print(e) + @expose( + arguments=[ + (['--idc'], dict(help="""(string) idc机房实例ID """, dest='idc', required=False)), + (['--resource-type'], dict(help="""(string) 资源类型,bandwidth:带宽 """, dest='resourceType', required=False)), + (['--resource-id'], dict(help="""(string) 带宽实例ID """, dest='resourceId', required=False)), + (['--name'], dict(help="""(string) 规则名称 """, dest='name', required=False)), + (['--metric'], dict(help="""(string) 监控项,bandwidthTrafficIn:上行实时流量 bandwidthTrafficOut:下行实时流量 """, dest='metric', required=False)), + (['--period'], dict(help="""(int) 统计周期(单位:分钟) """, dest='period', type=int, required=False)), + (['--statistic-method'], dict(help="""(string) 统计方法:平均值=avg、最大值=max、最小值=min """, dest='statisticMethod', required=False)), + (['--operator'], dict(help="""(string) 计算方式 >=、>、<、<=、=、!= """, dest='operator', required=False)), + (['--threshold'], dict(help="""(float) 阈值 """, dest='threshold', required=False)), + (['--times'], dict(help="""(int) 连续多少次后报警 """, dest='times', type=int, required=False)), + (['--notice-period'], dict(help="""(int) 通知周期 单位:小时 """, dest='noticePeriod', type=int, required=False)), + (['--status'], dict(help="""(string) 规则状态 disabled:禁用 enabled:启用 """, dest='status', required=False)), + (['--notice-method'], dict(help="""(string) 通知方式 all:全部 sms:短信 email:邮件 """, dest='noticeMethod', required=False)), + (['--notice-obj'], dict(help="""(string) 通知对象 all:全部 persons:个人 groups:角色组 """, dest='noticeObj', required=False)), + (['--user-id'], dict(help="""(string) 通知对象用户ID,若多个用逗号分隔 """, dest='userId', required=False)), + (['--group-id'], dict(help="""(string) 通知对象组ID """, dest='groupId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建报警 ''', + description=''' + 创建报警。 + + 示例: jdc jdccs create-alarm + ''', + ) + def create_alarm(self): + client_factory = ClientFactory('jdccs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jdccs.apis.CreateAlarmRequest import CreateAlarmRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateAlarmRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--alarm-id'], dict(help="""(string) 报警规则ID """, dest='alarmId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -105,33 +507,42 @@ def describe_alarm(self): @expose( arguments=[ - (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20 """, dest='pageSize', type=int, required=False)), - (['--alarm-id'], dict(help="""(string) 报警规则ID """, dest='alarmId', required=False)), - (['--start-time'], dict(help="""(int) 查询时间范围的开始时间, UNIX时间戳 """, dest='startTime', type=int, required=False)), - (['--end-time'], dict(help="""(int) 查询时间范围的结束时间, UNIX时间戳 """, dest='endTime', type=int, required=False)), + (['--alarm-id'], dict(help="""(string) 报警规则ID """, dest='alarmId', required=True)), + (['--name'], dict(help="""(string) 规则名称 """, dest='name', required=False)), + (['--metric'], dict(help="""(string) 监控项,bandwidthTrafficIn:上行实时流量 bandwidthTrafficOut:下行实时流量 """, dest='metric', required=False)), + (['--period'], dict(help="""(int) 统计周期(单位:分钟) """, dest='period', type=int, required=False)), + (['--statistic-method'], dict(help="""(string) 统计方法:平均值=avg、最大值=max、最小值=min """, dest='statisticMethod', required=False)), + (['--operator'], dict(help="""(string) 计算方式 >=、>、<、<=、=、!= """, dest='operator', required=False)), + (['--threshold'], dict(help="""(float) 阈值 """, dest='threshold', required=False)), + (['--times'], dict(help="""(int) 连续多少次后报警 """, dest='times', type=int, required=False)), + (['--notice-period'], dict(help="""(int) 通知周期 单位:小时 """, dest='noticePeriod', type=int, required=False)), + (['--status'], dict(help="""(string) 规则状态 disabled:禁用 enabled:启用 """, dest='status', required=False)), + (['--notice-method'], dict(help="""(string) 通知方式 all:全部 sms:短信 email:邮件 """, dest='noticeMethod', required=False)), + (['--user-id'], dict(help="""(string) 通知对象用户ID,若多个用逗号分隔 """, dest='userId', required=False)), + (['--group-id'], dict(help="""(string) 通知对象组ID """, dest='groupId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 报警历史列表 ''', + help=''' 修改报警规则 ''', description=''' - 报警历史列表。 + 修改报警规则。 - 示例: jdc jdccs describe-alarm-history + 示例: jdc jdccs update-alarm --alarm-id xxx ''', ) - def describe_alarm_history(self): + def update_alarm(self): client_factory = ClientFactory('jdccs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdccs.apis.DescribeAlarmHistoryRequest import DescribeAlarmHistoryRequest + from jdcloud_sdk.services.jdccs.apis.UpdateAlarmRequest import UpdateAlarmRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAlarmHistoryRequest(params_dict, headers) + req = UpdateAlarmRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -141,28 +552,30 @@ def describe_alarm_history(self): @expose( arguments=[ + (['--alarm-id'], dict(help="""(string) 报警规则ID """, dest='alarmId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询可用监控项列表 ''', + help=''' 删除报警 ''', description=''' - 查询可用监控项列表。 + 删除报警。 - 示例: jdc jdccs describe-metrics + 示例: jdc jdccs delete-alarm --alarm-id xxx ''', ) - def describe_metrics(self): + def delete_alarm(self): client_factory = ClientFactory('jdccs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdccs.apis.DescribeMetricsRequest import DescribeMetricsRequest + from jdcloud_sdk.services.jdccs.apis.DeleteAlarmRequest import DeleteAlarmRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeMetricsRequest(params_dict, headers) + req = DeleteAlarmRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -172,36 +585,35 @@ def describe_metrics(self): @expose( arguments=[ - (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), - (['--metric'], dict(help="""(string) 监控项英文标识(id) """, dest='metric', required=True)), - (['--resource-id'], dict(help="""(string) 资源ID """, dest='resourceId', required=True)), - (['--start-time'], dict(help="""(int) 查询时间范围的开始时间, UNIX时间戳,(机柜电流最多支持最近90天数据查询、带宽流量最多支持最近30天数据查询) """, dest='startTime', type=int, required=True)), - (['--end-time'], dict(help="""(int) 查询时间范围的结束时间, UNIX时间戳,(机柜电流最多支持最近90天数据查询、带宽流量最多支持最近30天数据查询) """, dest='endTime', type=int, required=True)), - (['--time-interval'], dict(help="""(string) 时间间隔:分钟m、小时h、天d,如: 10分钟=10m、1小时=1h,3天=3d;默认5m,最小支持5m,最大90d 目前带宽上、下行流量查询,会根据时间范围是否超过2小时,设定时间间隔为1m或5m """, dest='timeInterval', required=False)), - (['--ip'], dict(help="""(string) 交换机IP,指定ip时须同时指定port """, dest='ip', required=False)), - (['--port'], dict(help="""(string) 端口,指定port时须同时指定ip """, dest='port', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20 """, dest='pageSize', type=int, required=False)), + (['--alarm-id'], dict(help="""(string) 报警规则ID """, dest='alarmId', required=False)), + (['--idc'], dict(help="""(string) 机房英文标识 """, dest='idc', required=False)), + (['--start-time'], dict(help="""(int) 查询时间范围的开始时间, UNIX时间戳 """, dest='startTime', type=int, required=False)), + (['--end-time'], dict(help="""(int) 查询时间范围的结束时间, UNIX时间戳 """, dest='endTime', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看某资源单个监控项数据 ''', + help=''' 报警历史列表 ''', description=''' - 查看某资源单个监控项数据。 + 报警历史列表。 - 示例: jdc jdccs describe-metric-data --idc xxx --metric xxx --resource-id xxx --start-time 0 --end-time 0 + 示例: jdc jdccs describe-alarm-history ''', ) - def describe_metric_data(self): + def describe_alarm_history(self): client_factory = ClientFactory('jdccs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdccs.apis.DescribeMetricDataRequest import DescribeMetricDataRequest + from jdcloud_sdk.services.jdccs.apis.DescribeAlarmHistoryRequest import DescribeAlarmHistoryRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeMetricDataRequest(params_dict, headers) + req = DescribeAlarmHistoryRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -211,31 +623,31 @@ def describe_metric_data(self): @expose( arguments=[ - (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), - (['--metric'], dict(help="""(string) 监控项英文标识(id) """, dest='metric', required=True)), - (['--resource-id'], dict(help="""(string) 资源ID,支持多个resourceId批量查询,每个id用英文竖线分隔 """, dest='resourceId', required=True)), + (['--alarm-id'], dict(help="""(string) 报警规则ID """, dest='alarmId', required=True)), + (['--status'], dict(help="""(string) 规则状态 disabled:禁用 enabled:启用 """, dest='status', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看某资源的最后一个监控数据点(目前只支持机柜电流) ''', + help=''' 启用、禁用报警 ''', description=''' - 查看某资源的最后一个监控数据点(目前只支持机柜电流)。 + 启用、禁用报警。 - 示例: jdc jdccs last-downsample --idc xxx --metric xxx --resource-id xxx + 示例: jdc jdccs switch-alarm --alarm-id xxx ''', ) - def last_downsample(self): + def switch_alarm(self): client_factory = ClientFactory('jdccs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdccs.apis.LastDownsampleRequest import LastDownsampleRequest + from jdcloud_sdk.services.jdccs.apis.SwitchAlarmRequest import SwitchAlarmRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = LastDownsampleRequest(params_dict, headers) + req = SwitchAlarmRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -245,31 +657,41 @@ def last_downsample(self): @expose( arguments=[ - (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20 """, dest='pageSize', type=int, required=False)), + (['--type'], dict(help="""(string) 工单TAB类型 pendingProcess:待我处理 pendingReview:待审核 processing:处理中 all:全部(默认) """, dest='type', required=False)), + (['--ticket-type-name'], dict(help="""(string) 工单类型 """, dest='ticketTypeName', required=False)), + (['--status'], dict(help="""(string) 工单状态 pendingReview:待审核 revoked:已撤销 processing:处理中 pendingVerification:待核验 pendingClose:待关单 rejected:已拒绝 completed:已完成 cancelled:已取消 draft:草稿中 """, dest='status', required=False)), + (['--ticket-no'], dict(help="""(string) 工单编号 """, dest='ticketNo', required=False)), + (['--ticket-template-name'], dict(help="""(string) 工单名称 """, dest='ticketTemplateName', required=False)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--start-time'], dict(help="""(string) 创建开始时间,遵循ISO8601标准,使用UTC时间,格式为:yyyy-MM-ddTHH:mm:ssZ """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 创建结束时间,遵循ISO8601标准,使用UTC时间,格式为:yyyy-MM-ddTHH:mm:ssZ """, dest='endTime', required=False)), + (['--filters'], dict(help="""(array: filter) ticketNo - 工单编号,精确匹配,支持多个; """, dest='filters', required=False)), + (['--sorts'], dict(help="""(array: sort) createdTime - 创建时间 closedTime - 关闭时间 """, dest='sorts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询带宽(出口)流量列表 ''', + help=''' 查询工单列表 ''', description=''' - 查询带宽(出口)流量列表。 + 查询工单列表。 - 示例: jdc jdccs describe-bandwidth-traffics --idc xxx + 示例: jdc jdccs describe-tickets ''', ) - def describe_bandwidth_traffics(self): + def describe_tickets(self): client_factory = ClientFactory('jdccs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdccs.apis.DescribeBandwidthTrafficsRequest import DescribeBandwidthTrafficsRequest + from jdcloud_sdk.services.jdccs.apis.DescribeTicketsRequest import DescribeTicketsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBandwidthTrafficsRequest(params_dict, headers) + req = DescribeTicketsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -279,30 +701,30 @@ def describe_bandwidth_traffics(self): @expose( arguments=[ - (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), - (['--bandwidth-id'], dict(help="""(string) 带宽(出口)实例ID """, dest='bandwidthId', required=True)), + (['--ticket-no'], dict(help="""(string) 工单编号 """, dest='ticketNo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询带宽(出口)流量(资源)详情 ''', + help=''' 查询工单详情 ''', description=''' - 查询带宽(出口)流量(资源)详情。 + 查询工单详情。 - 示例: jdc jdccs describe-bandwidth-traffic --idc xxx --bandwidth-id xxx + 示例: jdc jdccs describe-ticket --ticket-no xxx ''', ) - def describe_bandwidth_traffic(self): + def describe_ticket(self): client_factory = ClientFactory('jdccs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdccs.apis.DescribeBandwidthTrafficRequest import DescribeBandwidthTrafficRequest + from jdcloud_sdk.services.jdccs.apis.DescribeTicketRequest import DescribeTicketRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBandwidthTrafficRequest(params_dict, headers) + req = DescribeTicketRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -312,31 +734,39 @@ def describe_bandwidth_traffic(self): @expose( arguments=[ - (['--resource-id'], dict(help="""(string) 资源ID,支持多个resourceId批量查询,每个id用英文竖线分隔 """, dest='resourceId', required=True)), - (['--start-time'], dict(help="""(int) 查询时间范围的开始时间, UNIX时间戳,(支持查询最近30分钟数据且时间范围不超过5分钟) """, dest='startTime', type=int, required=True)), - (['--end-time'], dict(help="""(int) 查询时间范围的结束时间, UNIX时间戳,(支持查询最近30分钟数据且时间范围不超过5分钟) """, dest='endTime', type=int, required=True)), + (['--phone'], dict(help="""(string) 提单人手机号 """, dest='phone', required=False)), + (['--email'], dict(help="""(string) 提单人邮箱 """, dest='email', required=False)), + (['--idc'], dict(help="""(string) idc机房实例id """, dest='idc', required=False)), + (['--is-external-idc'], dict(help="""(bool) 是否是商业化外部机房 """, dest='isExternalIdc', type=bool, required=False)), + (['--count'], dict(help="""(int) 数量 """, dest='count', type=int, required=False)), + (['--external-idc-address'], dict(help="""(string) 外部机房地址 """, dest='externalIdcAddress', required=False)), + (['--external-idc-contact-person'], dict(help="""(string) 外部机房联系人 """, dest='externalIdcContactPerson', required=False)), + (['--external-idc-contact-phone'], dict(help="""(string) 外部机房联系电话 """, dest='externalIdcContactPhone', required=False)), + (['--remarks'], dict(help="""(string) 描述 """, dest='remarks', required=False)), + (['--attach'], dict(help="""(array: attach) 附件 """, dest='attach', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据IP网段查询流量采样数据 ''', + help=''' 提交通用服务工单 ''', description=''' - 根据IP网段查询流量采样数据。 + 提交通用服务工单。 - 示例: jdc jdccs describe-traffic-sampling --resource-id xxx --start-time 0 --end-time 0 + 示例: jdc jdccs create-general-services-ticket ''', ) - def describe_traffic_sampling(self): + def create_general_services_ticket(self): client_factory = ClientFactory('jdccs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdccs.apis.DescribeTrafficSamplingRequest import DescribeTrafficSamplingRequest + from jdcloud_sdk.services.jdccs.apis.CreateGeneralServicesTicketRequest import CreateGeneralServicesTicketRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeTrafficSamplingRequest(params_dict, headers) + req = CreateGeneralServicesTicketRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -348,7 +778,10 @@ def describe_traffic_sampling(self): arguments=[ (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20 """, dest='pageSize', type=int, required=False)), + (['--all'], dict(help="""(int) 是否查询全部,默认分页 """, dest='all', type=int, required=False)), + (['--include-external-idc'], dict(help="""(string) 是否强制包含外部机房 yes/no """, dest='includeExternalIdc', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -382,8 +815,10 @@ def describe_idcs(self): (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20 """, dest='pageSize', type=int, required=False)), + (['--all'], dict(help="""(int) 是否查询全部,默认分页 """, dest='all', type=int, required=False)), (['--filters'], dict(help="""(array: filter) roomNo - 房间号,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -417,8 +852,13 @@ def describe_rooms(self): (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20 """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) roomNo - 房间号,精确匹配,支持多个; cabinetId - 机柜ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--cabinet-type'], dict(help="""(string) 机柜类型 formal:正式机柜 reserved:预留机柜 """, dest='cabinetType', required=False)), + (['--cabinet-open-status'], dict(help="""(string) 机柜开通状态 disabled:未开通 enabling:开通中 enabled:已开通 disabling:关电中 """, dest='cabinetOpenStatus', required=False)), + (['--cabinet-no'], dict(help="""(string) 机柜编码 """, dest='cabinetNo', required=False)), + (['--filters'], dict(help="""(array: filter) roomNo - 房间号,精确匹配,支持多个; cabinetId - 机柜ID,精确匹配,支持多个; cabinetNo - 机柜编码,精确匹配,支持多个; cabinetOpenStatus - 机柜开通状态,精确匹配,支持多个; """, dest='filters', required=False)), + (['--sorts'], dict(help="""(array: sort) cabinetNo - 机柜编码 roomNo - 房间号 """, dest='sorts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -452,6 +892,7 @@ def describe_cabinets(self): (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), (['--cabinet-id'], dict(help="""(string) 机柜实例ID """, dest='cabinetId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -486,8 +927,15 @@ def describe_cabinet(self): (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20 """, dest='pageSize', type=int, required=False)), (['--cabinet-id'], dict(help="""(string) 机柜ID """, dest='cabinetId', required=False)), - (['--filters'], dict(help="""(array: filter) deviceId - 设备实例ID,精确匹配,支持多个; snNo - 设备SN号,精确匹配,支持多个; """, dest='filters', required=False)), + (['--device-type'], dict(help="""(string) 设备类型 server:服务器 network:网络设备 storage:存储设备 other:其他设备 """, dest='deviceType', required=False)), + (['--asset-status'], dict(help="""(string) 资产状态 launched:已上架 opened:已开通 canceling:退订中 operating:操作中 modifing:变更中 """, dest='assetStatus', required=False)), + (['--asset-belong'], dict(help="""(string) 资产归属 own:自备 lease:租赁 """, dest='assetBelong', required=False)), + (['--device-no'], dict(help="""(string) 设备编码 """, dest='deviceNo', required=False)), + (['--sn-no'], dict(help="""(string) 设备SN号 """, dest='snNo', required=False)), + (['--filters'], dict(help="""(array: filter) deviceId - 设备实例ID,精确匹配,支持多个; snNo - 设备SN号,精确匹配,支持多个; deviceNo - 设备编码,精确匹配,支持多个; cabinetNo - 机柜编码,精确匹配,支持多个; """, dest='filters', required=False)), + (['--sorts'], dict(help="""(array: sort) deviceNo - 设备编码 cabinetNo - 机柜编码 """, dest='sorts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -521,6 +969,7 @@ def describe_devices(self): (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), (['--device-id'], dict(help="""(string) 设备实例ID """, dest='deviceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -554,8 +1003,13 @@ def describe_device(self): (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20 """, dest='pageSize', type=int, required=False)), + (['--line-type'], dict(help="""(string) 线路类型 dynamicBGP:动态BGP thirdLineBGP:三线BGP telecom:电信单线 unicom:联通单线 mobile:移动单线 """, dest='lineType', required=False)), + (['--status'], dict(help="""(string) 状态 normal:正常 abnormal:异常 """, dest='status', required=False)), + (['--cidr-addr'], dict(help="""(string) IP地址段 """, dest='cidrAddr', required=False)), (['--filters'], dict(help="""(array: filter) ipId - 公网IP实例ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--sorts'], dict(help="""(array: sort) null """, dest='sorts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -589,8 +1043,14 @@ def describe_ips(self): (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20 """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) bandwidthId - 带宽实例IID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--line-type'], dict(help="""(string) 线路类型 dynamicBGP:动态BGP thirdLineBGP:三线BGP telecom:电信单线 unicom:联通单线 mobile:移动单线 """, dest='lineType', required=False)), + (['--charge-type'], dict(help="""(string) 计费方式 fixedBandwidth:固定带宽 95thPercentile:95峰值 merge95thPercentile:合并95峰值 """, dest='chargeType', required=False)), + (['--bandwidth-name'], dict(help="""(string) 带宽(出口)名称 """, dest='bandwidthName', required=False)), + (['--related-ip'], dict(help="""(string) 关联的公网IP """, dest='relatedIp', required=False)), + (['--filters'], dict(help="""(array: filter) bandwidthId - 带宽实例ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--sorts'], dict(help="""(array: sort) null """, dest='sorts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -624,6 +1084,7 @@ def describe_bandwidths(self): (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), (['--bandwidth-id'], dict(help="""(string) 带宽(出口)实例ID """, dest='bandwidthId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -654,63 +1115,30 @@ def describe_bandwidth(self): @expose( arguments=[ - (['--page-number'], dict(help="""(int) 页码, 默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20 """, dest='pageSize', type=int, required=False)), - (['--type'], dict(help="""(string) 工单TAB类型 pendingProcess:待我处理 pendingReview:待审核 processing:处理中 all:全部(默认) """, dest='type', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查询工单列表 ''', - description=''' - 查询工单列表。 - - 示例: jdc jdccs describe-tickets - ''', - ) - def describe_tickets(self): - client_factory = ClientFactory('jdccs') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.jdccs.apis.DescribeTicketsRequest import DescribeTicketsRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DescribeTicketsRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--ticket-no'], dict(help="""(string) 工单编号 """, dest='ticketNo', required=True)), + (['--idc'], dict(help="""(string) IDC机房ID """, dest='idc', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询工单详情 ''', + help=''' 查询机房资源概览 ''', description=''' - 查询工单详情。 + 查询机房资源概览。 - 示例: jdc jdccs describe-ticket --ticket-no xxx + 示例: jdc jdccs describe-idc-overview --idc xxx ''', ) - def describe_ticket(self): + def describe_idc_overview(self): client_factory = ClientFactory('jdccs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdccs.apis.DescribeTicketRequest import DescribeTicketRequest + from jdcloud_sdk.services.jdccs.apis.DescribeIdcOverviewRequest import DescribeIdcOverviewRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeTicketRequest(params_dict, headers) + req = DescribeIdcOverviewRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -720,7 +1148,7 @@ def describe_ticket(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-alarms','describe-alarm','describe-alarm-history','describe-metrics','describe-metric-data','last-downsample','describe-bandwidth-traffics','describe-bandwidth-traffic','describe-traffic-sampling','describe-idcs','describe-rooms','describe-cabinets','describe-cabinet','describe-devices','describe-device','describe-ips','describe-bandwidths','describe-bandwidth','describe-tickets','describe-ticket',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-metrics','describe-metric-data','last-downsample','describe-bandwidth-traffics','describe-bandwidth-traffic','describe-traffic-sampling','describe-open-devices','describe-open-devices-data','describe-rangetime-cabinet-current','describe-realtime-cabinet-current','describe-alarms','create-alarm','describe-alarm','update-alarm','delete-alarm','describe-alarm-history','switch-alarm','describe-tickets','describe-ticket','create-general-services-ticket','describe-idcs','describe-rooms','describe-cabinets','describe-cabinet','describe-devices','describe-device','describe-ips','describe-bandwidths','describe-bandwidth','describe-idc-overview',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/jdfusion.py b/jdcloud_cli/controllers/services/jdfusion.py index bc8a812..9bd077a 100644 --- a/jdcloud_cli/controllers/services/jdfusion.py +++ b/jdcloud_cli/controllers/services/jdfusion.py @@ -39,29 +39,30 @@ class Meta: @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--driver'], dict(help="""(string) 只获取对应driver的云信息 """, dest='driver', required=False)), + (['--id'], dict(help="""(string) VPC ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取当前用户的云注册信息 ''', + help=''' 根据云提供商查询对应的VPC资源信息 ''', description=''' - 获取当前用户的云注册信息。 + 根据云提供商查询对应的VPC资源信息。 - 示例: jdc jdfusion get-cloud-infos + 示例: jdc jdfusion get-vpc-by-id --id xxx ''', ) - def get_cloud_infos(self): + def get_vpc_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetCloudInfosRequest import GetCloudInfosRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcByIdRequest import GetVpcByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetCloudInfosRequest(params_dict, headers) + req = GetVpcByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -72,29 +73,30 @@ def get_cloud_infos(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--cloud'], dict(help="""(cloudInfo) NA """, dest='cloud', required=True)), + (['--id'], dict(help="""(string) VPC ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 为指定用户关联云 ''', + help=''' 删除VPC ''', description=''' - 为指定用户关联云。 + 删除VPC。 - 示例: jdc jdfusion regist-cloud-info --cloud '{"":""}' + 示例: jdc jdfusion delete-vpc-by-id --id xxx ''', ) - def regist_cloud_info(self): + def delete_vpc_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.RegistCloudInfoRequest import RegistCloudInfoRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteVpcByIdRequest import DeleteVpcByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RegistCloudInfoRequest(params_dict, headers) + req = DeleteVpcByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -105,29 +107,29 @@ def regist_cloud_info(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--cloud-id'], dict(help="""(string) 云信息ID """, dest='cloudId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取指定云信息 ''', + help=''' 查询私有网络资源列表 ''', description=''' - 获取指定云信息。 + 查询私有网络资源列表。 - 示例: jdc jdfusion get-cloud-info-by-id --cloud-id xxx + 示例: jdc jdfusion get-vpcs ''', ) - def get_cloud_info_by_id(self): + def get_vpcs(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetCloudInfoByIdRequest import GetCloudInfoByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcsRequest import GetVpcsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetCloudInfoByIdRequest(params_dict, headers) + req = GetVpcsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -138,29 +140,30 @@ def get_cloud_info_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--cloud-id'], dict(help="""(string) 云信息ID """, dest='cloudId', required=True)), + (['--vpc'], dict(help="""(vpcInfo) 创建VPC """, dest='vpc', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取指定云信息 ''', + help=''' 根据云提供商创建私有网络 ''', description=''' - 获取指定云信息。 + 根据云提供商创建私有网络。 - 示例: jdc jdfusion unregist-cloud-info --cloud-id xxx + 示例: jdc jdfusion create-vpc --vpc '{"":""}' ''', ) - def unregist_cloud_info(self): + def create_vpc(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.UnregistCloudInfoRequest import UnregistCloudInfoRequest + from jdcloud_sdk.services.jdfusion.apis.CreateVpcRequest import CreateVpcRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UnregistCloudInfoRequest(params_dict, headers) + req = CreateVpcRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -171,29 +174,30 @@ def unregist_cloud_info(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--cloud-id'], dict(help="""(string) 云信息ID """, dest='cloudId', required=True)), + (['--id'], dict(help="""(string) 资源实例ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 验证指定云信息的AK、SK ''', + help=''' 根据云提供商查询对应的VM资源信息 ''', description=''' - 验证指定云信息的AK、SK。 + 根据云提供商查询对应的VM资源信息。 - 示例: jdc jdfusion valid-cloud-info --cloud-id xxx + 示例: jdc jdfusion get-vm-instances-by-id --id xxx ''', ) - def valid_cloud_info(self): + def get_vm_instances_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.ValidCloudInfoRequest import ValidCloudInfoRequest + from jdcloud_sdk.services.jdfusion.apis.GetVmInstancesByIdRequest import GetVmInstancesByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ValidCloudInfoRequest(params_dict, headers) + req = GetVmInstancesByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -204,28 +208,30 @@ def valid_cloud_info(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--id'], dict(help="""(string) 资源实例ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询部署信息列表 ''', + help=''' 通过虚拟机id删除虚拟机 ''', description=''' - 查询部署信息列表。 + 通过虚拟机id删除虚拟机。 - 示例: jdc jdfusion get-deployments + 示例: jdc jdfusion delete-vm-instance-by-id --id xxx ''', ) - def get_deployments(self): + def delete_vm_instance_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetDeploymentsRequest import GetDeploymentsRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteVmInstanceByIdRequest import DeleteVmInstanceByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDeploymentsRequest(params_dict, headers) + req = DeleteVmInstanceByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -236,29 +242,29 @@ def get_deployments(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--deployment'], dict(help="""(deploymentInfo) 创建deployment """, dest='deployment', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建部署信息 ''', + help=''' 根据云提供商查询对应的虚拟机资源信息 ''', description=''' - 创建部署信息。 + 根据云提供商查询对应的虚拟机资源信息。 - 示例: jdc jdfusion create-deployment --deployment '{"":""}' + 示例: jdc jdfusion get-vm-instances ''', ) - def create_deployment(self): + def get_vm_instances(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateDeploymentRequest import CreateDeploymentRequest + from jdcloud_sdk.services.jdfusion.apis.GetVmInstancesRequest import GetVmInstancesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateDeploymentRequest(params_dict, headers) + req = GetVmInstancesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -269,29 +275,30 @@ def create_deployment(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--reverse'], dict(help="""(reverseDeploymentInfo) 根据已有资源反向生成deployment """, dest='reverse', required=True)), + (['--vm'], dict(help="""(createVm) 创建VM """, dest='vm', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据已有资源反向生成deployment ''', + help=''' 根据云提供商创建虚拟机 ''', description=''' - 根据已有资源反向生成deployment。 + 根据云提供商创建虚拟机。 - 示例: jdc jdfusion reverse-deployment --reverse '{"":""}' + 示例: jdc jdfusion create-vm-instance --vm '{"":""}' ''', ) - def reverse_deployment(self): + def create_vm_instance(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.ReverseDeploymentRequest import ReverseDeploymentRequest + from jdcloud_sdk.services.jdfusion.apis.CreateVmInstanceRequest import CreateVmInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ReverseDeploymentRequest(params_dict, headers) + req = CreateVmInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -302,29 +309,30 @@ def reverse_deployment(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) 资源实例ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询部署信息 ''', + help=''' 停止运行一台实例。只有状态为 运行中(Running)的实例才可以进行此操作。 ''', description=''' - 查询部署信息。 + 停止运行一台实例。只有状态为 运行中(Running)的实例才可以进行此操作。。 - 示例: jdc jdfusion get-deployments-by-id --id xxx + 示例: jdc jdfusion stop-vm-instance-by-id --id xxx ''', ) - def get_deployments_by_id(self): + def stop_vm_instance_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetDeploymentsByIdRequest import GetDeploymentsByIdRequest + from jdcloud_sdk.services.jdfusion.apis.StopVmInstanceByIdRequest import StopVmInstanceByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDeploymentsByIdRequest(params_dict, headers) + req = StopVmInstanceByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -335,30 +343,30 @@ def get_deployments_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), - (['--deployment'], dict(help="""(deploymentInfo) 修改deployment """, dest='deployment', required=True)), + (['--id'], dict(help="""(string) 资源实例ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改部署信息 ''', + help=''' 启动一台实例。实例状态必须为 已停止(Stopped),才可以调用该接口。 ''', description=''' - 修改部署信息。 + 启动一台实例。实例状态必须为 已停止(Stopped),才可以调用该接口。。 - 示例: jdc jdfusion edit-deployment --id xxx --deployment '{"":""}' + 示例: jdc jdfusion start-vm-instance-by-id --id xxx ''', ) - def edit_deployment(self): + def start_vm_instance_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.EditDeploymentRequest import EditDeploymentRequest + from jdcloud_sdk.services.jdfusion.apis.StartVmInstanceByIdRequest import StartVmInstanceByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EditDeploymentRequest(params_dict, headers) + req = StartVmInstanceByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -369,29 +377,30 @@ def edit_deployment(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) 资源实例ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除部署信息 ''', + help=''' 只能重启状态为 运行中(Running)的实例。 ''', description=''' - 删除部署信息。 + 只能重启状态为 运行中(Running)的实例。。 - 示例: jdc jdfusion delete-deployment --id xxx + 示例: jdc jdfusion reboot-vm-instance-by-id --id xxx ''', ) - def delete_deployment(self): + def reboot_vm_instance_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteDeploymentRequest import DeleteDeploymentRequest + from jdcloud_sdk.services.jdfusion.apis.RebootVmInstanceByIdRequest import RebootVmInstanceByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteDeploymentRequest(params_dict, headers) + req = RebootVmInstanceByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -402,30 +411,30 @@ def delete_deployment(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), - (['--deployment'], dict(help="""(deployment) 创建deployment """, dest='deployment', required=True)), + (['--slbid'], dict(help="""(string) 负载均衡id """, dest='slbid', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 克隆部署信息 ''', + help=''' 根据过滤条件,取得服务器组的信息 ''', description=''' - 克隆部署信息。 + 根据过滤条件,取得服务器组的信息。 - 示例: jdc jdfusion clone-deployment --id xxx --deployment '{"":""}' + 示例: jdc jdfusion get-vpc-vserver-groups ''', ) - def clone_deployment(self): + def get_vpc_vserver_groups(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CloneDeploymentRequest import CloneDeploymentRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcVServerGroupsRequest import GetVpcVServerGroupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CloneDeploymentRequest(params_dict, headers) + req = GetVpcVServerGroupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -436,29 +445,30 @@ def clone_deployment(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), + (['--vserver-group'], dict(help="""(createVserverGroup) 创建虚拟服务器组 """, dest='vserverGroup', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 预部署 ''', + help=''' 创建虚拟服务器组,并添加后端服务器 ''', description=''' - 预部署。 + 创建虚拟服务器组,并添加后端服务器。 - 示例: jdc jdfusion dryrun-deployment --id xxx + 示例: jdc jdfusion create-vpc-vserver-group --vserver-group '{"":""}' ''', ) - def dryrun_deployment(self): + def create_vpc_vserver_group(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DryrunDeploymentRequest import DryrunDeploymentRequest + from jdcloud_sdk.services.jdfusion.apis.CreateVpcVServerGroupRequest import CreateVpcVServerGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DryrunDeploymentRequest(params_dict, headers) + req = CreateVpcVServerGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -469,30 +479,30 @@ def dryrun_deployment(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), - (['--apply'], dict(help="""(apply) 应用部署 """, dest='apply', required=True)), + (['--id'], dict(help="""(string) 服务器组ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 应用部署 ''', + help=''' 根据过滤条件,取得服务器组的信息 ''', description=''' - 应用部署。 + 根据过滤条件,取得服务器组的信息。 - 示例: jdc jdfusion apply-deployment --id xxx --apply '{"":""}' + 示例: jdc jdfusion get-vserver-groups-by-id --id xxx ''', ) - def apply_deployment(self): + def get_vserver_groups_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.ApplyDeploymentRequest import ApplyDeploymentRequest + from jdcloud_sdk.services.jdfusion.apis.GetVserverGroupsByIdRequest import GetVserverGroupsByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ApplyDeploymentRequest(params_dict, headers) + req = GetVserverGroupsByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -503,29 +513,30 @@ def apply_deployment(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) deployment ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) 服务器组ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询执行结果 ''', + help=''' 删除服务器组 ''', description=''' - 查询执行结果。 + 删除服务器组。 - 示例: jdc jdfusion get-deployment-result --id xxx + 示例: jdc jdfusion delete-vserver-group --id xxx ''', ) - def get_deployment_result(self): + def delete_vserver_group(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetDeploymentResultRequest import GetDeploymentResultRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteVserverGroupRequest import DeleteVserverGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDeploymentResultRequest(params_dict, headers) + req = DeleteVserverGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -536,29 +547,30 @@ def get_deployment_result(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), + (['--driver'], dict(help="""(string) 只获取对应driver的云信息 """, dest='driver', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询应用记录 ''', + help=''' 获取当前用户的云注册信息 ''', description=''' - 查询应用记录。 + 获取当前用户的云注册信息。 - 示例: jdc jdfusion get-deployment-versions --id xxx + 示例: jdc jdfusion get-cloud-infos ''', ) - def get_deployment_versions(self): + def get_cloud_infos(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetDeploymentVersionsRequest import GetDeploymentVersionsRequest + from jdcloud_sdk.services.jdfusion.apis.GetCloudInfosRequest import GetCloudInfosRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDeploymentVersionsRequest(params_dict, headers) + req = GetCloudInfosRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -569,30 +581,30 @@ def get_deployment_versions(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) deployment ID """, dest='id', required=True)), - (['--version_id'], dict(help="""(string) application ID """, dest='version_id', required=True)), + (['--cloud'], dict(help="""(cloudInfo) NA """, dest='cloud', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询应用记录详细信息 ''', + help=''' 为指定用户关联云 ''', description=''' - 查询应用记录详细信息。 + 为指定用户关联云。 - 示例: jdc jdfusion get-deployments-version --id xxx --version_id xxx + 示例: jdc jdfusion regist-cloud-info --cloud '{"":""}' ''', ) - def get_deployments_version(self): + def regist_cloud_info(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetDeploymentsVersionRequest import GetDeploymentsVersionRequest + from jdcloud_sdk.services.jdfusion.apis.RegistCloudInfoRequest import RegistCloudInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDeploymentsVersionRequest(params_dict, headers) + req = RegistCloudInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -603,30 +615,30 @@ def get_deployments_version(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) deployment ID """, dest='id', required=True)), - (['--version_id'], dict(help="""(string) application ID """, dest='version_id', required=True)), + (['--cloud-id'], dict(help="""(string) 云信息ID """, dest='cloudId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 应用部署回滚 ''', + help=''' 获取指定云信息 ''', description=''' - 应用部署回滚。 + 获取指定云信息。 - 示例: jdc jdfusion rollback-deployments-version --id xxx --version_id xxx + 示例: jdc jdfusion get-cloud-info-by-id --cloud-id xxx ''', ) - def rollback_deployments_version(self): + def get_cloud_info_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.RollbackDeploymentsVersionRequest import RollbackDeploymentsVersionRequest + from jdcloud_sdk.services.jdfusion.apis.GetCloudInfoByIdRequest import GetCloudInfoByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RollbackDeploymentsVersionRequest(params_dict, headers) + req = GetCloudInfoByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -637,63 +649,30 @@ def rollback_deployments_version(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) deployment ID """, dest='id', required=True)), - (['--record'], dict(help="""(string) deployment ID """, dest='record', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查询某一次的历史执行结果(内部使用) ''', - description=''' - 查询某一次的历史执行结果(内部使用)。 - - 示例: jdc jdfusion get-deployments-results-by-id-record --id xxx --record xxx - ''', - ) - def get_deployments_results_by_id_record(self): - client_factory = ClientFactory('jdfusion') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.jdfusion.apis.GetDeploymentsResultsByIdRecordRequest import GetDeploymentsResultsByIdRecordRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = GetDeploymentsResultsByIdRecordRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--vm-id'], dict(help="""(string) 云主机id """, dest='vmId', required=False)), + (['--cloud-id'], dict(help="""(string) 云信息ID """, dest='cloudId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的云硬盘资源信息 ''', + help=''' 获取指定云信息 ''', description=''' - 根据云提供商查询对应的云硬盘资源信息。 + 获取指定云信息。 - 示例: jdc jdfusion get-disks + 示例: jdc jdfusion unregist-cloud-info --cloud-id xxx ''', ) - def get_disks(self): + def unregist_cloud_info(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetDisksRequest import GetDisksRequest + from jdcloud_sdk.services.jdfusion.apis.UnregistCloudInfoRequest import UnregistCloudInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDisksRequest(params_dict, headers) + req = UnregistCloudInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -704,29 +683,30 @@ def get_disks(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--disk'], dict(help="""(createDataDisk) 创建云硬盘 """, dest='disk', required=True)), + (['--cloud-id'], dict(help="""(string) 云信息ID """, dest='cloudId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商创建云硬盘 ''', + help=''' 验证指定云信息的AK、SK ''', description=''' - 根据云提供商创建云硬盘。 + 验证指定云信息的AK、SK。 - 示例: jdc jdfusion create-disk --disk '{"":""}' + 示例: jdc jdfusion valid-cloud-info --cloud-id xxx ''', ) - def create_disk(self): + def valid_cloud_info(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateDiskRequest import CreateDiskRequest + from jdcloud_sdk.services.jdfusion.apis.ValidCloudInfoRequest import ValidCloudInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateDiskRequest(params_dict, headers) + req = ValidCloudInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -737,29 +717,30 @@ def create_disk(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 云硬盘 ID """, dest='id', required=True)), + (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的云硬盘资源信息 ''', + help=''' 根据过滤条件,取得指定RDS实例上的数据库信息 ''', description=''' - 根据云提供商查询对应的云硬盘资源信息。 + 根据过滤条件,取得指定RDS实例上的数据库信息。 - 示例: jdc jdfusion get-disk-by-id --id xxx + 示例: jdc jdfusion get-rds-databases-by-inst-id --inst-id xxx ''', ) - def get_disk_by_id(self): + def get_rds_databases_by_inst_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetDiskByIdRequest import GetDiskByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetRdsDatabasesByInstIdRequest import GetRdsDatabasesByInstIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDiskByIdRequest(params_dict, headers) + req = GetRdsDatabasesByInstIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -770,29 +751,31 @@ def get_disk_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 云硬盘 ID """, dest='id', required=True)), + (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), + (['--database'], dict(help="""(createRDSDB) 创建RDS实例的数据库信息 """, dest='database', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除云硬盘 ''', + help=''' 根据给定的信息,创建指定RDS实例的数据库 ''', description=''' - 删除云硬盘。 + 根据给定的信息,创建指定RDS实例的数据库。 - 示例: jdc jdfusion remove-disk-by-id --id xxx + 示例: jdc jdfusion create-rds-database --inst-id xxx --database '{"":""}' ''', ) - def remove_disk_by_id(self): + def create_rds_database(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.RemoveDiskByIdRequest import RemoveDiskByIdRequest + from jdcloud_sdk.services.jdfusion.apis.CreateRdsDatabaseRequest import CreateRdsDatabaseRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RemoveDiskByIdRequest(params_dict, headers) + req = CreateRdsDatabaseRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -803,30 +786,31 @@ def remove_disk_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 云硬盘 ID """, dest='id', required=True)), - (['--attach'], dict(help="""(attachDataDisk) 云硬盘挂载至虚拟机 """, dest='attach', required=True)), + (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), + (['--db-name'], dict(help="""(string) 数据库名称 """, dest='dbName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 云硬盘挂载至虚拟机 ''', + help=''' 根据过滤条件,取得指定RDS实例上的数据库信息 ''', description=''' - 云硬盘挂载至虚拟机。 + 根据过滤条件,取得指定RDS实例上的数据库信息。 - 示例: jdc jdfusion attach-disk-to-vm-instance-by-disk-id --id xxx --attach '{"":""}' + 示例: jdc jdfusion get-rds-database-by-inst-id-and-db-name --inst-id xxx --db-name xxx ''', ) - def attach_disk_to_vm_instance_by_disk_id(self): + def get_rds_database_by_inst_id_and_db_name(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.AttachDiskToVmInstanceByDiskIdRequest import AttachDiskToVmInstanceByDiskIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetRdsDatabaseByInstIdAndDbNameRequest import GetRdsDatabaseByInstIdAndDbNameRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AttachDiskToVmInstanceByDiskIdRequest(params_dict, headers) + req = GetRdsDatabaseByInstIdAndDbNameRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -837,30 +821,31 @@ def attach_disk_to_vm_instance_by_disk_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 云硬盘 ID """, dest='id', required=True)), - (['--detach'], dict(help="""(detachDataDisk) 从虚拟机卸载云硬盘 """, dest='detach', required=True)), + (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), + (['--db-name'], dict(help="""(string) 数据库名称 """, dest='dbName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 从虚拟机卸载云硬盘 ''', + help=''' 删除指定RDS实例上,指定数据库名的数据库信息 ''', description=''' - 从虚拟机卸载云硬盘。 + 删除指定RDS实例上,指定数据库名的数据库信息。 - 示例: jdc jdfusion detach-disk-to-vm-instance-by-disk-id --id xxx --detach '{"":""}' + 示例: jdc jdfusion delete-rds-database --inst-id xxx --db-name xxx ''', ) - def detach_disk_to_vm_instance_by_disk_id(self): + def delete_rds_database(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DetachDiskToVmInstanceByDiskIdRequest import DetachDiskToVmInstanceByDiskIdRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteRdsDatabaseRequest import DeleteRdsDatabaseRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DetachDiskToVmInstanceByDiskIdRequest(params_dict, headers) + req = DeleteRdsDatabaseRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -872,6 +857,7 @@ def detach_disk_to_vm_instance_by_disk_id(self): arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -905,6 +891,7 @@ def get_buckets(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--bucket'], dict(help="""(createOSSBucket) 创建OSS存储桶 """, dest='bucket', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -938,6 +925,7 @@ def create_bucket(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--name'], dict(help="""(string) OSS存储桶名称 """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -971,6 +959,7 @@ def get_bucket_by_name(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--name'], dict(help="""(string) OSS存储桶名称 """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1005,6 +994,7 @@ def delete_bucket(self): (['--name'], dict(help="""(string) OSS存储桶名称 """, dest='name', required=True)), (['--marker'], dict(help="""(string) 本次查询的起点(文件key值) """, dest='marker', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1036,28 +1026,30 @@ def get_bucket_files(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--id'], dict(help="""(string) LB ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取任务列表 ''', + help=''' 根据云提供商查询对应的SLB资源信息 ''', description=''' - 获取任务列表。 + 根据云提供商查询对应的SLB资源信息。 - 示例: jdc jdfusion get-transfer-tasks + 示例: jdc jdfusion get-vpc-slb-by-id --id xxx ''', ) - def get_transfer_tasks(self): + def get_vpc_slb_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetTransferTasksRequest import GetTransferTasksRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcSlbByIdRequest import GetVpcSlbByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetTransferTasksRequest(params_dict, headers) + req = GetVpcSlbByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1068,29 +1060,30 @@ def get_transfer_tasks(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--task'], dict(help="""(transferSimpleTaskInfo) NA """, dest='task', required=False)), + (['--id'], dict(help="""(string) LB ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建任务 ''', + help=''' 删除SLB ''', description=''' - 创建任务。 + 删除SLB。 - 示例: jdc jdfusion create-transfer-task + 示例: jdc jdfusion delete-vpc-slb-by-id --id xxx ''', ) - def create_transfer_task(self): + def delete_vpc_slb_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateTransferTaskRequest import CreateTransferTaskRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteVpcSlbByIdRequest import DeleteVpcSlbByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateTransferTaskRequest(params_dict, headers) + req = DeleteVpcSlbByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1101,29 +1094,29 @@ def create_transfer_task(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 用户ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据指定ID获取任务信息 ''', + help=''' 根据云提供商查询对应的负载均衡资源信息 ''', description=''' - 根据指定ID获取任务信息。 + 根据云提供商查询对应的负载均衡资源信息。 - 示例: jdc jdfusion get-transfer-task-by-id --id xxx + 示例: jdc jdfusion get-vpc-slbs ''', ) - def get_transfer_task_by_id(self): + def get_vpc_slbs(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetTransferTaskByIdRequest import GetTransferTaskByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcSlbsRequest import GetVpcSlbsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetTransferTaskByIdRequest(params_dict, headers) + req = GetVpcSlbsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1134,30 +1127,30 @@ def get_transfer_task_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 任务ID """, dest='id', required=True)), - (['--task'], dict(help="""(transferTaskInfo) NA """, dest='task', required=False)), + (['--slb'], dict(help="""(slbInfo) 创建SLB """, dest='slb', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据指定ID修改任务 ''', + help=''' 根据云提供商创建负载均衡 ''', description=''' - 根据指定ID修改任务。 + 根据云提供商创建负载均衡。 - 示例: jdc jdfusion edit-transfer-task --id xxx + 示例: jdc jdfusion create-vpc-slb --slb '{"":""}' ''', ) - def edit_transfer_task(self): + def create_vpc_slb(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.EditTransferTaskRequest import EditTransferTaskRequest + from jdcloud_sdk.services.jdfusion.apis.CreateVpcSlbRequest import CreateVpcSlbRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EditTransferTaskRequest(params_dict, headers) + req = CreateVpcSlbRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1168,29 +1161,30 @@ def edit_transfer_task(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 任务ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) LB ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据指定ID删除任务 ''', + help=''' 启动负载均衡 ''', description=''' - 根据指定ID删除任务。 + 启动负载均衡。 - 示例: jdc jdfusion delete-transfer-task --id xxx + 示例: jdc jdfusion start-slb --id xxx ''', ) - def delete_transfer_task(self): + def start_slb(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteTransferTaskRequest import DeleteTransferTaskRequest + from jdcloud_sdk.services.jdfusion.apis.StartSlbRequest import StartSlbRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteTransferTaskRequest(params_dict, headers) + req = StartSlbRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1201,29 +1195,30 @@ def delete_transfer_task(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 用户ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) LB ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据指定ID启动任务 ''', + help=''' 停止负载均衡 ''', description=''' - 根据指定ID启动任务。 + 停止负载均衡。 - 示例: jdc jdfusion start-transfer-task --id xxx + 示例: jdc jdfusion stop-slb --id xxx ''', ) - def start_transfer_task(self): + def stop_slb(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.StartTransferTaskRequest import StartTransferTaskRequest + from jdcloud_sdk.services.jdfusion.apis.StopSlbRequest import StopSlbRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartTransferTaskRequest(params_dict, headers) + req = StopSlbRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1234,29 +1229,31 @@ def start_transfer_task(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 用户ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) 负载均衡id """, dest='id', required=True)), + (['--listener-port'], dict(help="""(int) 监听器端口 """, dest='listenerPort', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据指定ID停止任务 ''', + help=''' 删除监听器 ''', description=''' - 根据指定ID停止任务。 + 删除监听器。 - 示例: jdc jdfusion stop-transfer-task --id xxx + 示例: jdc jdfusion delete-slbs-listener --id xxx --listener-port 5 ''', ) - def stop_transfer_task(self): + def delete_slbs_listener(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.StopTransferTaskRequest import StopTransferTaskRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteSlbsListenerRequest import DeleteSlbsListenerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopTransferTaskRequest(params_dict, headers) + req = DeleteSlbsListenerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1267,29 +1264,31 @@ def stop_transfer_task(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 任务ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) 负载均衡id """, dest='id', required=True)), + (['--listener-port'], dict(help="""(int) 监听器端口 """, dest='listenerPort', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据指定任务id查询迁移进度 ''', + help=''' 启动监听器 ''', description=''' - 根据指定任务id查询迁移进度。 + 启动监听器。 - 示例: jdc jdfusion get-transfer-task-progress --id xxx + 示例: jdc jdfusion start-slb-listener --id xxx --listener-port 5 ''', ) - def get_transfer_task_progress(self): + def start_slb_listener(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetTransferTaskProgressRequest import GetTransferTaskProgressRequest + from jdcloud_sdk.services.jdfusion.apis.StartSlbListenerRequest import StartSlbListenerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetTransferTaskProgressRequest(params_dict, headers) + req = StartSlbListenerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1300,29 +1299,31 @@ def get_transfer_task_progress(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 任务ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) 负载均衡id """, dest='id', required=True)), + (['--listener-port'], dict(help="""(int) 监听器端口 """, dest='listenerPort', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据指定任务id查询迁移失败文件列表 ''', + help=''' 停止监听器 ''', description=''' - 根据指定任务id查询迁移失败文件列表。 + 停止监听器。 - 示例: jdc jdfusion get-transfer-task-failed-files --id xxx + 示例: jdc jdfusion stop-slb-listener --id xxx --listener-port 5 ''', ) - def get_transfer_task_failed_files(self): + def stop_slb_listener(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetTransferTaskFailedFilesRequest import GetTransferTaskFailedFilesRequest + from jdcloud_sdk.services.jdfusion.apis.StopSlbListenerRequest import StopSlbListenerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetTransferTaskFailedFilesRequest(params_dict, headers) + req = StopSlbListenerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1333,29 +1334,30 @@ def get_transfer_task_failed_files(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), + (['--engine'], dict(help="""(string) RDS数据库引擎,目前只支持mysql """, dest='engine', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据过滤条件,取得指定RDS实例上的账号信息 ''', + help=''' 根据数据库类型,取得RDS实例的规格 ''', description=''' - 根据过滤条件,取得指定RDS实例上的账号信息。 + 根据数据库类型,取得RDS实例的规格。 - 示例: jdc jdfusion get-rds-accounts-by-inst-id --inst-id xxx + 示例: jdc jdfusion get-rds-specification --engine xxx ''', ) - def get_rds_accounts_by_inst_id(self): + def get_rds_specification(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetRdsAccountsByInstIdRequest import GetRdsAccountsByInstIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetRdsSpecificationRequest import GetRdsSpecificationRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetRdsAccountsByInstIdRequest(params_dict, headers) + req = GetRdsSpecificationRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1366,30 +1368,30 @@ def get_rds_accounts_by_inst_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), - (['--account'], dict(help="""(createRDSAccount) 创建RDS实例的账号信息 """, dest='account', required=True)), + (['--az'], dict(help="""(string) 可用区 """, dest='az', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据给定的信息,创建指定RDS实例的账户 ''', + help=''' 虚拟机规格列表 ''', description=''' - 根据给定的信息,创建指定RDS实例的账户。 + 虚拟机规格列表。 - 示例: jdc jdfusion create-rds-accounts --inst-id xxx --account '{"":""}' + 示例: jdc jdfusion get-vm-instance-types ''', ) - def create_rds_accounts(self): + def get_vm_instance_types(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateRdsAccountsRequest import CreateRdsAccountsRequest + from jdcloud_sdk.services.jdfusion.apis.GetVmInstanceTypesRequest import GetVmInstanceTypesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateRdsAccountsRequest(params_dict, headers) + req = GetVmInstanceTypesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1400,30 +1402,30 @@ def create_rds_accounts(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), - (['--account-name'], dict(help="""(string) 账号名称 """, dest='accountName', required=True)), + (['--id'], dict(help="""(string) 网卡 ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 取得指定RDS实例上的指定账号信息 ''', + help=''' 根据云提供商查询对应的网卡资源信息 ''', description=''' - 取得指定RDS实例上的指定账号信息。 + 根据云提供商查询对应的网卡资源信息。 - 示例: jdc jdfusion get-rds-accounts-by-inst-id-and-account-name --inst-id xxx --account-name xxx + 示例: jdc jdfusion get-vpc-network-interface-by-id --id xxx ''', ) - def get_rds_accounts_by_inst_id_and_account_name(self): + def get_vpc_network_interface_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetRdsAccountsByInstIdAndAccountNameRequest import GetRdsAccountsByInstIdAndAccountNameRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcNetworkInterfaceByIdRequest import GetVpcNetworkInterfaceByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetRdsAccountsByInstIdAndAccountNameRequest(params_dict, headers) + req = GetVpcNetworkInterfaceByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1434,30 +1436,30 @@ def get_rds_accounts_by_inst_id_and_account_name(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), - (['--account-name'], dict(help="""(string) 账号用户名 """, dest='accountName', required=True)), + (['--id'], dict(help="""(string) 网卡 ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除指定RDS实例上,指定用户名的账号信息 ''', + help=''' 删除弹性网卡 ''', description=''' - 删除指定RDS实例上,指定用户名的账号信息。 + 删除弹性网卡。 - 示例: jdc jdfusion delete-rds-account --inst-id xxx --account-name xxx + 示例: jdc jdfusion delete-vpc-network-interface-by-id --id xxx ''', ) - def delete_rds_account(self): + def delete_vpc_network_interface_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteRdsAccountRequest import DeleteRdsAccountRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteVpcNetworkInterfaceByIdRequest import DeleteVpcNetworkInterfaceByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteRdsAccountRequest(params_dict, headers) + req = DeleteVpcNetworkInterfaceByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1468,31 +1470,30 @@ def delete_rds_account(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), - (['--account-name'], dict(help="""(string) 账号名称 """, dest='accountName', required=True)), - (['--db-privilege-info'], dict(help="""(dbPrivilegeInfo) RDS账号对数据库的权限信息 """, dest='dbPrivilegeInfo', required=True)), + (['--vm-id'], dict(help="""(string) 云主机id """, dest='vmId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 给RDS账号分配数据库权限 ''', + help=''' 根据云提供商查询对应的网卡资源信息 ''', description=''' - 给RDS账号分配数据库权限。 + 根据云提供商查询对应的网卡资源信息。 - 示例: jdc jdfusion grant-rds-account --inst-id xxx --account-name xxx --db-privilege-info '{"":""}' + 示例: jdc jdfusion get-vpc-network-interfaces ''', ) - def grant_rds_account(self): + def get_vpc_network_interfaces(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GrantRdsAccountRequest import GrantRdsAccountRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcNetworkInterfacesRequest import GetVpcNetworkInterfacesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GrantRdsAccountRequest(params_dict, headers) + req = GetVpcNetworkInterfacesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1503,31 +1504,30 @@ def grant_rds_account(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), - (['--account-name'], dict(help="""(string) 账号名称 """, dest='accountName', required=True)), - (['--db-name'], dict(help="""(string) 数据库名称 """, dest='dbName', required=True)), + (['--net-interface'], dict(help="""(createNetInterface) 创建网卡 """, dest='netInterface', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 撤销RDS账号在指定数据库的所有权限 ''', + help=''' 根据云提供商创建网卡 ''', description=''' - 撤销RDS账号在指定数据库的所有权限。 + 根据云提供商创建网卡。 - 示例: jdc jdfusion revoke-rds-account --inst-id xxx --account-name xxx --db-name xxx + 示例: jdc jdfusion create-vpc-network-interface --net-interface '{"":""}' ''', ) - def revoke_rds_account(self): + def create_vpc_network_interface(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.RevokeRdsAccountRequest import RevokeRdsAccountRequest + from jdcloud_sdk.services.jdfusion.apis.CreateVpcNetworkInterfaceRequest import CreateVpcNetworkInterfaceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RevokeRdsAccountRequest(params_dict, headers) + req = CreateVpcNetworkInterfaceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1538,31 +1538,31 @@ def revoke_rds_account(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), - (['--account-name'], dict(help="""(string) 账号名称 """, dest='accountName', required=True)), - (['--info'], dict(help="""(dbPrivilegeInfo) RDS账号对数据库的权限信息 """, dest='info', required=True)), + (['--id'], dict(help="""(string) 网卡 ID """, dest='id', required=True)), + (['--attach'], dict(help="""(attachNetInterface) 网卡挂载虚拟机 """, dest='attach', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 通过异步任务,给RDS账号分配数据库权限 ''', + help=''' 网卡挂载虚拟机 ''', description=''' - 通过异步任务,给RDS账号分配数据库权限。 + 网卡挂载虚拟机。 - 示例: jdc jdfusion grant-rds-accounts-by-task --inst-id xxx --account-name xxx --info '{"":""}' + 示例: jdc jdfusion attach-vpc-network-interface-by-id --id xxx --attach '{"":""}' ''', ) - def grant_rds_accounts_by_task(self): + def attach_vpc_network_interface_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GrantRdsAccountsByTaskRequest import GrantRdsAccountsByTaskRequest + from jdcloud_sdk.services.jdfusion.apis.AttachVpcNetworkInterfaceByIdRequest import AttachVpcNetworkInterfaceByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GrantRdsAccountsByTaskRequest(params_dict, headers) + req = AttachVpcNetworkInterfaceByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1573,29 +1573,31 @@ def grant_rds_accounts_by_task(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), + (['--id'], dict(help="""(string) 网卡 ID """, dest='id', required=True)), + (['--detach'], dict(help="""(detachNetInterface) 卸载网卡 """, dest='detach', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据过滤条件,取得指定RDS实例上的数据库信息 ''', + help=''' 卸载网卡 ''', description=''' - 根据过滤条件,取得指定RDS实例上的数据库信息。 + 卸载网卡。 - 示例: jdc jdfusion get-rds-databases-by-inst-id --inst-id xxx + 示例: jdc jdfusion detach-vpc-network-interface-by-id --id xxx --detach '{"":""}' ''', ) - def get_rds_databases_by_inst_id(self): + def detach_vpc_network_interface_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetRdsDatabasesByInstIdRequest import GetRdsDatabasesByInstIdRequest + from jdcloud_sdk.services.jdfusion.apis.DetachVpcNetworkInterfaceByIdRequest import DetachVpcNetworkInterfaceByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetRdsDatabasesByInstIdRequest(params_dict, headers) + req = DetachVpcNetworkInterfaceByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1606,30 +1608,30 @@ def get_rds_databases_by_inst_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), - (['--database'], dict(help="""(createRDSDB) 创建RDS实例的数据库信息 """, dest='database', required=True)), + (['--vm-id'], dict(help="""(string) 云主机id """, dest='vmId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据给定的信息,创建指定RDS实例的数据库 ''', + help=''' 根据云提供商查询对应的云硬盘资源信息 ''', description=''' - 根据给定的信息,创建指定RDS实例的数据库。 + 根据云提供商查询对应的云硬盘资源信息。 - 示例: jdc jdfusion create-rds-database --inst-id xxx --database '{"":""}' + 示例: jdc jdfusion get-disks ''', ) - def create_rds_database(self): + def get_disks(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateRdsDatabaseRequest import CreateRdsDatabaseRequest + from jdcloud_sdk.services.jdfusion.apis.GetDisksRequest import GetDisksRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateRdsDatabaseRequest(params_dict, headers) + req = GetDisksRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1640,30 +1642,30 @@ def create_rds_database(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), - (['--db-name'], dict(help="""(string) 数据库名称 """, dest='dbName', required=True)), + (['--disk'], dict(help="""(createDataDisk) 创建云硬盘 """, dest='disk', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据过滤条件,取得指定RDS实例上的数据库信息 ''', + help=''' 根据云提供商创建云硬盘 ''', description=''' - 根据过滤条件,取得指定RDS实例上的数据库信息。 + 根据云提供商创建云硬盘。 - 示例: jdc jdfusion get-rds-database-by-inst-id-and-db-name --inst-id xxx --db-name xxx + 示例: jdc jdfusion create-disk --disk '{"":""}' ''', ) - def get_rds_database_by_inst_id_and_db_name(self): + def create_disk(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetRdsDatabaseByInstIdAndDbNameRequest import GetRdsDatabaseByInstIdAndDbNameRequest + from jdcloud_sdk.services.jdfusion.apis.CreateDiskRequest import CreateDiskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetRdsDatabaseByInstIdAndDbNameRequest(params_dict, headers) + req = CreateDiskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1674,30 +1676,30 @@ def get_rds_database_by_inst_id_and_db_name(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), - (['--db-name'], dict(help="""(string) 数据库名称 """, dest='dbName', required=True)), + (['--id'], dict(help="""(string) 云硬盘 ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除指定RDS实例上,指定数据库名的数据库信息 ''', + help=''' 根据云提供商查询对应的云硬盘资源信息 ''', description=''' - 删除指定RDS实例上,指定数据库名的数据库信息。 + 根据云提供商查询对应的云硬盘资源信息。 - 示例: jdc jdfusion delete-rds-database --inst-id xxx --db-name xxx + 示例: jdc jdfusion get-disk-by-id --id xxx ''', ) - def delete_rds_database(self): + def get_disk_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteRdsDatabaseRequest import DeleteRdsDatabaseRequest + from jdcloud_sdk.services.jdfusion.apis.GetDiskByIdRequest import GetDiskByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteRdsDatabaseRequest(params_dict, headers) + req = GetDiskByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1708,28 +1710,30 @@ def delete_rds_database(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--id'], dict(help="""(string) 云硬盘 ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的RDS实例信息 ''', + help=''' 删除云硬盘 ''', description=''' - 根据云提供商查询对应的RDS实例信息。 + 删除云硬盘。 - 示例: jdc jdfusion get-rds-instances + 示例: jdc jdfusion remove-disk-by-id --id xxx ''', ) - def get_rds_instances(self): + def remove_disk_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetRdsInstancesRequest import GetRdsInstancesRequest + from jdcloud_sdk.services.jdfusion.apis.RemoveDiskByIdRequest import RemoveDiskByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetRdsInstancesRequest(params_dict, headers) + req = RemoveDiskByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1740,29 +1744,66 @@ def get_rds_instances(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance'], dict(help="""(createRDSInstance) 创建RDS实例 """, dest='instance', required=True)), + (['--id'], dict(help="""(string) 云硬盘 ID """, dest='id', required=True)), + (['--attach'], dict(help="""(attachDataDisk) 云硬盘挂载至虚拟机 """, dest='attach', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据给定的信息,创建RDS实例 ''', + help=''' 云硬盘挂载至虚拟机 ''', description=''' - 根据给定的信息,创建RDS实例。 + 云硬盘挂载至虚拟机。 - 示例: jdc jdfusion create-rds-instance --instance '{"":""}' + 示例: jdc jdfusion attach-disk-to-vm-instance-by-disk-id --id xxx --attach '{"":""}' ''', ) - def create_rds_instance(self): + def attach_disk_to_vm_instance_by_disk_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateRdsInstanceRequest import CreateRdsInstanceRequest + from jdcloud_sdk.services.jdfusion.apis.AttachDiskToVmInstanceByDiskIdRequest import AttachDiskToVmInstanceByDiskIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateRdsInstanceRequest(params_dict, headers) + req = AttachDiskToVmInstanceByDiskIdRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--id'], dict(help="""(string) 云硬盘 ID """, dest='id', required=True)), + (['--detach'], dict(help="""(detachDataDisk) 从虚拟机卸载云硬盘 """, dest='detach', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 从虚拟机卸载云硬盘 ''', + description=''' + 从虚拟机卸载云硬盘。 + + 示例: jdc jdfusion detach-disk-to-vm-instance-by-disk-id --id xxx --detach '{"":""}' + ''', + ) + def detach_disk_to_vm_instance_by_disk_id(self): + client_factory = ClientFactory('jdfusion') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jdfusion.apis.DetachDiskToVmInstanceByDiskIdRequest import DetachDiskToVmInstanceByDiskIdRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DetachDiskToVmInstanceByDiskIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1775,27 +1816,28 @@ def create_rds_instance(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询指定ID的RDS实例信息 ''', + help=''' 根据过滤条件,取得指定RDS实例上的账号信息 ''', description=''' - 查询指定ID的RDS实例信息。 + 根据过滤条件,取得指定RDS实例上的账号信息。 - 示例: jdc jdfusion get-rds-by-inst-id --inst-id xxx + 示例: jdc jdfusion get-rds-accounts-by-inst-id --inst-id xxx ''', ) - def get_rds_by_inst_id(self): + def get_rds_accounts_by_inst_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetRdsByInstIdRequest import GetRdsByInstIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetRdsAccountsByInstIdRequest import GetRdsAccountsByInstIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetRdsByInstIdRequest(params_dict, headers) + req = GetRdsAccountsByInstIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1807,28 +1849,30 @@ def get_rds_by_inst_id(self): arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), + (['--account'], dict(help="""(createRDSAccount) 创建RDS实例的账号信息 """, dest='account', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除指定ID的RDS实例信息 ''', + help=''' 根据给定的信息,创建指定RDS实例的账户 ''', description=''' - 删除指定ID的RDS实例信息。 + 根据给定的信息,创建指定RDS实例的账户。 - 示例: jdc jdfusion delete-rds-by-inst-id --inst-id xxx + 示例: jdc jdfusion create-rds-accounts --inst-id xxx --account '{"":""}' ''', ) - def delete_rds_by_inst_id(self): + def create_rds_accounts(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteRdsByInstIdRequest import DeleteRdsByInstIdRequest + from jdcloud_sdk.services.jdfusion.apis.CreateRdsAccountsRequest import CreateRdsAccountsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteRdsByInstIdRequest(params_dict, headers) + req = CreateRdsAccountsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1839,28 +1883,31 @@ def delete_rds_by_inst_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), + (['--account-name'], dict(help="""(string) 账号名称 """, dest='accountName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询数据同步通道信息 ''', + help=''' 取得指定RDS实例上的指定账号信息 ''', description=''' - 查询数据同步通道信息。 + 取得指定RDS实例上的指定账号信息。 - 示例: jdc jdfusion get-channels + 示例: jdc jdfusion get-rds-accounts-by-inst-id-and-account-name --inst-id xxx --account-name xxx ''', ) - def get_channels(self): + def get_rds_accounts_by_inst_id_and_account_name(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetChannelsRequest import GetChannelsRequest + from jdcloud_sdk.services.jdfusion.apis.GetRdsAccountsByInstIdAndAccountNameRequest import GetRdsAccountsByInstIdAndAccountNameRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetChannelsRequest(params_dict, headers) + req = GetRdsAccountsByInstIdAndAccountNameRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1871,29 +1918,31 @@ def get_channels(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--channel'], dict(help="""(channelInfo) 创建channel """, dest='channel', required=True)), + (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), + (['--account-name'], dict(help="""(string) 账号用户名 """, dest='accountName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建数据同步通道 ''', + help=''' 删除指定RDS实例上,指定用户名的账号信息 ''', description=''' - 创建数据同步通道。 + 删除指定RDS实例上,指定用户名的账号信息。 - 示例: jdc jdfusion create-channel --channel '{"":""}' + 示例: jdc jdfusion delete-rds-account --inst-id xxx --account-name xxx ''', ) - def create_channel(self): + def delete_rds_account(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateChannelRequest import CreateChannelRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteRdsAccountRequest import DeleteRdsAccountRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateChannelRequest(params_dict, headers) + req = DeleteRdsAccountRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1904,29 +1953,32 @@ def create_channel(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) channel ID """, dest='id', required=True)), + (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), + (['--account-name'], dict(help="""(string) 账号名称 """, dest='accountName', required=True)), + (['--db-privilege-info'], dict(help="""(dbPrivilegeInfo) RDS账号对数据库的权限信息 """, dest='dbPrivilegeInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除channel ''', + help=''' 给RDS账号分配数据库权限 ''', description=''' - 删除channel。 + 给RDS账号分配数据库权限。 - 示例: jdc jdfusion delete-channel --id xxx + 示例: jdc jdfusion grant-rds-account --inst-id xxx --account-name xxx --db-privilege-info '{"":""}' ''', ) - def delete_channel(self): + def grant_rds_account(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteChannelRequest import DeleteChannelRequest + from jdcloud_sdk.services.jdfusion.apis.GrantRdsAccountRequest import GrantRdsAccountRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteChannelRequest(params_dict, headers) + req = GrantRdsAccountRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1937,29 +1989,32 @@ def delete_channel(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) channel ID """, dest='id', required=True)), + (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), + (['--account-name'], dict(help="""(string) 账号名称 """, dest='accountName', required=True)), + (['--db-name'], dict(help="""(string) 数据库名称 """, dest='dbName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启动数据同步 ''', + help=''' 撤销RDS账号在指定数据库的所有权限 ''', description=''' - 启动数据同步。 + 撤销RDS账号在指定数据库的所有权限。 - 示例: jdc jdfusion start-channel --id xxx + 示例: jdc jdfusion revoke-rds-account --inst-id xxx --account-name xxx --db-name xxx ''', ) - def start_channel(self): + def revoke_rds_account(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.StartChannelRequest import StartChannelRequest + from jdcloud_sdk.services.jdfusion.apis.RevokeRdsAccountRequest import RevokeRdsAccountRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartChannelRequest(params_dict, headers) + req = RevokeRdsAccountRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1970,29 +2025,32 @@ def start_channel(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) channel ID """, dest='id', required=True)), + (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), + (['--account-name'], dict(help="""(string) 账号名称 """, dest='accountName', required=True)), + (['--info'], dict(help="""(dbPrivilegeInfo) RDS账号对数据库的权限信息 """, dest='info', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 停止数据同步 ''', + help=''' 通过异步任务,给RDS账号分配数据库权限 ''', description=''' - 停止数据同步。 + 通过异步任务,给RDS账号分配数据库权限。 - 示例: jdc jdfusion stop-channel --id xxx + 示例: jdc jdfusion grant-rds-accounts-by-task --inst-id xxx --account-name xxx --info '{"":""}' ''', ) - def stop_channel(self): + def grant_rds_accounts_by_task(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.StopChannelRequest import StopChannelRequest + from jdcloud_sdk.services.jdfusion.apis.GrantRdsAccountsByTaskRequest import GrantRdsAccountsByTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopChannelRequest(params_dict, headers) + req = GrantRdsAccountsByTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2004,27 +2062,28 @@ def stop_channel(self): arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询数据源 ''', + help=''' 根据云提供商查询对应的公网IP资源信息 ''', description=''' - 查询数据源。 + 根据云提供商查询对应的公网IP资源信息。 - 示例: jdc jdfusion get-datasources + 示例: jdc jdfusion get-vpc-eips ''', ) - def get_datasources(self): + def get_vpc_eips(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetDatasourcesRequest import GetDatasourcesRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcEipsRequest import GetVpcEipsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDatasourcesRequest(params_dict, headers) + req = GetVpcEipsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2035,29 +2094,30 @@ def get_datasources(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--datasource'], dict(help="""(datasourceInfo) 创建数据源 """, dest='datasource', required=True)), + (['--allocate'], dict(help="""(allocateEipAddress) 分配弹性公网ip """, dest='allocate', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建数据源 ''', + help=''' 根据云提供商分配公网IP ''', description=''' - 创建数据源。 + 根据云提供商分配公网IP。 - 示例: jdc jdfusion create-datasource --datasource '{"":""}' + 示例: jdc jdfusion create-vpc-eip --allocate '{"":""}' ''', ) - def create_datasource(self): + def create_vpc_eip(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateDatasourceRequest import CreateDatasourceRequest + from jdcloud_sdk.services.jdfusion.apis.CreateVpcEipRequest import CreateVpcEipRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateDatasourceRequest(params_dict, headers) + req = CreateVpcEipRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2068,29 +2128,30 @@ def create_datasource(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) channel ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) 公网IP ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除数据源 ''', + help=''' 根据云提供商查询对应的公网IP资源信息 ''', description=''' - 删除数据源。 + 根据云提供商查询对应的公网IP资源信息。 - 示例: jdc jdfusion delete-datasource --id xxx + 示例: jdc jdfusion get-vpc-eip-by-id --id xxx ''', ) - def delete_datasource(self): + def get_vpc_eip_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteDatasourceRequest import DeleteDatasourceRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcEipByIdRequest import GetVpcEipByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteDatasourceRequest(params_dict, headers) + req = GetVpcEipByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2101,29 +2162,30 @@ def delete_datasource(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--engine'], dict(help="""(string) RDS数据库引擎,目前只支持mysql """, dest='engine', required=True)), + (['--id'], dict(help="""(string) 公网IP ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据数据库类型,取得RDS实例的规格 ''', + help=''' 释放公网IP ''', description=''' - 根据数据库类型,取得RDS实例的规格。 + 释放公网IP。 - 示例: jdc jdfusion get-rds-specification --engine xxx + 示例: jdc jdfusion delete-vpc-eip-by-id --id xxx ''', ) - def get_rds_specification(self): + def delete_vpc_eip_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetRdsSpecificationRequest import GetRdsSpecificationRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteVpcEipByIdRequest import DeleteVpcEipByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetRdsSpecificationRequest(params_dict, headers) + req = DeleteVpcEipByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2134,28 +2196,31 @@ def get_rds_specification(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--id'], dict(help="""(string) 公网IP ID """, dest='id', required=True)), + (['--associate'], dict(help="""(associateEipAddress) 弹性公网IP绑定到虚拟机 """, dest='associate', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询地域列表信息 ''', + help=''' 弹性公网IP绑定到虚拟机 ''', description=''' - 查询地域列表信息。 + 弹性公网IP绑定到虚拟机。 - 示例: jdc jdfusion get-regions + 示例: jdc jdfusion associate-vpc-eip-by-id --id xxx --associate '{"":""}' ''', ) - def get_regions(self): + def associate_vpc_eip_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetRegionsRequest import GetRegionsRequest + from jdcloud_sdk.services.jdfusion.apis.AssociateVpcEipByIdRequest import AssociateVpcEipByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetRegionsRequest(params_dict, headers) + req = AssociateVpcEipByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2166,29 +2231,31 @@ def get_regions(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--region'], dict(help="""(string) 区域id """, dest='region', required=True)), + (['--id'], dict(help="""(string) 公网IP ID """, dest='id', required=True)), + (['--unassociate'], dict(help="""(unassociateEipAddress) 解绑公网IP """, dest='unassociate', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询可用域列表信息 ''', + help=''' 解绑公网IP ''', description=''' - 查询可用域列表信息。 + 解绑公网IP。 - 示例: jdc jdfusion get-regions-available-zones --region xxx + 示例: jdc jdfusion disassociate-vpc-eip-by-id --id xxx --unassociate '{"":""}' ''', ) - def get_regions_available_zones(self): + def disassociate_vpc_eip_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetRegionsAvailableZonesRequest import GetRegionsAvailableZonesRequest + from jdcloud_sdk.services.jdfusion.apis.DisassociateVpcEipByIdRequest import DisassociateVpcEipByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetRegionsAvailableZonesRequest(params_dict, headers) + req = DisassociateVpcEipByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2201,6 +2268,7 @@ def get_regions_available_zones(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--task'], dict(help="""(string) 执行请求 ID """, dest='task', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2235,6 +2303,7 @@ def get_task_info_history_by_id(self): (['--task'], dict(help="""(string) 执行请求 ID """, dest='task', required=True)), (['--file-name'], dict(help="""(string) 执行文件名称 """, dest='fileName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2266,29 +2335,29 @@ def get_task_info_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--image-source'], dict(help="""(string) 镜像来源: system:系统官方公共镜像。 self:用户自定义镜像。 others:用户共享的镜像。 marketplace:镜像市场云市场 提供的镜像。 """, dest='imageSource', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据过滤条件,取得镜像资源的信息 ''', + help=''' 获取任务列表 ''', description=''' - 根据过滤条件,取得镜像资源的信息。 + 获取任务列表。 - 示例: jdc jdfusion get-vm-images + 示例: jdc jdfusion get-transfer-tasks ''', ) - def get_vm_images(self): + def get_transfer_tasks(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVmImagesRequest import GetVmImagesRequest + from jdcloud_sdk.services.jdfusion.apis.GetTransferTasksRequest import GetTransferTasksRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVmImagesRequest(params_dict, headers) + req = GetTransferTasksRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2299,29 +2368,30 @@ def get_vm_images(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 资源实例ID """, dest='id', required=True)), + (['--task'], dict(help="""(transferSimpleTaskInfo) NA """, dest='task', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的VM资源信息 ''', + help=''' 创建任务 ''', description=''' - 根据云提供商查询对应的VM资源信息。 + 创建任务。 - 示例: jdc jdfusion get-vm-instances-by-id --id xxx + 示例: jdc jdfusion create-transfer-task ''', ) - def get_vm_instances_by_id(self): + def create_transfer_task(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVmInstancesByIdRequest import GetVmInstancesByIdRequest + from jdcloud_sdk.services.jdfusion.apis.CreateTransferTaskRequest import CreateTransferTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVmInstancesByIdRequest(params_dict, headers) + req = CreateTransferTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2332,29 +2402,30 @@ def get_vm_instances_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 资源实例ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) 用户ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 通过虚拟机id删除虚拟机 ''', + help=''' 根据指定ID获取任务信息 ''', description=''' - 通过虚拟机id删除虚拟机。 + 根据指定ID获取任务信息。 - 示例: jdc jdfusion delete-vm-instance-by-id --id xxx + 示例: jdc jdfusion get-transfer-task-by-id --id xxx ''', ) - def delete_vm_instance_by_id(self): + def get_transfer_task_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteVmInstanceByIdRequest import DeleteVmInstanceByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetTransferTaskByIdRequest import GetTransferTaskByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVmInstanceByIdRequest(params_dict, headers) + req = GetTransferTaskByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2365,28 +2436,31 @@ def delete_vm_instance_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--id'], dict(help="""(string) 任务ID """, dest='id', required=True)), + (['--task'], dict(help="""(transferTaskInfo) NA """, dest='task', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的虚拟机资源信息 ''', + help=''' 根据指定ID修改任务 ''', description=''' - 根据云提供商查询对应的虚拟机资源信息。 + 根据指定ID修改任务。 - 示例: jdc jdfusion get-vm-instances + 示例: jdc jdfusion edit-transfer-task --id xxx ''', ) - def get_vm_instances(self): + def edit_transfer_task(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVmInstancesRequest import GetVmInstancesRequest + from jdcloud_sdk.services.jdfusion.apis.EditTransferTaskRequest import EditTransferTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVmInstancesRequest(params_dict, headers) + req = EditTransferTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2397,29 +2471,30 @@ def get_vm_instances(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--vm'], dict(help="""(createVm) 创建VM """, dest='vm', required=True)), + (['--id'], dict(help="""(string) 任务ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商创建虚拟机 ''', + help=''' 根据指定ID删除任务 ''', description=''' - 根据云提供商创建虚拟机。 + 根据指定ID删除任务。 - 示例: jdc jdfusion create-vm-instance --vm '{"":""}' + 示例: jdc jdfusion delete-transfer-task --id xxx ''', ) - def create_vm_instance(self): + def delete_transfer_task(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateVmInstanceRequest import CreateVmInstanceRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteTransferTaskRequest import DeleteTransferTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVmInstanceRequest(params_dict, headers) + req = DeleteTransferTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2430,29 +2505,30 @@ def create_vm_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 资源实例ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) 用户ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 停止运行一台实例。只有状态为 运行中(Running)的实例才可以进行此操作。 ''', + help=''' 根据指定ID启动任务 ''', description=''' - 停止运行一台实例。只有状态为 运行中(Running)的实例才可以进行此操作。。 + 根据指定ID启动任务。 - 示例: jdc jdfusion stop-vm-instance-by-id --id xxx + 示例: jdc jdfusion start-transfer-task --id xxx ''', ) - def stop_vm_instance_by_id(self): + def start_transfer_task(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.StopVmInstanceByIdRequest import StopVmInstanceByIdRequest + from jdcloud_sdk.services.jdfusion.apis.StartTransferTaskRequest import StartTransferTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopVmInstanceByIdRequest(params_dict, headers) + req = StartTransferTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2463,29 +2539,30 @@ def stop_vm_instance_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 资源实例ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) 用户ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启动一台实例。实例状态必须为 已停止(Stopped),才可以调用该接口。 ''', + help=''' 根据指定ID停止任务 ''', description=''' - 启动一台实例。实例状态必须为 已停止(Stopped),才可以调用该接口。。 + 根据指定ID停止任务。 - 示例: jdc jdfusion start-vm-instance-by-id --id xxx + 示例: jdc jdfusion stop-transfer-task --id xxx ''', ) - def start_vm_instance_by_id(self): + def stop_transfer_task(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.StartVmInstanceByIdRequest import StartVmInstanceByIdRequest + from jdcloud_sdk.services.jdfusion.apis.StopTransferTaskRequest import StopTransferTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartVmInstanceByIdRequest(params_dict, headers) + req = StopTransferTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2496,29 +2573,30 @@ def start_vm_instance_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 资源实例ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) 任务ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 只能重启状态为 运行中(Running)的实例。 ''', + help=''' 根据指定任务id查询迁移进度 ''', description=''' - 只能重启状态为 运行中(Running)的实例。。 + 根据指定任务id查询迁移进度。 - 示例: jdc jdfusion reboot-vm-instance-by-id --id xxx + 示例: jdc jdfusion get-transfer-task-progress --id xxx ''', ) - def reboot_vm_instance_by_id(self): + def get_transfer_task_progress(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.RebootVmInstanceByIdRequest import RebootVmInstanceByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetTransferTaskProgressRequest import GetTransferTaskProgressRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RebootVmInstanceByIdRequest(params_dict, headers) + req = GetTransferTaskProgressRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2529,29 +2607,30 @@ def reboot_vm_instance_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--az'], dict(help="""(string) 可用区 """, dest='az', required=False)), + (['--id'], dict(help="""(string) 任务ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 虚拟机规格列表 ''', + help=''' 根据指定任务id查询迁移失败文件列表 ''', description=''' - 虚拟机规格列表。 + 根据指定任务id查询迁移失败文件列表。 - 示例: jdc jdfusion get-vm-instance-types + 示例: jdc jdfusion get-transfer-task-failed-files --id xxx ''', ) - def get_vm_instance_types(self): + def get_transfer_task_failed_files(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVmInstanceTypesRequest import GetVmInstanceTypesRequest + from jdcloud_sdk.services.jdfusion.apis.GetTransferTaskFailedFilesRequest import GetTransferTaskFailedFilesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVmInstanceTypesRequest(params_dict, headers) + req = GetTransferTaskFailedFilesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2564,6 +2643,7 @@ def get_vm_instance_types(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--name'], dict(help="""(string) keypair name """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2597,6 +2677,7 @@ def get_vm_keypairs_by_name(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--name'], dict(help="""(string) keypair name """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2629,6 +2710,7 @@ def delete_vm_keypair_by_name(self): arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2662,6 +2744,7 @@ def get_vm_keypairs(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--keypair'], dict(help="""(createKeypair) 创建keypair """, dest='keypair', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2693,28 +2776,30 @@ def create_vm_keypair(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--id'], dict(help="""(string) SecurityGroup ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的公网IP资源信息 ''', + help=''' 查询指定的安全组资源信息 ''', description=''' - 根据云提供商查询对应的公网IP资源信息。 + 查询指定的安全组资源信息。 - 示例: jdc jdfusion get-vpc-eips + 示例: jdc jdfusion get-vpc-security-group-by-id --id xxx ''', ) - def get_vpc_eips(self): + def get_vpc_security_group_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcEipsRequest import GetVpcEipsRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcSecurityGroupByIdRequest import GetVpcSecurityGroupByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcEipsRequest(params_dict, headers) + req = GetVpcSecurityGroupByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2725,29 +2810,30 @@ def get_vpc_eips(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--allocate'], dict(help="""(allocateEipAddress) 分配弹性公网ip """, dest='allocate', required=True)), + (['--id'], dict(help="""(string) SecurityGroup ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商分配公网IP ''', + help=''' 删除安全组 ''', description=''' - 根据云提供商分配公网IP。 + 删除安全组。 - 示例: jdc jdfusion create-vpc-eip --allocate '{"":""}' + 示例: jdc jdfusion delete-vpc-security-group-by-id --id xxx ''', ) - def create_vpc_eip(self): + def delete_vpc_security_group_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateVpcEipRequest import CreateVpcEipRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteVpcSecurityGroupByIdRequest import DeleteVpcSecurityGroupByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVpcEipRequest(params_dict, headers) + req = DeleteVpcSecurityGroupByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2758,29 +2844,29 @@ def create_vpc_eip(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 公网IP ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的公网IP资源信息 ''', + help=''' 根据云提供商查询对应的安全组资源信息 ''', description=''' - 根据云提供商查询对应的公网IP资源信息。 + 根据云提供商查询对应的安全组资源信息。 - 示例: jdc jdfusion get-vpc-eip-by-id --id xxx + 示例: jdc jdfusion get-vpc-security-groups ''', ) - def get_vpc_eip_by_id(self): + def get_vpc_security_groups(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcEipByIdRequest import GetVpcEipByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcSecurityGroupsRequest import GetVpcSecurityGroupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcEipByIdRequest(params_dict, headers) + req = GetVpcSecurityGroupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2791,29 +2877,30 @@ def get_vpc_eip_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 公网IP ID """, dest='id', required=True)), + (['--security-group'], dict(help="""(createSecurityGroup) 创建securityGroup """, dest='securityGroup', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 释放公网IP ''', + help=''' 根据云提供商创建安全组 ''', description=''' - 释放公网IP。 + 根据云提供商创建安全组。 - 示例: jdc jdfusion delete-vpc-eip-by-id --id xxx + 示例: jdc jdfusion create-vpc-security-group --security-group '{"":""}' ''', ) - def delete_vpc_eip_by_id(self): + def create_vpc_security_group(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteVpcEipByIdRequest import DeleteVpcEipByIdRequest + from jdcloud_sdk.services.jdfusion.apis.CreateVpcSecurityGroupRequest import CreateVpcSecurityGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVpcEipByIdRequest(params_dict, headers) + req = CreateVpcSecurityGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2824,30 +2911,31 @@ def delete_vpc_eip_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 公网IP ID """, dest='id', required=True)), - (['--associate'], dict(help="""(associateEipAddress) 弹性公网IP绑定到虚拟机 """, dest='associate', required=True)), + (['--id'], dict(help="""(string) 安全组ID """, dest='id', required=True)), + (['--sg-rule'], dict(help="""(createSgRule) 新增安全组规则 """, dest='sgRule', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 弹性公网IP绑定到虚拟机 ''', + help=''' 新增安全组规则 ''', description=''' - 弹性公网IP绑定到虚拟机。 + 新增安全组规则。 - 示例: jdc jdfusion associate-vpc-eip-by-id --id xxx --associate '{"":""}' + 示例: jdc jdfusion create-security-groups-rule --id xxx --sg-rule '{"":""}' ''', ) - def associate_vpc_eip_by_id(self): + def create_security_groups_rule(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.AssociateVpcEipByIdRequest import AssociateVpcEipByIdRequest + from jdcloud_sdk.services.jdfusion.apis.CreateSecurityGroupsRuleRequest import CreateSecurityGroupsRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AssociateVpcEipByIdRequest(params_dict, headers) + req = CreateSecurityGroupsRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2858,30 +2946,38 @@ def associate_vpc_eip_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 公网IP ID """, dest='id', required=True)), - (['--unassociate'], dict(help="""(unassociateEipAddress) 解绑公网IP """, dest='unassociate', required=True)), + (['--id'], dict(help="""(string) 安全组ID """, dest='id', required=True)), + (['--rule-type'], dict(help="""(string) 规则类型,ingress、egress """, dest='ruleType', required=True)), + (['--protocol'], dict(help="""(string) 协议,tcp、udp、icmp 或者 all """, dest='protocol', required=True)), + (['--from-port'], dict(help="""(string) 起始端口 """, dest='fromPort', required=True)), + (['--to-port'], dict(help="""(string) 终止端口 """, dest='toPort', required=True)), + (['--nic-type'], dict(help="""(string) 网络类型,internet、intranet """, dest='nicType', required=False)), + (['--policy'], dict(help="""(string) 认证策略,accept、drop """, dest='policy', required=False)), + (['--priority'], dict(help="""(string) 认证策略的权重,1-100 """, dest='priority', required=False)), + (['--cidr-ip'], dict(help="""(string) 目标IP地址范围 """, dest='cidrIp', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 解绑公网IP ''', + help=''' 删除安全组规则 ''', description=''' - 解绑公网IP。 + 删除安全组规则。 - 示例: jdc jdfusion disassociate-vpc-eip-by-id --id xxx --unassociate '{"":""}' + 示例: jdc jdfusion delete-security-groups-rule --id xxx --rule-type xxx --protocol xxx --from-port xxx --to-port xxx ''', ) - def disassociate_vpc_eip_by_id(self): + def delete_security_groups_rule(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DisassociateVpcEipByIdRequest import DisassociateVpcEipByIdRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteSecurityGroupsRuleRequest import DeleteSecurityGroupsRuleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisassociateVpcEipByIdRequest(params_dict, headers) + req = DeleteSecurityGroupsRuleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2894,6 +2990,7 @@ def disassociate_vpc_eip_by_id(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--slbid'], dict(help="""(string) 负载均衡id """, dest='slbid', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2927,6 +3024,7 @@ def get_lb_http_listener(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--http-listener'], dict(help="""(createLoadBalancerHTTPListener) 创建HTTP监听器 """, dest='httpListener', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -2958,29 +3056,30 @@ def create_vpc_lbhttp_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 网卡 ID """, dest='id', required=True)), + (['--image-source'], dict(help="""(string) 镜像来源: system:系统官方公共镜像。 self:用户自定义镜像。 others:用户共享的镜像。 marketplace:镜像市场云市场 提供的镜像。 """, dest='imageSource', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的网卡资源信息 ''', + help=''' 根据过滤条件,取得镜像资源的信息 ''', description=''' - 根据云提供商查询对应的网卡资源信息。 + 根据过滤条件,取得镜像资源的信息。 - 示例: jdc jdfusion get-vpc-network-interface-by-id --id xxx + 示例: jdc jdfusion get-vm-images ''', ) - def get_vpc_network_interface_by_id(self): + def get_vm_images(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcNetworkInterfaceByIdRequest import GetVpcNetworkInterfaceByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetVmImagesRequest import GetVmImagesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcNetworkInterfaceByIdRequest(params_dict, headers) + req = GetVmImagesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2991,29 +3090,30 @@ def get_vpc_network_interface_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 网卡 ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) VPC ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除弹性网卡 ''', + help=''' 根据云提供商查询对应的subnet资源信息 ''', description=''' - 删除弹性网卡。 + 根据云提供商查询对应的subnet资源信息。 - 示例: jdc jdfusion delete-vpc-network-interface-by-id --id xxx + 示例: jdc jdfusion get-vpc-subnet-by-id --id xxx ''', ) - def delete_vpc_network_interface_by_id(self): + def get_vpc_subnet_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteVpcNetworkInterfaceByIdRequest import DeleteVpcNetworkInterfaceByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcSubnetByIdRequest import GetVpcSubnetByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVpcNetworkInterfaceByIdRequest(params_dict, headers) + req = GetVpcSubnetByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3024,29 +3124,30 @@ def delete_vpc_network_interface_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--vm-id'], dict(help="""(string) 云主机id """, dest='vmId', required=False)), + (['--id'], dict(help="""(string) VPC ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的网卡资源信息 ''', + help=''' 删除子网 ''', description=''' - 根据云提供商查询对应的网卡资源信息。 + 删除子网。 - 示例: jdc jdfusion get-vpc-network-interfaces + 示例: jdc jdfusion delete-vpc-subnet-by-id --id xxx ''', ) - def get_vpc_network_interfaces(self): + def delete_vpc_subnet_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcNetworkInterfacesRequest import GetVpcNetworkInterfacesRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteVpcSubnetByIdRequest import DeleteVpcSubnetByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcNetworkInterfacesRequest(params_dict, headers) + req = DeleteVpcSubnetByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3057,29 +3158,29 @@ def get_vpc_network_interfaces(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--net-interface'], dict(help="""(createNetInterface) 创建网卡 """, dest='netInterface', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商创建网卡 ''', + help=''' 根据云提供商查询对应的subnet资源信息 ''', description=''' - 根据云提供商创建网卡。 + 根据云提供商查询对应的subnet资源信息。 - 示例: jdc jdfusion create-vpc-network-interface --net-interface '{"":""}' + 示例: jdc jdfusion get-vpc-subnets ''', ) - def create_vpc_network_interface(self): + def get_vpc_subnets(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateVpcNetworkInterfaceRequest import CreateVpcNetworkInterfaceRequest + from jdcloud_sdk.services.jdfusion.apis.GetVpcSubnetsRequest import GetVpcSubnetsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVpcNetworkInterfaceRequest(params_dict, headers) + req = GetVpcSubnetsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3090,30 +3191,30 @@ def create_vpc_network_interface(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 网卡 ID """, dest='id', required=True)), - (['--attach'], dict(help="""(attachNetInterface) 网卡挂载虚拟机 """, dest='attach', required=True)), + (['--subnet'], dict(help="""(createSubnet) 创建subnet """, dest='subnet', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 网卡挂载虚拟机 ''', + help=''' 根据云提供商创建子网 ''', description=''' - 网卡挂载虚拟机。 + 根据云提供商创建子网。 - 示例: jdc jdfusion attach-vpc-network-interface-by-id --id xxx --attach '{"":""}' + 示例: jdc jdfusion create-vpc-subnet --subnet '{"":""}' ''', ) - def attach_vpc_network_interface_by_id(self): + def create_vpc_subnet(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.AttachVpcNetworkInterfaceByIdRequest import AttachVpcNetworkInterfaceByIdRequest + from jdcloud_sdk.services.jdfusion.apis.CreateVpcSubnetRequest import CreateVpcSubnetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AttachVpcNetworkInterfaceByIdRequest(params_dict, headers) + req = CreateVpcSubnetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3124,30 +3225,29 @@ def attach_vpc_network_interface_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 网卡 ID """, dest='id', required=True)), - (['--detach'], dict(help="""(detachNetInterface) 卸载网卡 """, dest='detach', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 卸载网卡 ''', + help=''' 根据云提供商查询对应的RDS实例信息 ''', description=''' - 卸载网卡。 + 根据云提供商查询对应的RDS实例信息。 - 示例: jdc jdfusion detach-vpc-network-interface-by-id --id xxx --detach '{"":""}' + 示例: jdc jdfusion get-rds-instances ''', ) - def detach_vpc_network_interface_by_id(self): + def get_rds_instances(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DetachVpcNetworkInterfaceByIdRequest import DetachVpcNetworkInterfaceByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetRdsInstancesRequest import GetRdsInstancesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DetachVpcNetworkInterfaceByIdRequest(params_dict, headers) + req = GetRdsInstancesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3158,29 +3258,30 @@ def detach_vpc_network_interface_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) SecurityGroup ID """, dest='id', required=True)), + (['--instance'], dict(help="""(createRDSInstance) 创建RDS实例 """, dest='instance', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询指定的安全组资源信息 ''', + help=''' 根据给定的信息,创建RDS实例 ''', description=''' - 查询指定的安全组资源信息。 + 根据给定的信息,创建RDS实例。 - 示例: jdc jdfusion get-vpc-security-group-by-id --id xxx + 示例: jdc jdfusion create-rds-instance --instance '{"":""}' ''', ) - def get_vpc_security_group_by_id(self): + def create_rds_instance(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcSecurityGroupByIdRequest import GetVpcSecurityGroupByIdRequest + from jdcloud_sdk.services.jdfusion.apis.CreateRdsInstanceRequest import CreateRdsInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcSecurityGroupByIdRequest(params_dict, headers) + req = CreateRdsInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3191,29 +3292,30 @@ def get_vpc_security_group_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) SecurityGroup ID """, dest='id', required=True)), + (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除安全组 ''', + help=''' 查询指定ID的RDS实例信息 ''', description=''' - 删除安全组。 + 查询指定ID的RDS实例信息。 - 示例: jdc jdfusion delete-vpc-security-group-by-id --id xxx + 示例: jdc jdfusion get-rds-by-inst-id --inst-id xxx ''', ) - def delete_vpc_security_group_by_id(self): + def get_rds_by_inst_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteVpcSecurityGroupByIdRequest import DeleteVpcSecurityGroupByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetRdsByInstIdRequest import GetRdsByInstIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVpcSecurityGroupByIdRequest(params_dict, headers) + req = GetRdsByInstIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3224,28 +3326,30 @@ def delete_vpc_security_group_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--inst-id'], dict(help="""(string) RDS实例ID """, dest='instId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的安全组资源信息 ''', + help=''' 删除指定ID的RDS实例信息 ''', description=''' - 根据云提供商查询对应的安全组资源信息。 + 删除指定ID的RDS实例信息。 - 示例: jdc jdfusion get-vpc-security-groups + 示例: jdc jdfusion delete-rds-by-inst-id --inst-id xxx ''', ) - def get_vpc_security_groups(self): + def delete_rds_by_inst_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcSecurityGroupsRequest import GetVpcSecurityGroupsRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteRdsByInstIdRequest import DeleteRdsByInstIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcSecurityGroupsRequest(params_dict, headers) + req = DeleteRdsByInstIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3256,29 +3360,29 @@ def get_vpc_security_groups(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--security-group'], dict(help="""(createSecurityGroup) 创建securityGroup """, dest='securityGroup', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商创建安全组 ''', + help=''' 查询部署信息列表 ''', description=''' - 根据云提供商创建安全组。 + 查询部署信息列表。 - 示例: jdc jdfusion create-vpc-security-group --security-group '{"":""}' + 示例: jdc jdfusion get-deployments ''', ) - def create_vpc_security_group(self): + def get_deployments(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateVpcSecurityGroupRequest import CreateVpcSecurityGroupRequest + from jdcloud_sdk.services.jdfusion.apis.GetDeploymentsRequest import GetDeploymentsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVpcSecurityGroupRequest(params_dict, headers) + req = GetDeploymentsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3289,30 +3393,30 @@ def create_vpc_security_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 安全组ID """, dest='id', required=True)), - (['--sg-rule'], dict(help="""(createSgRule) 新增安全组规则 """, dest='sgRule', required=True)), + (['--deployment'], dict(help="""(deploymentInfo) 创建deployment """, dest='deployment', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 新增安全组规则 ''', + help=''' 创建部署信息 ''', description=''' - 新增安全组规则。 + 创建部署信息。 - 示例: jdc jdfusion create-security-groups-rule --id xxx --sg-rule '{"":""}' + 示例: jdc jdfusion create-deployment --deployment '{"":""}' ''', ) - def create_security_groups_rule(self): + def create_deployment(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateSecurityGroupsRuleRequest import CreateSecurityGroupsRuleRequest + from jdcloud_sdk.services.jdfusion.apis.CreateDeploymentRequest import CreateDeploymentRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateSecurityGroupsRuleRequest(params_dict, headers) + req = CreateDeploymentRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3323,37 +3427,30 @@ def create_security_groups_rule(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 安全组ID """, dest='id', required=True)), - (['--rule-type'], dict(help="""(string) 规则类型,ingress、egress """, dest='ruleType', required=True)), - (['--protocol'], dict(help="""(string) 协议,tcp、udp、icmp 或者 all """, dest='protocol', required=True)), - (['--from-port'], dict(help="""(string) 起始端口 """, dest='fromPort', required=True)), - (['--to-port'], dict(help="""(string) 终止端口 """, dest='toPort', required=True)), - (['--nic-type'], dict(help="""(string) 网络类型,internet、intranet """, dest='nicType', required=False)), - (['--policy'], dict(help="""(string) 认证策略,accept、drop """, dest='policy', required=False)), - (['--priority'], dict(help="""(string) 认证策略的权重,1-100 """, dest='priority', required=False)), - (['--cidr-ip'], dict(help="""(string) 目标IP地址范围 """, dest='cidrIp', required=False)), + (['--reverse'], dict(help="""(reverseDeploymentInfo) 根据已有资源反向生成deployment """, dest='reverse', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除安全组规则 ''', + help=''' 根据已有资源反向生成deployment ''', description=''' - 删除安全组规则。 + 根据已有资源反向生成deployment。 - 示例: jdc jdfusion delete-security-groups-rule --id xxx --rule-type xxx --protocol xxx --from-port xxx --to-port xxx + 示例: jdc jdfusion reverse-deployment --reverse '{"":""}' ''', ) - def delete_security_groups_rule(self): + def reverse_deployment(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteSecurityGroupsRuleRequest import DeleteSecurityGroupsRuleRequest + from jdcloud_sdk.services.jdfusion.apis.ReverseDeploymentRequest import ReverseDeploymentRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteSecurityGroupsRuleRequest(params_dict, headers) + req = ReverseDeploymentRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3364,29 +3461,30 @@ def delete_security_groups_rule(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) LB ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的SLB资源信息 ''', + help=''' 查询部署信息 ''', description=''' - 根据云提供商查询对应的SLB资源信息。 + 查询部署信息。 - 示例: jdc jdfusion get-vpc-slb-by-id --id xxx + 示例: jdc jdfusion get-deployments-by-id --id xxx ''', ) - def get_vpc_slb_by_id(self): + def get_deployments_by_id(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcSlbByIdRequest import GetVpcSlbByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetDeploymentsByIdRequest import GetDeploymentsByIdRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcSlbByIdRequest(params_dict, headers) + req = GetDeploymentsByIdRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3397,29 +3495,31 @@ def get_vpc_slb_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) LB ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), + (['--deployment'], dict(help="""(deploymentInfo) 修改deployment """, dest='deployment', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除SLB ''', + help=''' 修改部署信息 ''', description=''' - 删除SLB。 + 修改部署信息。 - 示例: jdc jdfusion delete-vpc-slb-by-id --id xxx + 示例: jdc jdfusion edit-deployment --id xxx --deployment '{"":""}' ''', ) - def delete_vpc_slb_by_id(self): + def edit_deployment(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteVpcSlbByIdRequest import DeleteVpcSlbByIdRequest + from jdcloud_sdk.services.jdfusion.apis.EditDeploymentRequest import EditDeploymentRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVpcSlbByIdRequest(params_dict, headers) + req = EditDeploymentRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3430,28 +3530,30 @@ def delete_vpc_slb_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的负载均衡资源信息 ''', + help=''' 删除部署信息 ''', description=''' - 根据云提供商查询对应的负载均衡资源信息。 + 删除部署信息。 - 示例: jdc jdfusion get-vpc-slbs + 示例: jdc jdfusion delete-deployment --id xxx ''', ) - def get_vpc_slbs(self): + def delete_deployment(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcSlbsRequest import GetVpcSlbsRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteDeploymentRequest import DeleteDeploymentRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcSlbsRequest(params_dict, headers) + req = DeleteDeploymentRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3462,29 +3564,31 @@ def get_vpc_slbs(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--slb'], dict(help="""(slbInfo) 创建SLB """, dest='slb', required=True)), + (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), + (['--deployment'], dict(help="""(deployment) 创建deployment """, dest='deployment', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商创建负载均衡 ''', + help=''' 克隆部署信息 ''', description=''' - 根据云提供商创建负载均衡。 + 克隆部署信息。 - 示例: jdc jdfusion create-vpc-slb --slb '{"":""}' + 示例: jdc jdfusion clone-deployment --id xxx --deployment '{"":""}' ''', ) - def create_vpc_slb(self): + def clone_deployment(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateVpcSlbRequest import CreateVpcSlbRequest + from jdcloud_sdk.services.jdfusion.apis.CloneDeploymentRequest import CloneDeploymentRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVpcSlbRequest(params_dict, headers) + req = CloneDeploymentRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3495,29 +3599,30 @@ def create_vpc_slb(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) LB ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启动负载均衡 ''', + help=''' 预部署 ''', description=''' - 启动负载均衡。 + 预部署。 - 示例: jdc jdfusion start-slb --id xxx + 示例: jdc jdfusion dryrun-deployment --id xxx ''', ) - def start_slb(self): + def dryrun_deployment(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.StartSlbRequest import StartSlbRequest + from jdcloud_sdk.services.jdfusion.apis.DryrunDeploymentRequest import DryrunDeploymentRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartSlbRequest(params_dict, headers) + req = DryrunDeploymentRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3528,29 +3633,31 @@ def start_slb(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) LB ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), + (['--apply'], dict(help="""(apply) 应用部署 """, dest='apply', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 停止负载均衡 ''', + help=''' 应用部署 ''', description=''' - 停止负载均衡。 + 应用部署。 - 示例: jdc jdfusion stop-slb --id xxx + 示例: jdc jdfusion apply-deployment --id xxx --apply '{"":""}' ''', ) - def stop_slb(self): + def apply_deployment(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.StopSlbRequest import StopSlbRequest + from jdcloud_sdk.services.jdfusion.apis.ApplyDeploymentRequest import ApplyDeploymentRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopSlbRequest(params_dict, headers) + req = ApplyDeploymentRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3561,30 +3668,30 @@ def stop_slb(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 负载均衡id """, dest='id', required=True)), - (['--listener-port'], dict(help="""(int) 监听器端口 """, dest='listenerPort', type=int, required=True)), + (['--id'], dict(help="""(string) deployment ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除监听器 ''', + help=''' 查询执行结果 ''', description=''' - 删除监听器。 + 查询执行结果。 - 示例: jdc jdfusion delete-slbs-listener --id xxx --listener-port 0 + 示例: jdc jdfusion get-deployment-result --id xxx ''', ) - def delete_slbs_listener(self): + def get_deployment_result(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteSlbsListenerRequest import DeleteSlbsListenerRequest + from jdcloud_sdk.services.jdfusion.apis.GetDeploymentResultRequest import GetDeploymentResultRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteSlbsListenerRequest(params_dict, headers) + req = GetDeploymentResultRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3595,30 +3702,30 @@ def delete_slbs_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 负载均衡id """, dest='id', required=True)), - (['--listener-port'], dict(help="""(int) 监听器端口 """, dest='listenerPort', type=int, required=True)), + (['--id'], dict(help="""(string) Deployment ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启动监听器 ''', + help=''' 查询应用记录 ''', description=''' - 启动监听器。 + 查询应用记录。 - 示例: jdc jdfusion start-slb-listener --id xxx --listener-port 0 + 示例: jdc jdfusion get-deployment-versions --id xxx ''', ) - def start_slb_listener(self): + def get_deployment_versions(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.StartSlbListenerRequest import StartSlbListenerRequest + from jdcloud_sdk.services.jdfusion.apis.GetDeploymentVersionsRequest import GetDeploymentVersionsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartSlbListenerRequest(params_dict, headers) + req = GetDeploymentVersionsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3629,30 +3736,31 @@ def start_slb_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 负载均衡id """, dest='id', required=True)), - (['--listener-port'], dict(help="""(int) 监听器端口 """, dest='listenerPort', type=int, required=True)), + (['--id'], dict(help="""(string) deployment ID """, dest='id', required=True)), + (['--version_id'], dict(help="""(string) application ID """, dest='version_id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 停止监听器 ''', + help=''' 查询应用记录详细信息 ''', description=''' - 停止监听器。 + 查询应用记录详细信息。 - 示例: jdc jdfusion stop-slb-listener --id xxx --listener-port 0 + 示例: jdc jdfusion get-deployments-version --id xxx --version_id xxx ''', ) - def stop_slb_listener(self): + def get_deployments_version(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.StopSlbListenerRequest import StopSlbListenerRequest + from jdcloud_sdk.services.jdfusion.apis.GetDeploymentsVersionRequest import GetDeploymentsVersionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopSlbListenerRequest(params_dict, headers) + req = GetDeploymentsVersionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3663,29 +3771,31 @@ def stop_slb_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) VPC ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) deployment ID """, dest='id', required=True)), + (['--version_id'], dict(help="""(string) application ID """, dest='version_id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的subnet资源信息 ''', + help=''' 应用部署回滚 ''', description=''' - 根据云提供商查询对应的subnet资源信息。 + 应用部署回滚。 - 示例: jdc jdfusion get-vpc-subnet-by-id --id xxx + 示例: jdc jdfusion rollback-deployments-version --id xxx --version_id xxx ''', ) - def get_vpc_subnet_by_id(self): + def rollback_deployments_version(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcSubnetByIdRequest import GetVpcSubnetByIdRequest + from jdcloud_sdk.services.jdfusion.apis.RollbackDeploymentsVersionRequest import RollbackDeploymentsVersionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcSubnetByIdRequest(params_dict, headers) + req = RollbackDeploymentsVersionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3696,29 +3806,31 @@ def get_vpc_subnet_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) VPC ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) deployment ID """, dest='id', required=True)), + (['--record'], dict(help="""(string) deployment ID """, dest='record', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除子网 ''', + help=''' 查询某一次的历史执行结果(内部使用) ''', description=''' - 删除子网。 + 查询某一次的历史执行结果(内部使用)。 - 示例: jdc jdfusion delete-vpc-subnet-by-id --id xxx + 示例: jdc jdfusion get-deployments-results-by-id-record --id xxx --record xxx ''', ) - def delete_vpc_subnet_by_id(self): + def get_deployments_results_by_id_record(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteVpcSubnetByIdRequest import DeleteVpcSubnetByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetDeploymentsResultsByIdRecordRequest import GetDeploymentsResultsByIdRecordRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVpcSubnetByIdRequest(params_dict, headers) + req = GetDeploymentsResultsByIdRecordRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3730,27 +3842,28 @@ def delete_vpc_subnet_by_id(self): arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的subnet资源信息 ''', + help=''' 查询地域列表信息 ''', description=''' - 根据云提供商查询对应的subnet资源信息。 + 查询地域列表信息。 - 示例: jdc jdfusion get-vpc-subnets + 示例: jdc jdfusion get-regions ''', ) - def get_vpc_subnets(self): + def get_regions(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcSubnetsRequest import GetVpcSubnetsRequest + from jdcloud_sdk.services.jdfusion.apis.GetRegionsRequest import GetRegionsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcSubnetsRequest(params_dict, headers) + req = GetRegionsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3761,29 +3874,30 @@ def get_vpc_subnets(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--subnet'], dict(help="""(createSubnet) 创建subnet """, dest='subnet', required=True)), + (['--region'], dict(help="""(string) 区域id """, dest='region', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商创建子网 ''', + help=''' 查询可用域列表信息 ''', description=''' - 根据云提供商创建子网。 + 查询可用域列表信息。 - 示例: jdc jdfusion create-vpc-subnet --subnet '{"":""}' + 示例: jdc jdfusion get-regions-available-zones --region xxx ''', ) - def create_vpc_subnet(self): + def get_regions_available_zones(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateVpcSubnetRequest import CreateVpcSubnetRequest + from jdcloud_sdk.services.jdfusion.apis.GetRegionsAvailableZonesRequest import GetRegionsAvailableZonesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVpcSubnetRequest(params_dict, headers) + req = GetRegionsAvailableZonesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3794,29 +3908,29 @@ def create_vpc_subnet(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) VPC ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商查询对应的VPC资源信息 ''', + help=''' 查询数据同步通道信息 ''', description=''' - 根据云提供商查询对应的VPC资源信息。 + 查询数据同步通道信息。 - 示例: jdc jdfusion get-vpc-by-id --id xxx + 示例: jdc jdfusion get-channels ''', ) - def get_vpc_by_id(self): + def get_channels(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcByIdRequest import GetVpcByIdRequest + from jdcloud_sdk.services.jdfusion.apis.GetChannelsRequest import GetChannelsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcByIdRequest(params_dict, headers) + req = GetChannelsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3827,29 +3941,30 @@ def get_vpc_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) VPC ID """, dest='id', required=True)), + (['--channel'], dict(help="""(channelInfo) 创建channel """, dest='channel', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除VPC ''', + help=''' 创建数据同步通道 ''', description=''' - 删除VPC。 + 创建数据同步通道。 - 示例: jdc jdfusion delete-vpc-by-id --id xxx + 示例: jdc jdfusion create-channel --channel '{"":""}' ''', ) - def delete_vpc_by_id(self): + def create_channel(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteVpcByIdRequest import DeleteVpcByIdRequest + from jdcloud_sdk.services.jdfusion.apis.CreateChannelRequest import CreateChannelRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVpcByIdRequest(params_dict, headers) + req = CreateChannelRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3860,28 +3975,30 @@ def delete_vpc_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--id'], dict(help="""(string) channel ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询私有网络资源列表 ''', + help=''' 删除channel ''', description=''' - 查询私有网络资源列表。 + 删除channel。 - 示例: jdc jdfusion get-vpcs + 示例: jdc jdfusion delete-channel --id xxx ''', ) - def get_vpcs(self): + def delete_channel(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcsRequest import GetVpcsRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteChannelRequest import DeleteChannelRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcsRequest(params_dict, headers) + req = DeleteChannelRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3892,29 +4009,30 @@ def get_vpcs(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--vpc'], dict(help="""(vpcInfo) 创建VPC """, dest='vpc', required=True)), + (['--id'], dict(help="""(string) channel ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据云提供商创建私有网络 ''', + help=''' 启动数据同步 ''', description=''' - 根据云提供商创建私有网络。 + 启动数据同步。 - 示例: jdc jdfusion create-vpc --vpc '{"":""}' + 示例: jdc jdfusion start-channel --id xxx ''', ) - def create_vpc(self): + def start_channel(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateVpcRequest import CreateVpcRequest + from jdcloud_sdk.services.jdfusion.apis.StartChannelRequest import StartChannelRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVpcRequest(params_dict, headers) + req = StartChannelRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3925,29 +4043,30 @@ def create_vpc(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--slbid'], dict(help="""(string) 负载均衡id """, dest='slbid', required=False)), + (['--id'], dict(help="""(string) channel ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据过滤条件,取得服务器组的信息 ''', + help=''' 停止数据同步 ''', description=''' - 根据过滤条件,取得服务器组的信息。 + 停止数据同步。 - 示例: jdc jdfusion get-vpc-vserver-groups + 示例: jdc jdfusion stop-channel --id xxx ''', ) - def get_vpc_vserver_groups(self): + def stop_channel(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVpcVServerGroupsRequest import GetVpcVServerGroupsRequest + from jdcloud_sdk.services.jdfusion.apis.StopChannelRequest import StopChannelRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVpcVServerGroupsRequest(params_dict, headers) + req = StopChannelRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3958,29 +4077,29 @@ def get_vpc_vserver_groups(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--vserver-group'], dict(help="""(createVserverGroup) 创建虚拟服务器组 """, dest='vserverGroup', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建虚拟服务器组,并添加后端服务器 ''', + help=''' 查询数据源 ''', description=''' - 创建虚拟服务器组,并添加后端服务器。 + 查询数据源。 - 示例: jdc jdfusion create-vpc-vserver-group --vserver-group '{"":""}' + 示例: jdc jdfusion get-datasources ''', ) - def create_vpc_vserver_group(self): + def get_datasources(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.CreateVpcVServerGroupRequest import CreateVpcVServerGroupRequest + from jdcloud_sdk.services.jdfusion.apis.GetDatasourcesRequest import GetDatasourcesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVpcVServerGroupRequest(params_dict, headers) + req = GetDatasourcesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3991,29 +4110,30 @@ def create_vpc_vserver_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 服务器组ID """, dest='id', required=True)), + (['--datasource'], dict(help="""(datasourceInfo) 创建数据源 """, dest='datasource', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据过滤条件,取得服务器组的信息 ''', + help=''' 创建数据源 ''', description=''' - 根据过滤条件,取得服务器组的信息。 + 创建数据源。 - 示例: jdc jdfusion get-vserver-groups-by-id --id xxx + 示例: jdc jdfusion create-datasource --datasource '{"":""}' ''', ) - def get_vserver_groups_by_id(self): + def create_datasource(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.GetVserverGroupsByIdRequest import GetVserverGroupsByIdRequest + from jdcloud_sdk.services.jdfusion.apis.CreateDatasourceRequest import CreateDatasourceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVserverGroupsByIdRequest(params_dict, headers) + req = CreateDatasourceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4024,29 +4144,30 @@ def get_vserver_groups_by_id(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--id'], dict(help="""(string) 服务器组ID """, dest='id', required=True)), + (['--id'], dict(help="""(string) channel ID """, dest='id', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除服务器组 ''', + help=''' 删除数据源 ''', description=''' - 删除服务器组。 + 删除数据源。 - 示例: jdc jdfusion delete-vserver-group --id xxx + 示例: jdc jdfusion delete-datasource --id xxx ''', ) - def delete_vserver_group(self): + def delete_datasource(self): client_factory = ClientFactory('jdfusion') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jdfusion.apis.DeleteVserverGroupRequest import DeleteVserverGroupRequest + from jdcloud_sdk.services.jdfusion.apis.DeleteDatasourceRequest import DeleteDatasourceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVserverGroupRequest(params_dict, headers) + req = DeleteDatasourceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -4056,7 +4177,7 @@ def delete_vserver_group(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['get-cloud-infos','regist-cloud-info','get-cloud-info-by-id','unregist-cloud-info','valid-cloud-info','get-deployments','create-deployment','reverse-deployment','get-deployments-by-id','edit-deployment','delete-deployment','clone-deployment','dryrun-deployment','apply-deployment','get-deployment-result','get-deployment-versions','get-deployments-version','rollback-deployments-version','get-deployments-results-by-id-record','get-disks','create-disk','get-disk-by-id','remove-disk-by-id','attach-disk-to-vm-instance-by-disk-id','detach-disk-to-vm-instance-by-disk-id','get-buckets','create-bucket','get-bucket-by-name','delete-bucket','get-bucket-files','get-transfer-tasks','create-transfer-task','get-transfer-task-by-id','edit-transfer-task','delete-transfer-task','start-transfer-task','stop-transfer-task','get-transfer-task-progress','get-transfer-task-failed-files','get-rds-accounts-by-inst-id','create-rds-accounts','get-rds-accounts-by-inst-id-and-account-name','delete-rds-account','grant-rds-account','revoke-rds-account','grant-rds-accounts-by-task','get-rds-databases-by-inst-id','create-rds-database','get-rds-database-by-inst-id-and-db-name','delete-rds-database','get-rds-instances','create-rds-instance','get-rds-by-inst-id','delete-rds-by-inst-id','get-channels','create-channel','delete-channel','start-channel','stop-channel','get-datasources','create-datasource','delete-datasource','get-rds-specification','get-regions','get-regions-available-zones','get-task-info-history-by-id','get-task-info-by-id','get-vm-images','get-vm-instances-by-id','delete-vm-instance-by-id','get-vm-instances','create-vm-instance','stop-vm-instance-by-id','start-vm-instance-by-id','reboot-vm-instance-by-id','get-vm-instance-types','get-vm-keypairs-by-name','delete-vm-keypair-by-name','get-vm-keypairs','create-vm-keypair','get-vpc-eips','create-vpc-eip','get-vpc-eip-by-id','delete-vpc-eip-by-id','associate-vpc-eip-by-id','disassociate-vpc-eip-by-id','get-lb-http-listener','create-vpc-lbhttp-listener','get-vpc-network-interface-by-id','delete-vpc-network-interface-by-id','get-vpc-network-interfaces','create-vpc-network-interface','attach-vpc-network-interface-by-id','detach-vpc-network-interface-by-id','get-vpc-security-group-by-id','delete-vpc-security-group-by-id','get-vpc-security-groups','create-vpc-security-group','create-security-groups-rule','delete-security-groups-rule','get-vpc-slb-by-id','delete-vpc-slb-by-id','get-vpc-slbs','create-vpc-slb','start-slb','stop-slb','delete-slbs-listener','start-slb-listener','stop-slb-listener','get-vpc-subnet-by-id','delete-vpc-subnet-by-id','get-vpc-subnets','create-vpc-subnet','get-vpc-by-id','delete-vpc-by-id','get-vpcs','create-vpc','get-vpc-vserver-groups','create-vpc-vserver-group','get-vserver-groups-by-id','delete-vserver-group',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['get-vpc-by-id','delete-vpc-by-id','get-vpcs','create-vpc','get-vm-instances-by-id','delete-vm-instance-by-id','get-vm-instances','create-vm-instance','stop-vm-instance-by-id','start-vm-instance-by-id','reboot-vm-instance-by-id','get-vpc-vserver-groups','create-vpc-vserver-group','get-vserver-groups-by-id','delete-vserver-group','get-cloud-infos','regist-cloud-info','get-cloud-info-by-id','unregist-cloud-info','valid-cloud-info','get-rds-databases-by-inst-id','create-rds-database','get-rds-database-by-inst-id-and-db-name','delete-rds-database','get-buckets','create-bucket','get-bucket-by-name','delete-bucket','get-bucket-files','get-vpc-slb-by-id','delete-vpc-slb-by-id','get-vpc-slbs','create-vpc-slb','start-slb','stop-slb','delete-slbs-listener','start-slb-listener','stop-slb-listener','get-rds-specification','get-vm-instance-types','get-vpc-network-interface-by-id','delete-vpc-network-interface-by-id','get-vpc-network-interfaces','create-vpc-network-interface','attach-vpc-network-interface-by-id','detach-vpc-network-interface-by-id','get-disks','create-disk','get-disk-by-id','remove-disk-by-id','attach-disk-to-vm-instance-by-disk-id','detach-disk-to-vm-instance-by-disk-id','get-rds-accounts-by-inst-id','create-rds-accounts','get-rds-accounts-by-inst-id-and-account-name','delete-rds-account','grant-rds-account','revoke-rds-account','grant-rds-accounts-by-task','get-vpc-eips','create-vpc-eip','get-vpc-eip-by-id','delete-vpc-eip-by-id','associate-vpc-eip-by-id','disassociate-vpc-eip-by-id','get-task-info-history-by-id','get-task-info-by-id','get-transfer-tasks','create-transfer-task','get-transfer-task-by-id','edit-transfer-task','delete-transfer-task','start-transfer-task','stop-transfer-task','get-transfer-task-progress','get-transfer-task-failed-files','get-vm-keypairs-by-name','delete-vm-keypair-by-name','get-vm-keypairs','create-vm-keypair','get-vpc-security-group-by-id','delete-vpc-security-group-by-id','get-vpc-security-groups','create-vpc-security-group','create-security-groups-rule','delete-security-groups-rule','get-lb-http-listener','create-vpc-lbhttp-listener','get-vm-images','get-vpc-subnet-by-id','delete-vpc-subnet-by-id','get-vpc-subnets','create-vpc-subnet','get-rds-instances','create-rds-instance','get-rds-by-inst-id','delete-rds-by-inst-id','get-deployments','create-deployment','reverse-deployment','get-deployments-by-id','edit-deployment','delete-deployment','clone-deployment','dryrun-deployment','apply-deployment','get-deployment-result','get-deployment-versions','get-deployments-version','rollback-deployments-version','get-deployments-results-by-id-record','get-regions','get-regions-available-zones','get-channels','create-channel','delete-channel','start-channel','stop-channel','get-datasources','create-datasource','delete-datasource',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/jdro.py b/jdcloud_cli/controllers/services/jdro.py index f58e549..a29a22b 100644 --- a/jdcloud_cli/controllers/services/jdro.py +++ b/jdcloud_cli/controllers/services/jdro.py @@ -44,6 +44,7 @@ class Meta: (['--product'], dict(help="""(string) 产品线类型,比如 VM """, dest='product', required=False)), (['--search'], dict(help="""(string) 搜索的内容 """, dest='search', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -77,6 +78,7 @@ def describe_resource_type_list(self): (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), (['--resource-type'], dict(help="""(string) 资源类型 """, dest='resourceType', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -120,6 +122,7 @@ def describe_resource_type_specification(self): (['--sort-field'], dict(help="""(string) 排序字段, createtime, updatetime """, dest='sortField', required=False)), (['--sort-by'], dict(help="""(string) 排序方式,asc,desc """, dest='sortBy', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -154,6 +157,7 @@ def describe_stacks(self): (['--environment'], dict(help="""(environment) NA """, dest='environment', required=True)), (['--template'], dict(help="""(object) 模板, JSON对象 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -187,6 +191,7 @@ def create_stack(self): (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), (['--stack-id'], dict(help="""(string) 资源栈 ID """, dest='stackId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -220,6 +225,7 @@ def describe_stack(self): (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), (['--stack-id'], dict(help="""(string) 资源栈 ID """, dest='stackId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -255,6 +261,7 @@ def delete_stack(self): (['--environment'], dict(help="""(environment) NA """, dest='environment', required=True)), (['--template'], dict(help="""(object) 模板, JSON对象 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -289,6 +296,7 @@ def create_change_set(self): (['--stack-id'], dict(help="""(string) 资源栈 ID """, dest='stackId', required=True)), (['--changeset-id'], dict(help="""(string) 更改集 ID """, dest='changesetId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -326,6 +334,7 @@ def execute_change_set(self): (['--start-time'], dict(help="""(string) 事件开始时间 """, dest='startTime', required=False)), (['--end-time'], dict(help="""(string) 事件结束时间 """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -363,6 +372,7 @@ def describe_stack_events(self): (['--search'], dict(help="""(string) 按照京东云产品线名称或者资源逻辑ID进行模糊搜索 """, dest='search', required=False)), (['--product'], dict(help="""(string) 只按照京东云产品线名称进行模糊搜索,比如VM,Disk等 """, dest='product', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -396,6 +406,7 @@ def describe_stack_resources(self): (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), (['--stack-id'], dict(help="""(string) 资源栈 ID """, dest='stackId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -431,6 +442,7 @@ def describe_stack_template(self): (['--template'], dict(help="""(object) 模板 """, dest='template', required=True)), (['--validate-mode'], dict(help="""(string) 可取值:(validateTemplate (检测模板), validateStack (检测模板和environment)) 默认validateTemplate """, dest='validateMode', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, diff --git a/jdcloud_cli/controllers/services/jmr.py b/jdcloud_cli/controllers/services/jmr.py index 0c173ce..31523c8 100644 --- a/jdcloud_cli/controllers/services/jmr.py +++ b/jdcloud_cli/controllers/services/jmr.py @@ -36,11 +36,147 @@ class Meta: stacked_on = 'base' stacked_type = 'nested' + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--data-center'], dict(help="""(string) 地域信息 """, dest='dataCenter', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询用户的集群列表及相关服务的一些信息 ''', + description=''' + 查询用户的集群列表及相关服务的一些信息。 + + 示例: jdc jmr idata-cluster + ''', + ) + def idata_cluster(self): + client_factory = ClientFactory('jmr') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jmr.apis.IdataClusterRequest import IdataClusterRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = IdataClusterRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--version'], dict(help="""(string) JMR软件版本号 """, dest='version', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取对应版本的软件清单信息 ''', + description=''' + 获取对应版本的软件清单信息。 + + 示例: jdc jmr get-software-info --version xxx + ''', + ) + def get_software_info(self): + client_factory = ClientFactory('jmr') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jmr.apis.GetSoftwareInfoRequest import GetSoftwareInfoRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = GetSoftwareInfoRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询JMR的版本信息 ''', + description=''' + 查询JMR的版本信息。 + + 示例: jdc jmr get-jmr-version-list + ''', + ) + def get_jmr_version_list(self): + client_factory = ClientFactory('jmr') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jmr.apis.GetJmrVersionListRequest import GetJmrVersionListRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = GetJmrVersionListRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--cluster-id'], dict(help="""(string) 集群ID """, dest='clusterId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询JMR的监控模板信息 ''', + description=''' + 查询JMR的监控模板信息。 + + 示例: jdc jmr monitor-label-list --cluster-id xxx + ''', + ) + def monitor_label_list(self): + client_factory = ClientFactory('jmr') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jmr.apis.MonitorLabelListRequest import MonitorLabelListRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = MonitorLabelListRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--cluster-id'], dict(help="""(string) 集群ID """, dest='clusterId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -69,11 +205,51 @@ def describe_cluster(self): except Exception as e: print(e) + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--data-center'], dict(help="""(string) 地域 """, dest='dataCenter', required=False)), + (['--status'], dict(help="""(string) 集群状态,CREATING,RUNNING,RELEASED,FAILED等 """, dest='status', required=False)), + (['--cluster-name'], dict(help="""(string) 集群名称 """, dest='clusterName', required=False)), + (['--order-by'], dict(help="""(string) 排序,比如 id desc """, dest='orderBy', required=False)), + (['--page-num'], dict(help="""(int) 页数,默认为1 """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页数目,默认为10 """, dest='pageSize', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询用户集群的列表; ''', + description=''' + 查询用户集群的列表; 。 + + 示例: jdc jmr describe-clusters + ''', + ) + def describe_clusters(self): + client_factory = ClientFactory('jmr') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jmr.apis.DescribeClustersRequest import DescribeClustersRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeClustersRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--cluster-id'], dict(help="""(string) 集群ID """, dest='clusterId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -81,20 +257,20 @@ def describe_cluster(self): description=''' 释放集群; 。 - 示例: jdc jmr delete-cluster --cluster-id xxx + 示例: jdc jmr release-cluster --cluster-id xxx ''', ) - def delete_cluster(self): + def release_cluster(self): client_factory = ClientFactory('jmr') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jmr.apis.DeleteClusterRequest import DeleteClusterRequest + from jdcloud_sdk.services.jmr.apis.ReleaseClusterRequest import ReleaseClusterRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteClusterRequest(params_dict, headers) + req = ReleaseClusterRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -105,30 +281,66 @@ def delete_cluster(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--cluster-expansion'], dict(help="""(clusterExpansion) 描述集群扩容信息 """, dest='clusterExpansion', required=True)), + (['--client-token'], dict(help="""(string) 用于保证请求的幂等性。由客户端生成,长度不能超过64个字符。; """, dest='clientToken', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询集群列表 ''', + help=''' 扩容集群 ''', description=''' - 查询集群列表。 + 扩容集群。 - 示例: jdc jmr describe-clusters + 示例: jdc jmr cluster-expansion --cluster-expansion '{"":""}' ''', ) - def describe_clusters(self): + def cluster_expansion(self): client_factory = ClientFactory('jmr') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.jmr.apis.DescribeClustersRequest import DescribeClustersRequest + from jdcloud_sdk.services.jmr.apis.ClusterExpansionRequest import ClusterExpansionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeClustersRequest(params_dict, headers) + req = ClusterExpansionRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--cluster-reduction'], dict(help="""(clusterReduction) 描述集群缩容信息 """, dest='clusterReduction', required=True)), + (['--client-token'], dict(help="""(string) 用于保证请求的幂等性。由客户端生成,长度不能超过64个字符。; """, dest='clientToken', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 缩容集群 ''', + description=''' + 缩容集群。 + + 示例: jdc jmr cluster-reduction --cluster-reduction '{"":""}' + ''', + ) + def cluster_reduction(self): + client_factory = ClientFactory('jmr') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.jmr.apis.ClusterReductionRequest import ClusterReductionRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ClusterReductionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -140,8 +352,9 @@ def describe_clusters(self): arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--cluster-spec'], dict(help="""(clusterSpec) 描述集群配置 """, dest='clusterSpec', required=True)), - (['--client-token'], dict(help="""(string) 用于保证请求的幂等性。由客户端生成,长度不能超过64个字符。; """, dest='clientToken', required=True)), + (['--client-token'], dict(help="""(string) 用于保证请求的幂等性。由客户端生成,长度不能超过64个字符。; """, dest='clientToken', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -149,7 +362,7 @@ def describe_clusters(self): description=''' 创建集群。 - 示例: jdc jmr create-cluster --cluster-spec '{"":""}' --client-token xxx + 示例: jdc jmr create-cluster --cluster-spec '{"":""}' ''', ) def create_cluster(self): @@ -172,7 +385,7 @@ def create_cluster(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-cluster','delete-cluster','describe-clusters','create-cluster',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['idata-cluster','get-software-info','get-jmr-version-list','monitor-label-list','describe-cluster','describe-clusters','release-cluster','cluster-expansion','cluster-reduction','create-cluster',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/kms.py b/jdcloud_cli/controllers/services/kms.py index f6cfbab..f4e5eb6 100644 --- a/jdcloud_cli/controllers/services/kms.py +++ b/jdcloud_cli/controllers/services/kms.py @@ -41,6 +41,7 @@ class Meta: (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -73,6 +74,7 @@ def describe_key_list(self): arguments=[ (['--key-cfg'], dict(help="""(keyCfg) NA """, dest='keyCfg', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -105,6 +107,7 @@ def create_key(self): arguments=[ (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -138,6 +141,7 @@ def describe_key(self): (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--key-cfg'], dict(help="""(keyCfg) NA """, dest='keyCfg', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -170,6 +174,7 @@ def update_key_description(self): arguments=[ (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -202,6 +207,7 @@ def enable_key(self): arguments=[ (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -235,6 +241,7 @@ def disable_key(self): (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--delay-days'], dict(help="""(int) 延迟删除时间,单位(天),默认为7天;支持时间范围:7~30天 """, dest='delayDays', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -267,6 +274,7 @@ def schedule_key_deletion(self): arguments=[ (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -299,6 +307,7 @@ def cancel_key_deletion(self): arguments=[ (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -332,6 +341,7 @@ def key_rotation(self): (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--plaintext'], dict(help="""(string) 明文数据 Base64-encoded binary data object """, dest='plaintext', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -365,6 +375,7 @@ def encrypt(self): (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--ciphertext-blob'], dict(help="""(string) 密文数据 Base64-encoded binary data object """, dest='ciphertextBlob', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -397,6 +408,7 @@ def decrypt(self): arguments=[ (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -430,6 +442,7 @@ def get_public_key(self): (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--plaintext'], dict(help="""(string) 需要签名的数据 Base64-encoded binary data object """, dest='plaintext', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -464,6 +477,7 @@ def sign(self): (['--plaintext'], dict(help="""(string) 需要签名的数据 Base64-encoded binary data object """, dest='plaintext', required=False)), (['--signature'], dict(help="""(string) 签名 """, dest='signature', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -496,6 +510,7 @@ def validate(self): arguments=[ (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -530,6 +545,7 @@ def generate_data_key(self): (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -563,6 +579,7 @@ def describe_key_detail(self): (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--version'], dict(help="""(string) 密钥版本 """, dest='version', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -596,6 +613,7 @@ def enable_key_version(self): (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--version'], dict(help="""(string) 密钥版本 """, dest='version', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -630,6 +648,7 @@ def disable_key_version(self): (['--version'], dict(help="""(string) 密钥版本 """, dest='version', required=True)), (['--delay-days'], dict(help="""(int) 延迟删除时间,单位(天),默认为7天;支持时间范围:7~30天 """, dest='delayDays', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -663,6 +682,7 @@ def schedule_key_version_deletion(self): (['--key-id'], dict(help="""(string) 密钥ID """, dest='keyId', required=True)), (['--version'], dict(help="""(string) 密钥版本 """, dest='version', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -696,6 +716,7 @@ def cancel_key_version_deletion(self): (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -728,6 +749,7 @@ def describe_secret_list(self): arguments=[ (['--secret-cfg'], dict(help="""(secretCfg) NA """, dest='secretCfg', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -756,44 +778,13 @@ def create_secret(self): except Exception as e: print(e) - @expose( - arguments=[ - (['--secret-package'], dict(help="""(string) 密钥包的内容 """, dest='secretPackage', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 导入机密 ''', - description=''' - 导入机密。 - - 示例: jdc kms import-secret - ''', - ) - def import_secret(self): - client_factory = ClientFactory('kms') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.kms.apis.ImportSecretRequest import ImportSecretRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = ImportSecretRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - @expose( arguments=[ (['--secret-id'], dict(help="""(string) 机密ID """, dest='secretId', required=True)), (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -827,6 +818,7 @@ def describe_secret_version_list(self): (['--secret-id'], dict(help="""(string) 机密ID """, dest='secretId', required=True)), (['--secret-desc-cfg'], dict(help="""(secretDescCfg) NA """, dest='secretDescCfg', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -859,6 +851,7 @@ def update_secret(self): arguments=[ (['--secret-id'], dict(help="""(string) 机密ID """, dest='secretId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -891,6 +884,7 @@ def enable_secret(self): arguments=[ (['--secret-id'], dict(help="""(string) 机密ID """, dest='secretId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -923,6 +917,7 @@ def disable_secret(self): arguments=[ (['--secret-id'], dict(help="""(string) 机密ID """, dest='secretId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -956,6 +951,7 @@ def delete_secret(self): (['--secret-id'], dict(help="""(string) 机密ID """, dest='secretId', required=True)), (['--secret-version-cfg'], dict(help="""(secretVersionCfg) NA """, dest='secretVersionCfg', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -984,43 +980,12 @@ def create_secret_version(self): except Exception as e: print(e) - @expose( - arguments=[ - (['--secret-id'], dict(help="""(string) 机密ID """, dest='secretId', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 导出机密 ''', - description=''' - 导出机密。 - - 示例: jdc kms export-secret --secret-id xxx - ''', - ) - def export_secret(self): - client_factory = ClientFactory('kms') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.kms.apis.ExportSecretRequest import ExportSecretRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = ExportSecretRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - @expose( arguments=[ (['--secret-id'], dict(help="""(string) 机密ID """, dest='secretId', required=True)), (['--version'], dict(help="""(string) 机密版本 """, dest='version', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1055,6 +1020,7 @@ def describe_secret_version_info(self): (['--version'], dict(help="""(string) 机密版本 """, dest='version', required=True)), (['--secret-time-cfg'], dict(help="""(secretTimeCfg) NA """, dest='secretTimeCfg', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1088,6 +1054,7 @@ def update_secret_version(self): (['--secret-id'], dict(help="""(string) 机密ID """, dest='secretId', required=True)), (['--version'], dict(help="""(string) 机密版本 """, dest='version', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1121,6 +1088,7 @@ def enable_secret_version(self): (['--secret-id'], dict(help="""(string) 机密ID """, dest='secretId', required=True)), (['--version'], dict(help="""(string) 机密版本 """, dest='version', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1154,6 +1122,7 @@ def disable_secret_version(self): (['--secret-id'], dict(help="""(string) 机密ID """, dest='secretId', required=True)), (['--version'], dict(help="""(string) 机密版本 """, dest='version', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1184,7 +1153,7 @@ def delete_secret_version(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-key-list','create-key','describe-key','update-key-description','enable-key','disable-key','schedule-key-deletion','cancel-key-deletion','key-rotation','encrypt','decrypt','get-public-key','sign','validate','generate-data-key','describe-key-detail','enable-key-version','disable-key-version','schedule-key-version-deletion','cancel-key-version-deletion','describe-secret-list','create-secret','import-secret','describe-secret-version-list','update-secret','enable-secret','disable-secret','delete-secret','create-secret-version','export-secret','describe-secret-version-info','update-secret-version','enable-secret-version','disable-secret-version','delete-secret-version',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-key-list','create-key','describe-key','update-key-description','enable-key','disable-key','schedule-key-deletion','cancel-key-deletion','key-rotation','encrypt','decrypt','get-public-key','sign','validate','generate-data-key','describe-key-detail','enable-key-version','disable-key-version','schedule-key-version-deletion','cancel-key-version-deletion','describe-secret-list','create-secret','describe-secret-version-list','update-secret','enable-secret','disable-secret','delete-secret','create-secret-version','describe-secret-version-info','update-secret-version','enable-secret-version','disable-secret-version','delete-secret-version',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/kubernetes.py b/jdcloud_cli/controllers/services/kubernetes.py index 058ec3a..1195221 100644 --- a/jdcloud_cli/controllers/services/kubernetes.py +++ b/jdcloud_cli/controllers/services/kubernetes.py @@ -43,29 +43,30 @@ class Meta: (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) name - 集群名称,模糊匹配,仅支持单个 ; id - id,支持多个 ; """, dest='filters', required=False)), + (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), + (['--filters'], dict(help="""(array: filter) name - 节点组名称,模糊匹配,支持单个; id - 节点组 id,支持多个; clusterId - 根据 clusterId 查询; clusterName - 根据 cluster 名称查询; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询集群列表 ''', + help=''' 查询工作节点组列表 ''', description=''' - 查询集群列表。 + 查询工作节点组列表。 - 示例: jdc kubernetes describe-clusters + 示例: jdc kubernetes describe-node-groups ''', ) - def describe_clusters(self): + def describe_node_groups(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DescribeClustersRequest import DescribeClustersRequest + from jdcloud_sdk.services.kubernetes.apis.DescribeNodeGroupsRequest import DescribeNodeGroupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeClustersRequest(params_dict, headers) + req = DescribeNodeGroupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -76,40 +77,39 @@ def describe_clusters(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) 名称(同一用户的 cluster 允许重名) """, dest='name', required=True)), + (['--name'], dict(help="""(string) 名称(同一用户的 cluster 内部唯一) """, dest='name', required=True)), (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), - (['--basic-auth'], dict(help="""(bool) 默认开启 basicAuth与clientCertificate最少选择一个 """, dest='basicAuth', required=False)), - (['--client-certificate'], dict(help="""(bool) 默认开启 clientCertificate """, dest='clientCertificate', required=False)), - (['--version'], dict(help="""(string) kubernetes的版本 """, dest='version', required=False)), - (['--azs'], dict(help="""(array: string) 集群所在的az """, dest='azs', required=False)), - (['--node-group'], dict(help="""(nodeGroupSpec) 集群节点组 """, dest='nodeGroup', required=True)), - (['--master-cidr'], dict(help="""(string) k8s的master的cidr """, dest='masterCidr', required=True)), - (['--access-key'], dict(help="""(string) 用户的AccessKey,插件调用open-api时的认证凭证 """, dest='accessKey', required=True)), - (['--secret-key'], dict(help="""(string) 用户的SecretKey,插件调用open-api时的认证凭证 """, dest='secretKey', required=True)), - (['--user-metrics'], dict(help="""(bool) deprecated 在addonsConfig中同时指定,将被addonsConfig的设置覆盖
是否启用用户自定义监控 """, dest='userMetrics', required=False)), - (['--addons-config'], dict(help="""(array: addonConfigSpec) 集群组件配置 """, dest='addonsConfig', required=False)), + (['--cluster-id'], dict(help="""(string) 工作节点所属的集群 """, dest='clusterId', required=True)), + (['--node-config'], dict(help="""(nodeConfigSpec) 工作节点配置信息 """, dest='nodeConfig', required=True)), + (['--azs'], dict(help="""(array: string) 工作节点组的 az,必须为集群az的子集,默认为集群az """, dest='azs', required=False)), + (['--initial-node-count'], dict(help="""(int) 工作节点组初始化大小 """, dest='initialNodeCount', type=int, required=True)), + (['--vpc-id'], dict(help="""(string) 工作节点组初始化大小运行的VPC """, dest='vpcId', required=True)), + (['--node-cidr'], dict(help="""(string) 工作节点组的cidr """, dest='nodeCidr', required=False)), + (['--auto-repair'], dict(help="""(bool) 是否开启工作节点组的自动修复,默认关闭 """, dest='autoRepair', required=False)), + (['--ca-config'], dict(help="""(cAConfigSpec) 自动伸缩配置 """, dest='caConfig', required=False)), + (['--node-group-network'], dict(help="""(nodeGroupNetworkSpec) 节点组的网络配置,如果集群的类型customized类型,则必须指定该参数,如果是auto,则不是必须 """, dest='nodeGroupNetwork', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' - 创建集群; - 证书; - 关于kubernetes的证书,默认生成,不需要用户传入。; - nodegroup; - cluster必须与nodeGroup进行绑定; - cluster支持多nodegroup; - 状态; - pending,reconciling,deleting状态不可以操作更新接口; - running,running_with_error状态可以操作nodegroup所有接口; - error状态只可以查询,删除; - delete状态的cluster在十五分钟内可以查询,十五分钟后无法查询到; - 状态限制; - pending,reconciling,deleting状态不可以操作更新接口; - running状态可以操作cluster所有接口; - error状态只可以查询,删除; - delete状态的cluster在十五分钟内可以查询,十五分钟后无法查询到; ''', + help=''' 创建工作节点组
; - 要求集群状态为running; ''', description=''' - - 创建集群; - 证书; - 关于kubernetes的证书,默认生成,不需要用户传入。; - nodegroup; - cluster必须与nodeGroup进行绑定; - cluster支持多nodegroup; - 状态; - pending,reconciling,deleting状态不可以操作更新接口; - running,running_with_error状态可以操作nodegroup所有接口; - error状态只可以查询,删除; - delete状态的cluster在十五分钟内可以查询,十五分钟后无法查询到; - 状态限制; - pending,reconciling,deleting状态不可以操作更新接口; - running状态可以操作cluster所有接口; - error状态只可以查询,删除; - delete状态的cluster在十五分钟内可以查询,十五分钟后无法查询到; 。 + 创建工作节点组
; - 要求集群状态为running; 。 - 示例: jdc kubernetes create-cluster --name xxx --node-group {"":""} --master-cidr xxx --access-key xxx --secret-key xxx + 示例: jdc kubernetes create-node-group --name xxx --cluster-id xxx --node-config {"":""} --initial-node-count 5 --vpc-id xxx ''', ) - def create_cluster(self): + def create_node_group(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.CreateClusterRequest import CreateClusterRequest + from jdcloud_sdk.services.kubernetes.apis.CreateNodeGroupRequest import CreateNodeGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateClusterRequest(params_dict, headers) + req = CreateNodeGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -120,29 +120,29 @@ def create_cluster(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), + (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个集群详情。 ''', + help=''' 查询单个工作节点组详情 ''', description=''' - 查询单个集群详情。。 + 查询单个工作节点组详情。 - 示例: jdc kubernetes describe-cluster --cluster-id xxx + 示例: jdc kubernetes describe-node-group --node-group-id xxx ''', ) - def describe_cluster(self): + def describe_node_group(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DescribeClusterRequest import DescribeClusterRequest + from jdcloud_sdk.services.kubernetes.apis.DescribeNodeGroupRequest import DescribeNodeGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeClusterRequest(params_dict, headers) + req = DescribeNodeGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -153,31 +153,31 @@ def describe_cluster(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), - (['--name'], dict(help="""(string) 集群名称 """, dest='name', required=False)), - (['--description'], dict(help="""(string) 集群描述 """, dest='description', required=False)), + (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), + (['--name'], dict(help="""(string) 工作节点组名称 """, dest='name', required=False)), + (['--description'], dict(help="""(string) 工作节点组描述 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改集群的 名称 和 描述。
集群 name 和 description 必须要指定一个 ''', + help=''' 修改工作节点组的 名称 和 描述
name 和 description 必须要指定一个 ''', description=''' - 修改集群的 名称 和 描述。
集群 name 和 description 必须要指定一个。 + 修改工作节点组的 名称 和 描述
name 和 description 必须要指定一个。 - 示例: jdc kubernetes modify-cluster --cluster-id xxx + 示例: jdc kubernetes modify-node-group --node-group-id xxx ''', ) - def modify_cluster(self): + def modify_node_group(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.ModifyClusterRequest import ModifyClusterRequest + from jdcloud_sdk.services.kubernetes.apis.ModifyNodeGroupRequest import ModifyNodeGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyClusterRequest(params_dict, headers) + req = ModifyNodeGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -188,29 +188,29 @@ def modify_cluster(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), + (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除集群,以及集群的所有node节点,网络,云盘等所有资源。 ''', + help=''' 集群摘除工作节点组并删除工作节点组 ''', description=''' - 删除集群,以及集群的所有node节点,网络,云盘等所有资源。。 + 集群摘除工作节点组并删除工作节点组。 - 示例: jdc kubernetes delete-cluster --cluster-id xxx + 示例: jdc kubernetes delete-node-group --node-group-id xxx ''', ) - def delete_cluster(self): + def delete_node_group(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DeleteClusterRequest import DeleteClusterRequest + from jdcloud_sdk.services.kubernetes.apis.DeleteNodeGroupRequest import DeleteNodeGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteClusterRequest(params_dict, headers) + req = DeleteNodeGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -221,30 +221,30 @@ def delete_cluster(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), - (['--enabled'], dict(help="""(bool) 是否开启自定义监控 """, dest='enabled', required=False)), + (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), + (['--expect-count'], dict(help="""(int) 预期目标节点数量 """, dest='expectCount', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' Deprecated 建议使用 setAddons 接口
设置用户自定义监控状态 ''', + help=''' 调整工作节点组实例数量 ''', description=''' - Deprecated 建议使用 setAddons 接口
设置用户自定义监控状态。 + 调整工作节点组实例数量。 - 示例: jdc kubernetes set-user-metrics --cluster-id xxx + 示例: jdc kubernetes set-node-group-size --node-group-id xxx --expect-count 5 ''', ) - def set_user_metrics(self): + def set_node_group_size(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.SetUserMetricsRequest import SetUserMetricsRequest + from jdcloud_sdk.services.kubernetes.apis.SetNodeGroupSizeRequest import SetNodeGroupSizeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetUserMetricsRequest(params_dict, headers) + req = SetNodeGroupSizeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -255,29 +255,30 @@ def set_user_metrics(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), + (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), + (['--enabled'], dict(help="""(bool) 是否开启自动修复 """, dest='enabled', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 终止升级 ''', + help=''' 设置工作节点组的自动修复 ''', description=''' - 终止升级。 + 设置工作节点组的自动修复。 - 示例: jdc kubernetes abort-upgrade --cluster-id xxx + 示例: jdc kubernetes set-auto-repair --node-group-id xxx --enabled true ''', ) - def abort_upgrade(self): + def set_auto_repair(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.AbortUpgradeRequest import AbortUpgradeRequest + from jdcloud_sdk.services.kubernetes.apis.SetAutoRepairRequest import SetAutoRepairRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AbortUpgradeRequest(params_dict, headers) + req = SetAutoRepairRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -288,30 +289,29 @@ def abort_upgrade(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), - (['--node-group-ids'], dict(help="""(array: string) 节点组 ID """, dest='nodeGroupIds', required=False)), + (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询集群操作进度 ''', + help=''' 回滚未升级完的工作节点组 ''', description=''' - 查询集群操作进度。 + 回滚未升级完的工作节点组。 - 示例: jdc kubernetes describe-progress --cluster-id xxx + 示例: jdc kubernetes rollback-node-group-upgrade --node-group-id xxx ''', ) - def describe_progress(self): + def rollback_node_group_upgrade(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DescribeProgressRequest import DescribeProgressRequest + from jdcloud_sdk.services.kubernetes.apis.RollbackNodeGroupUpgradeRequest import RollbackNodeGroupUpgradeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeProgressRequest(params_dict, headers) + req = RollbackNodeGroupUpgradeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -322,31 +322,30 @@ def describe_progress(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), - (['--auto-upgrade'], dict(help="""(bool) 开启或者关闭集群自动升级,开启时必须指定 maintenancePolicy """, dest='autoUpgrade', required=True)), - (['--maintenance-window'], dict(help="""(maintenanceWindowSpec) 开启集群自动升级, 必须配置集群维护策略 """, dest='maintenanceWindow', required=False)), + (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), + (['--ca-config'], dict(help="""(cAConfigSpec) 自动伸缩配置,其中 enable 必须指定 """, dest='caConfig', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置自动升级 ''', + help=''' 设置工作节点组自动扩容 ''', description=''' - 设置自动升级。 + 设置工作节点组自动扩容。 - 示例: jdc kubernetes set-auto-upgrade --cluster-id xxx --auto-upgrade true + 示例: jdc kubernetes set-node-group-ca --node-group-id xxx --ca-config {"":""} ''', ) - def set_auto_upgrade(self): + def set_node_group_ca(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.SetAutoUpgradeRequest import SetAutoUpgradeRequest + from jdcloud_sdk.services.kubernetes.apis.SetNodeGroupCARequest import SetNodeGroupCARequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetAutoUpgradeRequest(params_dict, headers) + req = SetNodeGroupCARequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -357,32 +356,30 @@ def set_auto_upgrade(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), - (['--scope'], dict(help="""(string) 升级范围 """, dest='scope', required=True)), - (['--node-group-ids'], dict(help="""(array: string) 节点组 id """, dest='nodeGroupIds', required=False)), - (['--version'], dict(help="""(string) 指定升级到的版本 """, dest='version', required=True)), + (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), + (['--instance-ids'], dict(help="""(array: string) 需要从工作节点组中删除的实例; - 不可将一个集群中的实例全部删除; """, dest='instanceIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 触发升级 ''', + help=''' 从工作节点组中删除指定实例 ''', description=''' - 触发升级。 + 从工作节点组中删除指定实例。 - 示例: jdc kubernetes upgrade-cluster --cluster-id xxx --scope xxx --version xxx + 示例: jdc kubernetes delete-node-instances --node-group-id xxx ''', ) - def upgrade_cluster(self): + def delete_node_instances(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.UpgradeClusterRequest import UpgradeClusterRequest + from jdcloud_sdk.services.kubernetes.apis.DeleteNodeInstancesRequest import DeleteNodeInstancesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpgradeClusterRequest(params_dict, headers) + req = DeleteNodeInstancesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -392,31 +389,29 @@ def upgrade_cluster(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), - (['--addons-config'], dict(help="""(array: addonConfigSpec) 需要设置的集群组件配置 """, dest='addonsConfig', required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置集群组件 ''', + help=''' 查询 kubernetes 集群服务配置信息 ''', description=''' - 设置集群组件。 + 查询 kubernetes 集群服务配置信息。 - 示例: jdc kubernetes set-addons --cluster-id xxx --addons-config [{"":""}] + 示例: jdc kubernetes describe-server-config ''', ) - def set_addons(self): + def describe_server_config(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.SetAddonsRequest import SetAddonsRequest + from jdcloud_sdk.services.kubernetes.apis.DescribeServerConfigRequest import DescribeServerConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetAddonsRequest(params_dict, headers) + req = DescribeServerConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -426,33 +421,30 @@ def set_addons(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), - (['--filters'], dict(help="""(array: filter) name - 节点组名称,模糊匹配,支持单个; id - 节点组 id,支持多个; clusterId - 根据 clusterId 查询; clusterName - 根据 cluster 名称查询; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--master-version'], dict(help="""(string) 集群的大版本,如 1.12.4-jcs.1 """, dest='masterVersion', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询工作节点组列表 ''', + help=''' 查询版本信息 ''', description=''' - 查询工作节点组列表。 + 查询版本信息。 - 示例: jdc kubernetes describe-node-groups + 示例: jdc kubernetes describe-versions ''', ) - def describe_node_groups(self): + def describe_versions(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DescribeNodeGroupsRequest import DescribeNodeGroupsRequest + from jdcloud_sdk.services.kubernetes.apis.DescribeVersionsRequest import DescribeVersionsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeNodeGroupsRequest(params_dict, headers) + req = DescribeVersionsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -462,40 +454,30 @@ def describe_node_groups(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) 名称(同一用户的 cluster 内部唯一) """, dest='name', required=True)), - (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), - (['--cluster-id'], dict(help="""(string) 工作节点所属的集群 """, dest='clusterId', required=True)), - (['--node-config'], dict(help="""(nodeConfigSpec) 工作节点配置信息 """, dest='nodeConfig', required=True)), - (['--azs'], dict(help="""(array: string) 工作节点组的 az,必须为集群az的子集,默认为集群az """, dest='azs', required=False)), - (['--initial-node-count'], dict(help="""(int) 工作节点组初始化大小 """, dest='initialNodeCount', type=int, required=True)), - (['--vpc-id'], dict(help="""(string) 工作节点组初始化大小运行的VPC """, dest='vpcId', required=True)), - (['--node-cidr'], dict(help="""(string) 工作节点组的cidr """, dest='nodeCidr', required=False)), - (['--auto-repair'], dict(help="""(bool) 是否开启工作节点组的自动修复,默认关闭 """, dest='autoRepair', required=False)), - (['--ca-config'], dict(help="""(cAConfigSpec) 自动伸缩配置 """, dest='caConfig', required=False)), - (['--node-group-network'], dict(help="""(nodeGroupNetworkSpec) 节点组的网络配置,如果集群的类型customized类型,则必须指定该参数,如果是auto,则不是必须 """, dest='nodeGroupNetwork', required=False)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--node-version'], dict(help="""(string) 节点版本 """, dest='nodeVersion', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建工作节点组
; - 要求集群状态为running; ''', + help=''' 查询节点版本 ''', description=''' - 创建工作节点组
; - 要求集群状态为running; 。 + 查询节点版本。 - 示例: jdc kubernetes create-node-group --name xxx --cluster-id xxx --node-config {"":""} --initial-node-count 0 --vpc-id xxx + 示例: jdc kubernetes describe-node-version --node-version xxx ''', ) - def create_node_group(self): + def describe_node_version(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.CreateNodeGroupRequest import CreateNodeGroupRequest + from jdcloud_sdk.services.kubernetes.apis.DescribeNodeVersionRequest import DescribeNodeVersionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateNodeGroupRequest(params_dict, headers) + req = DescribeNodeVersionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -505,30 +487,30 @@ def create_node_group(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个工作节点组详情 ''', + help=''' 查询可升级的控制节点版本 ''', description=''' - 查询单个工作节点组详情。 + 查询可升级的控制节点版本。 - 示例: jdc kubernetes describe-node-group --node-group-id xxx + 示例: jdc kubernetes describe-upgradable-master-versions --cluster-id xxx ''', ) - def describe_node_group(self): + def describe_upgradable_master_versions(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DescribeNodeGroupRequest import DescribeNodeGroupRequest + from jdcloud_sdk.services.kubernetes.apis.DescribeUpgradableMasterVersionsRequest import DescribeUpgradableMasterVersionsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeNodeGroupRequest(params_dict, headers) + req = DescribeUpgradableMasterVersionsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -538,32 +520,31 @@ def describe_node_group(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), - (['--name'], dict(help="""(string) 工作节点组名称 """, dest='name', required=False)), - (['--description'], dict(help="""(string) 工作节点组描述 """, dest='description', required=False)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), + (['--node-group-ids'], dict(help="""(array: string) 节点组 id """, dest='nodeGroupIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改工作节点组的 名称 和 描述
name 和 description 必须要指定一个 ''', + help=''' 查询可升级的节点版本 ''', description=''' - 修改工作节点组的 名称 和 描述
name 和 description 必须要指定一个。 + 查询可升级的节点版本。 - 示例: jdc kubernetes modify-node-group --node-group-id xxx + 示例: jdc kubernetes describe-upgradable-node-versions --cluster-id xxx ''', ) - def modify_node_group(self): + def describe_upgradable_node_versions(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.ModifyNodeGroupRequest import ModifyNodeGroupRequest + from jdcloud_sdk.services.kubernetes.apis.DescribeUpgradableNodeVersionsRequest import DescribeUpgradableNodeVersionsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyNodeGroupRequest(params_dict, headers) + req = DescribeUpgradableNodeVersionsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -573,30 +554,30 @@ def modify_node_group(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--filters'], dict(help="""(array: filter) resourceTypes - 资源类型,暂时只支持[kubernetes]; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 集群摘除工作节点组并删除工作节点组 ''', + help=''' 查询 kubernetes 集群配额 ''', description=''' - 集群摘除工作节点组并删除工作节点组。 + 查询 kubernetes 集群配额。 - 示例: jdc kubernetes delete-node-group --node-group-id xxx + 示例: jdc kubernetes describe-quotas ''', ) - def delete_node_group(self): + def describe_quotas(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DeleteNodeGroupRequest import DeleteNodeGroupRequest + from jdcloud_sdk.services.kubernetes.apis.DescribeQuotasRequest import DescribeQuotasRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteNodeGroupRequest(params_dict, headers) + req = DescribeQuotasRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -607,30 +588,31 @@ def delete_node_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), - (['--expect-count'], dict(help="""(int) 预期目标节点数量 """, dest='expectCount', type=int, required=True)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) name - 集群名称,模糊匹配,仅支持单个 ; id - id,支持多个 ; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 调整工作节点组实例数量 ''', + help=''' 查询集群列表 ''', description=''' - 调整工作节点组实例数量。 + 查询集群列表。 - 示例: jdc kubernetes set-node-group-size --node-group-id xxx --expect-count 0 + 示例: jdc kubernetes describe-clusters ''', ) - def set_node_group_size(self): + def describe_clusters(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.SetNodeGroupSizeRequest import SetNodeGroupSizeRequest + from jdcloud_sdk.services.kubernetes.apis.DescribeClustersRequest import DescribeClustersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetNodeGroupSizeRequest(params_dict, headers) + req = DescribeClustersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -641,30 +623,40 @@ def set_node_group_size(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), - (['--enabled'], dict(help="""(bool) 是否开启自动修复 """, dest='enabled', required=True)), + (['--name'], dict(help="""(string) 名称(同一用户的 cluster 允许重名) """, dest='name', required=True)), + (['--description'], dict(help="""(string) 描述 """, dest='description', required=False)), + (['--basic-auth'], dict(help="""(bool) 默认开启 basicAuth与clientCertificate最少选择一个 """, dest='basicAuth', required=False)), + (['--client-certificate'], dict(help="""(bool) 默认开启 clientCertificate """, dest='clientCertificate', required=False)), + (['--version'], dict(help="""(string) kubernetes的版本 """, dest='version', required=False)), + (['--azs'], dict(help="""(array: string) 集群所在的az """, dest='azs', required=False)), + (['--node-group'], dict(help="""(nodeGroupSpec) 集群节点组 """, dest='nodeGroup', required=True)), + (['--master-cidr'], dict(help="""(string) k8s的master的cidr """, dest='masterCidr', required=True)), + (['--access-key'], dict(help="""(string) 用户的AccessKey,插件调用open-api时的认证凭证 """, dest='accessKey', required=True)), + (['--secret-key'], dict(help="""(string) 用户的SecretKey,插件调用open-api时的认证凭证 """, dest='secretKey', required=True)), + (['--user-metrics'], dict(help="""(bool) deprecated 在addonsConfig中同时指定,将被addonsConfig的设置覆盖
是否启用用户自定义监控 """, dest='userMetrics', required=False)), + (['--addons-config'], dict(help="""(array: addonConfigSpec) 集群组件配置 """, dest='addonsConfig', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置工作节点组的自动修复 ''', + help=''' - 创建集群; - 证书; - 关于kubernetes的证书,默认生成,不需要用户传入。; - nodegroup; - cluster必须与nodeGroup进行绑定; - cluster支持多nodegroup; - 状态; - pending,reconciling,deleting状态不可以操作更新接口; - running,running_with_error状态可以操作nodegroup所有接口; - error状态只可以查询,删除; - delete状态的cluster在十五分钟内可以查询,十五分钟后无法查询到; - 状态限制; - pending,reconciling,deleting状态不可以操作更新接口; - running状态可以操作cluster所有接口; - error状态只可以查询,删除; - delete状态的cluster在十五分钟内可以查询,十五分钟后无法查询到; ''', description=''' - 设置工作节点组的自动修复。 + - 创建集群; - 证书; - 关于kubernetes的证书,默认生成,不需要用户传入。; - nodegroup; - cluster必须与nodeGroup进行绑定; - cluster支持多nodegroup; - 状态; - pending,reconciling,deleting状态不可以操作更新接口; - running,running_with_error状态可以操作nodegroup所有接口; - error状态只可以查询,删除; - delete状态的cluster在十五分钟内可以查询,十五分钟后无法查询到; - 状态限制; - pending,reconciling,deleting状态不可以操作更新接口; - running状态可以操作cluster所有接口; - error状态只可以查询,删除; - delete状态的cluster在十五分钟内可以查询,十五分钟后无法查询到; 。 - 示例: jdc kubernetes set-auto-repair --node-group-id xxx --enabled true + 示例: jdc kubernetes create-cluster --name xxx --node-group {"":""} --master-cidr xxx --access-key xxx --secret-key xxx ''', ) - def set_auto_repair(self): + def create_cluster(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.SetAutoRepairRequest import SetAutoRepairRequest + from jdcloud_sdk.services.kubernetes.apis.CreateClusterRequest import CreateClusterRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetAutoRepairRequest(params_dict, headers) + req = CreateClusterRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -675,29 +667,29 @@ def set_auto_repair(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), + (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 回滚未升级完的工作节点组 ''', + help=''' 查询单个集群详情。 ''', description=''' - 回滚未升级完的工作节点组。 + 查询单个集群详情。。 - 示例: jdc kubernetes rollback-node-group-upgrade --node-group-id xxx + 示例: jdc kubernetes describe-cluster --cluster-id xxx ''', ) - def rollback_node_group_upgrade(self): + def describe_cluster(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.RollbackNodeGroupUpgradeRequest import RollbackNodeGroupUpgradeRequest + from jdcloud_sdk.services.kubernetes.apis.DescribeClusterRequest import DescribeClusterRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RollbackNodeGroupUpgradeRequest(params_dict, headers) + req = DescribeClusterRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -708,30 +700,31 @@ def rollback_node_group_upgrade(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), - (['--ca-config'], dict(help="""(cAConfigSpec) 自动伸缩配置,其中 enable 必须指定 """, dest='caConfig', required=True)), + (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), + (['--name'], dict(help="""(string) 集群名称 """, dest='name', required=False)), + (['--description'], dict(help="""(string) 集群描述 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置工作节点组自动扩容 ''', + help=''' 修改集群的 名称 和 描述。
集群 name 和 description 必须要指定一个 ''', description=''' - 设置工作节点组自动扩容。 + 修改集群的 名称 和 描述。
集群 name 和 description 必须要指定一个。 - 示例: jdc kubernetes set-node-group-ca --node-group-id xxx --ca-config {"":""} + 示例: jdc kubernetes modify-cluster --cluster-id xxx ''', ) - def set_node_group_ca(self): + def modify_cluster(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.SetNodeGroupCARequest import SetNodeGroupCARequest + from jdcloud_sdk.services.kubernetes.apis.ModifyClusterRequest import ModifyClusterRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetNodeGroupCARequest(params_dict, headers) + req = ModifyClusterRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -742,30 +735,29 @@ def set_node_group_ca(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), - (['--node-group-id'], dict(help="""(string) 工作节点组 ID """, dest='nodeGroupId', required=True)), - (['--instance-ids'], dict(help="""(array: string) 需要从工作节点组中删除的实例; - 不可将一个集群中的实例全部删除; """, dest='instanceIds', required=False)), + (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 从工作节点组中删除指定实例 ''', + help=''' 删除集群,以及集群的所有node节点,网络,云盘等所有资源。 ''', description=''' - 从工作节点组中删除指定实例。 + 删除集群,以及集群的所有node节点,网络,云盘等所有资源。。 - 示例: jdc kubernetes delete-node-instances --node-group-id xxx + 示例: jdc kubernetes delete-cluster --cluster-id xxx ''', ) - def delete_node_instances(self): + def delete_cluster(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DeleteNodeInstancesRequest import DeleteNodeInstancesRequest + from jdcloud_sdk.services.kubernetes.apis.DeleteClusterRequest import DeleteClusterRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteNodeInstancesRequest(params_dict, headers) + req = DeleteClusterRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -775,30 +767,31 @@ def delete_node_instances(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--filters'], dict(help="""(array: filter) resourceTypes - 资源类型,暂时只支持[kubernetes]; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), + (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), + (['--enabled'], dict(help="""(bool) 是否开启自定义监控 """, dest='enabled', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询 kubernetes 集群配额 ''', + help=''' Deprecated 建议使用 setAddons 接口
设置用户自定义监控状态 ''', description=''' - 查询 kubernetes 集群配额。 + Deprecated 建议使用 setAddons 接口
设置用户自定义监控状态。 - 示例: jdc kubernetes describe-quotas + 示例: jdc kubernetes set-user-metrics --cluster-id xxx ''', ) - def describe_quotas(self): + def set_user_metrics(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DescribeQuotasRequest import DescribeQuotasRequest + from jdcloud_sdk.services.kubernetes.apis.SetUserMetricsRequest import SetUserMetricsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeQuotasRequest(params_dict, headers) + req = SetUserMetricsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -808,29 +801,30 @@ def describe_quotas(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), + (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询 kubernetes 集群服务配置信息 ''', + help=''' 终止升级 ''', description=''' - 查询 kubernetes 集群服务配置信息。 + 终止升级。 - 示例: jdc kubernetes describe-server-config + 示例: jdc kubernetes abort-upgrade --cluster-id xxx ''', ) - def describe_server_config(self): + def abort_upgrade(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DescribeServerConfigRequest import DescribeServerConfigRequest + from jdcloud_sdk.services.kubernetes.apis.AbortUpgradeRequest import AbortUpgradeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeServerConfigRequest(params_dict, headers) + req = AbortUpgradeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -840,30 +834,31 @@ def describe_server_config(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--master-version'], dict(help="""(string) 集群的大版本,如 1.12.4-jcs.1 """, dest='masterVersion', required=False)), + (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), + (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), + (['--node-group-ids'], dict(help="""(array: string) 节点组 ID """, dest='nodeGroupIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询版本信息 ''', + help=''' 查询集群操作进度 ''', description=''' - 查询版本信息。 + 查询集群操作进度。 - 示例: jdc kubernetes describe-versions + 示例: jdc kubernetes describe-progress --cluster-id xxx ''', ) - def describe_versions(self): + def describe_progress(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DescribeVersionsRequest import DescribeVersionsRequest + from jdcloud_sdk.services.kubernetes.apis.DescribeProgressRequest import DescribeProgressRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeVersionsRequest(params_dict, headers) + req = DescribeProgressRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -873,30 +868,32 @@ def describe_versions(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--node-version'], dict(help="""(string) 节点版本 """, dest='nodeVersion', required=True)), + (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), + (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), + (['--auto-upgrade'], dict(help="""(bool) 开启或者关闭集群自动升级,开启时必须指定 maintenancePolicy """, dest='autoUpgrade', required=True)), + (['--maintenance-window'], dict(help="""(maintenanceWindowSpec) 开启集群自动升级, 必须配置集群维护策略 """, dest='maintenanceWindow', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询节点版本 ''', + help=''' 设置自动升级 ''', description=''' - 查询节点版本。 + 设置自动升级。 - 示例: jdc kubernetes describe-node-version --node-version xxx + 示例: jdc kubernetes set-auto-upgrade --cluster-id xxx --auto-upgrade true ''', ) - def describe_node_version(self): + def set_auto_upgrade(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DescribeNodeVersionRequest import DescribeNodeVersionRequest + from jdcloud_sdk.services.kubernetes.apis.SetAutoUpgradeRequest import SetAutoUpgradeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeNodeVersionRequest(params_dict, headers) + req = SetAutoUpgradeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -906,30 +903,33 @@ def describe_node_version(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), + (['--scope'], dict(help="""(string) 升级范围 """, dest='scope', required=True)), + (['--node-group-ids'], dict(help="""(array: string) 节点组 id """, dest='nodeGroupIds', required=False)), + (['--version'], dict(help="""(string) 指定升级到的版本 """, dest='version', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询可升级的控制节点版本 ''', + help=''' 触发升级 ''', description=''' - 查询可升级的控制节点版本。 + 触发升级。 - 示例: jdc kubernetes describe-upgradable-master-versions --cluster-id xxx + 示例: jdc kubernetes upgrade-cluster --cluster-id xxx --scope xxx --version xxx ''', ) - def describe_upgradable_master_versions(self): + def upgrade_cluster(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DescribeUpgradableMasterVersionsRequest import DescribeUpgradableMasterVersionsRequest + from jdcloud_sdk.services.kubernetes.apis.UpgradeClusterRequest import UpgradeClusterRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeUpgradableMasterVersionsRequest(params_dict, headers) + req = UpgradeClusterRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -939,31 +939,31 @@ def describe_upgradable_master_versions(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--region-id'], dict(help="""(string) 地域 ID """, dest='regionId', required=False)), (['--cluster-id'], dict(help="""(string) 集群 ID """, dest='clusterId', required=True)), - (['--node-group-ids'], dict(help="""(array: string) 节点组 id """, dest='nodeGroupIds', required=False)), + (['--addons-config'], dict(help="""(array: addonConfigSpec) 需要设置的集群组件配置 """, dest='addonsConfig', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询可升级的节点版本 ''', + help=''' 设置集群组件 ''', description=''' - 查询可升级的节点版本。 + 设置集群组件。 - 示例: jdc kubernetes describe-upgradable-node-versions --cluster-id xxx + 示例: jdc kubernetes set-addons --cluster-id xxx --addons-config [{"":""}] ''', ) - def describe_upgradable_node_versions(self): + def set_addons(self): client_factory = ClientFactory('kubernetes') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.kubernetes.apis.DescribeUpgradableNodeVersionsRequest import DescribeUpgradableNodeVersionsRequest + from jdcloud_sdk.services.kubernetes.apis.SetAddonsRequest import SetAddonsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeUpgradableNodeVersionsRequest(params_dict, headers) + req = SetAddonsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -973,7 +973,7 @@ def describe_upgradable_node_versions(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-clusters','create-cluster','describe-cluster','modify-cluster','delete-cluster','set-user-metrics','abort-upgrade','describe-progress','set-auto-upgrade','upgrade-cluster','set-addons','describe-node-groups','create-node-group','describe-node-group','modify-node-group','delete-node-group','set-node-group-size','set-auto-repair','rollback-node-group-upgrade','set-node-group-ca','delete-node-instances','describe-quotas','describe-server-config','describe-versions','describe-node-version','describe-upgradable-master-versions','describe-upgradable-node-versions',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-node-groups','create-node-group','describe-node-group','modify-node-group','delete-node-group','set-node-group-size','set-auto-repair','rollback-node-group-upgrade','set-node-group-ca','delete-node-instances','describe-server-config','describe-versions','describe-node-version','describe-upgradable-master-versions','describe-upgradable-node-versions','describe-quotas','describe-clusters','create-cluster','describe-cluster','modify-cluster','delete-cluster','set-user-metrics','abort-upgrade','describe-progress','set-auto-upgrade','upgrade-cluster','set-addons',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/lb.py b/jdcloud_cli/controllers/services/lb.py index 56fa760..f42348b 100644 --- a/jdcloud_cli/controllers/services/lb.py +++ b/jdcloud_cli/controllers/services/lb.py @@ -28,7 +28,7 @@ class LbController(BaseController): class Meta: label = 'lb' - help = '京东云负载均衡' + help = '负载均衡' description = ''' lb cli 子命令,负载均衡相关API。 OpenAPI文档地址为:https://docs.jdcloud.com/cn/xxx/api/overview @@ -41,29 +41,30 @@ class Meta: (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) backendIds - 后端服务Id列表,支持多个; backendNames - 后端服务名称列表,支持多个; loadBalancerId - 负载均衡器Id,支持单个; agId - 高可用组Id,支持单个; loadBalancerType - 负载均衡类型,取值为:alb、nlb、dnlb,默认alb,支持单个; protocol - 后端服务的协议【alb】支持Http、Tcp,【nlb&dnlb】支持Tcp,默认查询所有,支持单个; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) urlMapIds - 转发规则组Id列表,支持多个; urlMapNames -转发规则组名称列表,支持多个; loadBalancerId - 负载均衡器Id,支持单个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询后端服务列表 ''', + help=''' 查询转发规则组列表详情 ''', description=''' - 查询后端服务列表。 + 查询转发规则组列表详情。 - 示例: jdc lb describe-backends + 示例: jdc lb describe-url-maps ''', ) - def describe_backends(self): + def describe_url_maps(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DescribeBackendsRequest import DescribeBackendsRequest + from jdcloud_sdk.services.lb.apis.DescribeUrlMapsRequest import DescribeUrlMapsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBackendsRequest(params_dict, headers) + req = DescribeUrlMapsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -74,46 +75,32 @@ def describe_backends(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--backend-name'], dict(help="""(string) 后端服务名字,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='backendName', required=True)), - (['--load-balancer-id'], dict(help="""(string) 后端服务所属负载均衡的Id """, dest='loadBalancerId', required=True)), - (['--protocol'], dict(help="""(string) 后端服务的协议
【alb】取值范围:Http、Tcp
【nlb】取值范围:Tcp
【dnlb】取值范围:Tcp """, dest='protocol', required=True)), - (['--port'], dict(help="""(int) 后端服务的端口,取值范围为[1, 65535],如指定了TargetSpec中的port,实际按照target指定的port进行转发 """, dest='port', type=int, required=True)), - (['--health-check-spec'], dict(help="""(healthCheckSpec) 健康检查信息 """, dest='healthCheckSpec', required=True)), - (['--algorithm'], dict(help="""(string) 调度算法
【alb,nlb】取值范围为[IpHash, RoundRobin, LeastConn](取值范围的含义:加权源Ip哈希,加权轮询和加权最小连接),alb和nlb默认为加权轮询
【dnlb】取值范围为[IpHash, QuintupleHash](取值范围的含义分别为:加权源Ip哈希和加权五元组哈希),dnlb默认为加权源Ip哈希 """, dest='algorithm', required=False)), - (['--target-group-ids'], dict(help="""(array: string) 虚拟服务器组的Id列表,目前只支持一个,且与agIds不能同时存在 """, dest='targetGroupIds', required=False)), - (['--ag-ids'], dict(help="""(array: string) 高可用组的Id列表,目前只支持一个,且与targetGroupIds不能同时存在 """, dest='agIds', required=False)), - (['--proxy-protocol'], dict(help="""(bool) 【alb Tcp协议】获取真实ip, 取值为False(不获取)或者True(获取,支持Proxy Protocol v1版本),默认为False """, dest='proxyProtocol', required=False)), + (['--url-map-name'], dict(help="""(string) 转发规则组名称,同一个负载均衡下,名称不能重复,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='urlMapName', required=True)), + (['--load-balancer-id'], dict(help="""(string) 转发规则组所属负载均衡的Id """, dest='loadBalancerId', required=True)), (['--description'], dict(help="""(string) 描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), - (['--session-stickiness'], dict(help="""(bool) 会话保持, 取值为false(不开启)或者true(开启),默认为false
【alb Http协议,RoundRobin算法】支持基于cookie的会话保持
【nlb】支持基于报文源目的IP的会话保持 """, dest='sessionStickiness', required=False)), - (['--session-sticky-timeout'], dict(help="""(int) 【nlb】会话保持超时时间,sessionStickiness开启时生效,默认300s, 取值范围[1-3600] """, dest='sessionStickyTimeout', type=int, required=False)), - (['--connection-draining-seconds'], dict(help="""(int) 【nlb】连接耗尽超时。移除target前,连接的最大保持时间,默认300s,取值范围[0-3600] """, dest='connectionDrainingSeconds', type=int, required=False)), - (['--http-cookie-expire-seconds'], dict(help="""(int) 【alb Http协议】cookie的过期时间,sessionStickiness开启时生效,取值范围为[0-86400], 默认为0(表示cookie与浏览器同生命周期) """, dest='httpCookieExpireSeconds', type=int, required=False)), - (['--http-forwarded-protocol'], dict(help="""(bool) 【alb Http协议】获取负载均衡的协议, 取值为False(不获取)或True(获取), 默认为False """, dest='httpForwardedProtocol', required=False)), - (['--http-forwarded-port'], dict(help="""(bool) 【alb Http协议】获取负载均衡的端口, 取值为False(不获取)或True(获取), 默认为False """, dest='httpForwardedPort', required=False)), - (['--http-forwarded-host'], dict(help="""(bool) 【alb Http协议】获取负载均衡的host信息, 取值为False(不获取)或True(获取), 默认为False """, dest='httpForwardedHost', required=False)), - (['--http-forwarded-vip'], dict(help="""(bool) 【alb Http协议】获取负载均衡的vip, 取值为False(不获取)或True(获取), 默认为False """, dest='httpForwardedVip', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个后端服务 ''', + help=''' 创建转发规则组,仅alb支持 ''', description=''' - 创建一个后端服务。 + 创建转发规则组,仅alb支持。 - 示例: jdc lb create-backend --backend-name xxx --load-balancer-id xxx --protocol xxx --port 0 --health-check-spec '{"":""}' + 示例: jdc lb create-url-map --url-map-name xxx --load-balancer-id xxx ''', ) - def create_backend(self): + def create_url_map(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.CreateBackendRequest import CreateBackendRequest + from jdcloud_sdk.services.lb.apis.CreateUrlMapRequest import CreateUrlMapRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateBackendRequest(params_dict, headers) + req = CreateUrlMapRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -124,29 +111,30 @@ def create_backend(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--backend-id'], dict(help="""(string) Backend Id """, dest='backendId', required=True)), + (['--url-map-id'], dict(help="""(string) 转发规则组Id """, dest='urlMapId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询后端服务详情 ''', + help=''' 查询转发规则组详情 ''', description=''' - 查询后端服务详情。 + 查询转发规则组详情。 - 示例: jdc lb describe-backend --backend-id xxx + 示例: jdc lb describe-url-map --url-map-id xxx ''', ) - def describe_backend(self): + def describe_url_map(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DescribeBackendRequest import DescribeBackendRequest + from jdcloud_sdk.services.lb.apis.DescribeUrlMapRequest import DescribeUrlMapRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBackendRequest(params_dict, headers) + req = DescribeUrlMapRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -157,45 +145,32 @@ def describe_backend(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--backend-id'], dict(help="""(string) Backend Id """, dest='backendId', required=True)), - (['--backend-name'], dict(help="""(string) 后端服务名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='backendName', required=False)), - (['--health-check-spec'], dict(help="""(healthCheckSpec) 健康检查信息 """, dest='healthCheckSpec', required=False)), - (['--algorithm'], dict(help="""(string) 调度算法
【alb,nlb】取值范围为[IpHash, RoundRobin, LeastConn](含义分别为:加权源Ip哈希,加权轮询和加权最小连接)
【dnlb】取值范围为[IpHash, QuintupleHash](含义分别为:加权源Ip哈希和加权五元组哈希) """, dest='algorithm', required=False)), - (['--target-group-ids'], dict(help="""(array: string) 虚拟服务器组的Id列表,目前只支持一个,且与agIds不能同时存在 """, dest='targetGroupIds', required=False)), - (['--ag-ids'], dict(help="""(array: string) 高可用组的Id列表,目前只支持一个,且与targetGroupIds不能同时存在 """, dest='agIds', required=False)), - (['--proxy-protocol'], dict(help="""(bool) 【alb Tcp协议】是否启用Proxy ProtocolV1协议获取真实源ip, 取值为false(不开启)或者true(开启), 默认为false """, dest='proxyProtocol', required=False)), - (['--description'], dict(help="""(string) 描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), - (['--session-stickiness'], dict(help="""(bool) 会话保持, 取值为false(不开启)或者true(开启),默认为false
【alb Http协议,RoundRobin算法】支持基于cookie的会话保持
【nlb】支持基于报文源目的IP的会话保持 """, dest='sessionStickiness', required=False)), - (['--session-sticky-timeout'], dict(help="""(int) 【nlb】会话保持超时时间,sessionStickiness开启时生效, 取值范围[1-3600] """, dest='sessionStickyTimeout', type=int, required=False)), - (['--connection-draining-seconds'], dict(help="""(int) 【nlb】连接耗尽超时,移除target前,连接的最大保持时间,默认300s,取值范围[0-3600] """, dest='connectionDrainingSeconds', type=int, required=False)), - (['--http-cookie-expire-seconds'], dict(help="""(int) 【alb Http协议】cookie的过期时间,sessionStickiness开启时生效,取值范围为[0-86400], 0表示cookie与浏览器同生命周期 """, dest='httpCookieExpireSeconds', type=int, required=False)), - (['--http-forwarded-protocol'], dict(help="""(bool) 【alb Http协议】获取负载均衡的协议, 取值为False(不获取)或True(获取) """, dest='httpForwardedProtocol', required=False)), - (['--http-forwarded-port'], dict(help="""(bool) 【alb Http协议】获取负载均衡的端口, 取值为False(不获取)或True(获取) """, dest='httpForwardedPort', required=False)), - (['--http-forwarded-host'], dict(help="""(bool) 【alb Http协议】获取负载均衡的host信息, 取值为False(不获取)或True(获取) """, dest='httpForwardedHost', required=False)), - (['--http-forwarded-vip'], dict(help="""(bool) 【alb Http协议】获取负载均衡的vip, 取值为False(不获取)或True(获取) """, dest='httpForwardedVip', required=False)), - (['--close-health-check'], dict(help="""(bool) 【alb,dnlb】关闭健康检查,取值为false(不关闭)或true(关闭) """, dest='closeHealthCheck', required=False)), + (['--url-map-id'], dict(help="""(string) 转发规则组Id """, dest='urlMapId', required=True)), + (['--description'], dict(help="""(string) 转发规则组描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--url-map-name'], dict(help="""(string) 转发规则组名称,同一个负载均衡下,名称不能重复,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='urlMapName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改一个后端服务的信息 ''', + help=''' 修改转发规则组 ''', description=''' - 修改一个后端服务的信息。 + 修改转发规则组。 - 示例: jdc lb update-backend --backend-id xxx + 示例: jdc lb update-url-map --url-map-id xxx ''', ) - def update_backend(self): + def update_url_map(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.UpdateBackendRequest import UpdateBackendRequest + from jdcloud_sdk.services.lb.apis.UpdateUrlMapRequest import UpdateUrlMapRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateBackendRequest(params_dict, headers) + req = UpdateUrlMapRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -206,29 +181,30 @@ def update_backend(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--backend-id'], dict(help="""(string) Backend Id """, dest='backendId', required=True)), + (['--url-map-id'], dict(help="""(string) 转发规则组Id """, dest='urlMapId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除一个后端服务 ''', + help=''' 删除转发规则组 ''', description=''' - 删除一个后端服务。 + 删除转发规则组。 - 示例: jdc lb delete-backend --backend-id xxx + 示例: jdc lb delete-url-map --url-map-id xxx ''', ) - def delete_backend(self): + def delete_url_map(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DeleteBackendRequest import DeleteBackendRequest + from jdcloud_sdk.services.lb.apis.DeleteUrlMapRequest import DeleteUrlMapRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteBackendRequest(params_dict, headers) + req = DeleteUrlMapRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -239,29 +215,101 @@ def delete_backend(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--backend-id'], dict(help="""(string) Backend Id """, dest='backendId', required=True)), + (['--url-map-id'], dict(help="""(string) 转发规则组Id """, dest='urlMapId', required=True)), + (['--rule-specs'], dict(help="""(array: ruleSpec) 转发规则的信息 """, dest='ruleSpecs', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询后端服务下的target的健康状态 ''', + help=''' 往转发规则组加入转发规则 ''', description=''' - 查询后端服务下的target的健康状态。 + 往转发规则组加入转发规则。 - 示例: jdc lb describe-target-health --backend-id xxx + 示例: jdc lb add-rules --url-map-id xxx --rule-specs ['{"":""}'] ''', ) - def describe_target_health(self): + def add_rules(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DescribeTargetHealthRequest import DescribeTargetHealthRequest + from jdcloud_sdk.services.lb.apis.AddRulesRequest import AddRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeTargetHealthRequest(params_dict, headers) + req = AddRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--url-map-id'], dict(help="""(string) 转发规则组Id """, dest='urlMapId', required=True)), + (['--rule-update-specs'], dict(help="""(array: ruleUpdateSpec) 更新转发规则rules信息 """, dest='ruleUpdateSpecs', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改转发规则 ''', + description=''' + 修改转发规则。 + + 示例: jdc lb update-rules --url-map-id xxx --rule-update-specs ['{"":""}'] + ''', + ) + def update_rules(self): + client_factory = ClientFactory('lb') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.lb.apis.UpdateRulesRequest import UpdateRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--url-map-id'], dict(help="""(string) 转发规则组Id """, dest='urlMapId', required=True)), + (['--rule-ids'], dict(help="""(array: string) rule Id列表 """, dest='ruleIds', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除转发规则 ''', + description=''' + 删除转发规则。 + + 示例: jdc lb delete-rules --url-map-id xxx + ''', + ) + def delete_rules(self): + client_factory = ClientFactory('lb') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.lb.apis.DeleteRulesRequest import DeleteRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -274,29 +322,30 @@ def describe_target_health(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) listenerNames - 监听器名称列表,支持多个; listenerIds - 监听器Id列表,支持多个; loadBalancerId - 负载均衡器Id,支持单个; loadBalancerType - 负载均衡类型,取值为:alb、nlb、dnlb,默认alb,支持单个; urlMapIds - 【仅alb支持】转发规则组Id列表,支持多个; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) targetGroupIds - TargetGroup ID列表,支持多个; targetGroupNames - TargetGroup名称列表,支持多个; loadBalancerId - TargetGroup所属负载均衡的Id,支持单个; loadBalancerType - 负载均衡类型,取值为:alb、nlb、dnlb,默认alb,支持单个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询监听器列表 ''', + help=''' 查询虚拟服务器组列表详情,返回target详情功能3个月后将会下线,建议用户直接使用describeTargets接口查询target详情 ''', description=''' - 查询监听器列表。 + 查询虚拟服务器组列表详情,返回target详情功能3个月后将会下线,建议用户直接使用describeTargets接口查询target详情。 - 示例: jdc lb describe-listeners + 示例: jdc lb describe-target-groups ''', ) - def describe_listeners(self): + def describe_target_groups(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DescribeListenersRequest import DescribeListenersRequest + from jdcloud_sdk.services.lb.apis.DescribeTargetGroupsRequest import DescribeTargetGroupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeListenersRequest(params_dict, headers) + req = DescribeTargetGroupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -307,38 +356,33 @@ def describe_listeners(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--listener-name'], dict(help="""(string) Listener的名字,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='listenerName', required=True)), - (['--protocol'], dict(help="""(string) 监听协议, 取值为Tcp, Tls, Http, Https
【alb】支持Http, Https,Tcp和Tls
【nlb】支持Tcp
【dnlb】支持Tcp """, dest='protocol', required=True)), - (['--port'], dict(help="""(int) 监听端口,取值范围为[1, 65535] """, dest='port', type=int, required=True)), - (['--backend-id'], dict(help="""(string) 默认的后端服务Id """, dest='backendId', required=True)), - (['--load-balancer-id'], dict(help="""(string) Listener所属loadBalancer的Id """, dest='loadBalancerId', required=True)), - (['--url-map-id'], dict(help="""(string) 【alb Https和Http协议】转发规则组Id """, dest='urlMapId', required=False)), - (['--action'], dict(help="""(string) 默认后端服务的转发策略,取值为Forward或Redirect, 现只支持Forward, 默认为Forward """, dest='action', required=False)), - (['--certificate-specs'], dict(help="""(array: certificateSpec) 【alb Https和Tls协议】ssl server证书列表,现只支持一个证书 """, dest='certificateSpecs', required=False)), - (['--connection-idle-time-seconds'], dict(help="""(int) 【alb、nlb】空闲连接超时时间, 范围为[1,86400]。
(Tcp和Tls协议)默认为:1800s
(Http和Https协议)默认为:60s
【dnlb】不支持 """, dest='connectionIdleTimeSeconds', type=int, required=False)), + (['--target-group-name'], dict(help="""(string) 虚拟服务器组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='targetGroupName', required=True)), + (['--load-balancer-id'], dict(help="""(string) 负载均衡的Id """, dest='loadBalancerId', required=True)), (['--description'], dict(help="""(string) 描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--type'], dict(help="""(string) 类型,取值为instance或ip """, dest='type', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个监听器 ''', + help=''' 创建一个虚拟服务器组 ''', description=''' - 创建一个监听器。 + 创建一个虚拟服务器组。 - 示例: jdc lb create-listener --listener-name xxx --protocol xxx --port 0 --backend-id xxx --load-balancer-id xxx + 示例: jdc lb create-target-group --target-group-name xxx --load-balancer-id xxx ''', ) - def create_listener(self): + def create_target_group(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.CreateListenerRequest import CreateListenerRequest + from jdcloud_sdk.services.lb.apis.CreateTargetGroupRequest import CreateTargetGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateListenerRequest(params_dict, headers) + req = CreateTargetGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -349,29 +393,30 @@ def create_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询监听器详情 ''', + help=''' 查询TargetGroup详情,返回target详情功能3个月后将会下线,建议用户直接使用describeTargets接口查询target详情 ''', description=''' - 查询监听器详情。 + 查询TargetGroup详情,返回target详情功能3个月后将会下线,建议用户直接使用describeTargets接口查询target详情。 - 示例: jdc lb describe-listener --listener-id xxx + 示例: jdc lb describe-target-group --target-group-id xxx ''', ) - def describe_listener(self): + def describe_target_group(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DescribeListenerRequest import DescribeListenerRequest + from jdcloud_sdk.services.lb.apis.DescribeTargetGroupRequest import DescribeTargetGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeListenerRequest(params_dict, headers) + req = DescribeTargetGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -382,36 +427,32 @@ def describe_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), - (['--listener-name'], dict(help="""(string) 监听器名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='listenerName', required=False)), - (['--status'], dict(help="""(string) Listener状态, 取值为On或者为Off """, dest='status', required=False)), - (['--certificate-specs'], dict(help="""(array: certificateSpec) 【alb Https和Tls协议】ssl server证书列表,现只支持一个证书 """, dest='certificateSpecs', required=False)), - (['--connection-idle-time-seconds'], dict(help="""(int) 【alb、nlb】空闲连接超时时间, 范围为[1,86400]。
(Tcp和Tls协议)默认为:1800s
(Http和Https协议)默认为:60s
【dnlb】不支持该功能 """, dest='connectionIdleTimeSeconds', type=int, required=False)), - (['--backend-id'], dict(help="""(string) 默认后端服务Id """, dest='backendId', required=False)), - (['--url-map-id'], dict(help="""(string) 【alb Https和Http协议】转发规则组Id """, dest='urlMapId', required=False)), - (['--description'], dict(help="""(string) 监听器描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), + (['--description'], dict(help="""(string) 虚拟服务器组描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--target-group-name'], dict(help="""(string) 虚拟服务器组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='targetGroupName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改一个监听器的信息 ''', + help=''' 修改一个虚拟服务器组的信息 ''', description=''' - 修改一个监听器的信息。 + 修改一个虚拟服务器组的信息。 - 示例: jdc lb update-listener --listener-id xxx + 示例: jdc lb update-target-group --target-group-id xxx ''', ) - def update_listener(self): + def update_target_group(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.UpdateListenerRequest import UpdateListenerRequest + from jdcloud_sdk.services.lb.apis.UpdateTargetGroupRequest import UpdateTargetGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateListenerRequest(params_dict, headers) + req = UpdateTargetGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -422,29 +463,30 @@ def update_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除一个监听器 ''', + help=''' 删除一个虚拟服务器组 ''', description=''' - 删除一个监听器。 + 删除一个虚拟服务器组。 - 示例: jdc lb delete-listener --listener-id xxx + 示例: jdc lb delete-target-group --target-group-id xxx ''', ) - def delete_listener(self): + def delete_target_group(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DeleteListenerRequest import DeleteListenerRequest + from jdcloud_sdk.services.lb.apis.DeleteTargetGroupRequest import DeleteTargetGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteListenerRequest(params_dict, headers) + req = DeleteTargetGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -455,31 +497,31 @@ def delete_listener(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) loadBalancerType - 负载均衡类型,取值为:alb、nlb、dnlb,默认alb,支持单个; loadBalancerIds - 负载均衡ID列表,支持多个; loadBalancerNames - 负载均衡名称列表,支持多个; vpcId - 负载均衡所在Vpc的Id,支持单个; """, dest='filters', required=False)), + (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), + (['--target-specs'], dict(help="""(array: targetSpec) 注册Target列表 """, dest='targetSpecs', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询负载均衡列表详情 ''', + help=''' 往TargetGroup中加入Target ''', description=''' - 查询负载均衡列表详情。 + 往TargetGroup中加入Target。 - 示例: jdc lb describe-load-balancers + 示例: jdc lb register-targets --target-group-id xxx --target-specs ['{"":""}'] ''', ) - def describe_load_balancers(self): + def register_targets(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DescribeLoadBalancersRequest import DescribeLoadBalancersRequest + from jdcloud_sdk.services.lb.apis.RegisterTargetsRequest import RegisterTargetsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLoadBalancersRequest(params_dict, headers) + req = RegisterTargetsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -490,37 +532,31 @@ def describe_load_balancers(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--load-balancer-name'], dict(help="""(string) LoadBalancer的名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='loadBalancerName', required=True)), - (['--subnet-id'], dict(help="""(string) LoadBalancer所属子网的Id """, dest='subnetId', required=True)), - (['--type'], dict(help="""(string) LoadBalancer的类型,取值:alb、nlb、dnlb,默认为alb """, dest='type', required=False)), - (['--azs'], dict(help="""(array: string) 【alb,nlb】LoadBalancer所属availability Zone列表,对于alb,nlb是必选参数
【dnlb】全可用区可用,不必传该参数 """, dest='azs', required=False)), - (['--charge-spec'], dict(help="""(chargeSpec) 【alb】支持按用量计费,默认为按用量。【nlb】支持按用量计费。【dnlb】支持按配置计费 """, dest='chargeSpec', required=False)), - (['--elastic-ip'], dict(help="""(elasticIpSpec) 负载均衡关联的弹性IP规格 """, dest='elasticIp', required=False)), - (['--security-group-ids'], dict(help="""(array: string) 【alb】 安全组 ID列表 """, dest='securityGroupIds', required=False)), - (['--description'], dict(help="""(string) LoadBalancer的描述信息,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), - (['--delete-protection'], dict(help="""(bool) 删除保护,取值为True(开启)或False(关闭),默认为False """, dest='deleteProtection', required=False)), + (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), + (['--target-ids'], dict(help="""(array: string) Target Id列表 """, dest='targetIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建负载均衡 ''', + help=''' 从TargetGroup中移除一个或多个Target,失败则全部回滚。 成功移除的target将不会再接收来自loadbalancer新建连接的流量 ''', description=''' - 创建负载均衡。 + 从TargetGroup中移除一个或多个Target,失败则全部回滚。 成功移除的target将不会再接收来自loadbalancer新建连接的流量。 - 示例: jdc lb create-load-balancer --load-balancer-name xxx --subnet-id xxx + 示例: jdc lb de-register-targets --target-group-id xxx ''', ) - def create_load_balancer(self): + def de_register_targets(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.CreateLoadBalancerRequest import CreateLoadBalancerRequest + from jdcloud_sdk.services.lb.apis.DeRegisterTargetsRequest import DeRegisterTargetsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateLoadBalancerRequest(params_dict, headers) + req = DeRegisterTargetsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -531,29 +567,31 @@ def create_load_balancer(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), + (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), + (['--target-update-specs'], dict(help="""(array: targetUpdateSpec) 修改target信息 """, dest='targetUpdateSpecs', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询负载均衡详情 ''', + help=''' 修改target信息 ''', description=''' - 查询负载均衡详情。 + 修改target信息。 - 示例: jdc lb describe-load-balancer --load-balancer-id xxx + 示例: jdc lb update-targets --target-group-id xxx --target-update-specs ['{"":""}'] ''', ) - def describe_load_balancer(self): + def update_targets(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DescribeLoadBalancerRequest import DescribeLoadBalancerRequest + from jdcloud_sdk.services.lb.apis.UpdateTargetsRequest import UpdateTargetsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLoadBalancerRequest(params_dict, headers) + req = UpdateTargetsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -564,33 +602,33 @@ def describe_load_balancer(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), - (['--load-balancer-name'], dict(help="""(string) LoadBalancer的名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='loadBalancerName', required=False)), - (['--action'], dict(help="""(string) 启用或停止LoadBalancer,取值为Start(启用)或Stop(停止) """, dest='action', required=False)), - (['--description'], dict(help="""(string) LoadBalancer的描述信息,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), - (['--delete-protection'], dict(help="""(bool) 删除保护,取值为True(开启)或False(关闭),默认为False """, dest='deleteProtection', required=False)), + (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) targetIds - Target ID列表,支持多个; instanceId - Instance ID,仅支持单个; type - vm, container, ip,仅支持单个; port - 端口,仅支持单个; ipAddress - ip地址,仅支持单个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新负载均衡信息 ''', + help=''' 查询Target列表详情 ''', description=''' - 更新负载均衡信息。 + 查询Target列表详情。 - 示例: jdc lb update-load-balancer --load-balancer-id xxx + 示例: jdc lb describe-targets --target-group-id xxx ''', ) - def update_load_balancer(self): + def describe_targets(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.UpdateLoadBalancerRequest import UpdateLoadBalancerRequest + from jdcloud_sdk.services.lb.apis.DescribeTargetsRequest import DescribeTargetsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateLoadBalancerRequest(params_dict, headers) + req = DescribeTargetsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -601,29 +639,32 @@ def update_load_balancer(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) backendIds - 后端服务Id列表,支持多个; backendNames - 后端服务名字列表,支持多个; loadBalancerId - 负载均衡器Id,支持单个; agId - 可用性组Id,支持单个; loadBalancerType - 负载均衡类型,取值为:alb、nlb、dnlb,默认alb,支持单个; protocol - 后端服务的协议【alb】支持Http、Tcp和Udp,【nlb】支持Tcp、Udp,【dnlb】支持Tcp、Udp,默认查询所有,支持单个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除负载均衡,负载均衡下的监听器,转发规则组(仅alb支持),后端服务,服务器组会一起删除 ''', + help=''' 查询后端服务列表 ''', description=''' - 删除负载均衡,负载均衡下的监听器,转发规则组(仅alb支持),后端服务,服务器组会一起删除。 + 查询后端服务列表。 - 示例: jdc lb delete-load-balancer --load-balancer-id xxx + 示例: jdc lb describe-backends ''', ) - def delete_load_balancer(self): + def describe_backends(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DeleteLoadBalancerRequest import DeleteLoadBalancerRequest + from jdcloud_sdk.services.lb.apis.DescribeBackendsRequest import DescribeBackendsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLoadBalancerRequest(params_dict, headers) + req = DescribeBackendsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -634,30 +675,48 @@ def delete_load_balancer(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), - (['--elastic-ip-id'], dict(help="""(string) 弹性公网IP ID """, dest='elasticIpId', required=True)), + (['--backend-name'], dict(help="""(string) 后端服务名字,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='backendName', required=True)), + (['--load-balancer-id'], dict(help="""(string) 后端服务所属负载均衡的Id """, dest='loadBalancerId', required=True)), + (['--protocol'], dict(help="""(string) 后端服务的协议
【alb】取值范围:Http、Tcp、Udp
【nlb】取值范围:Tcp、Udp
【dnlb】取值范围:Tcp、Udp """, dest='protocol', required=True)), + (['--port'], dict(help="""(int) 后端服务的端口,取值范围为[1, 65535],如指定了TargetSpec中的port,实际按照target指定的port进行转发 """, dest='port', type=int, required=True)), + (['--health-check-spec'], dict(help="""(healthCheckSpec) 健康检查信息 """, dest='healthCheckSpec', required=True)), + (['--algorithm'], dict(help="""(string) 调度算法
【alb,nlb】取值范围为[IpHash, RoundRobin, LeastConn](取值范围的含义:加权源Ip哈希,加权轮询和加权最小连接),alb和nlb默认为加权轮询
【dnlb】取值范围为[IpHash, QuintupleHash](取值范围的含义分别为:加权源Ip哈希和加权五元组哈希),dnlb默认为加权源Ip哈希 """, dest='algorithm', required=False)), + (['--target-group-ids'], dict(help="""(array: string) 虚拟服务器组的Id列表,目前只支持一个,且与agIds不能同时存在 """, dest='targetGroupIds', required=False)), + (['--ag-ids'], dict(help="""(array: string) 高可用组的Id列表,目前只支持一个,且与targetGroupIds不能同时存在 """, dest='agIds', required=False)), + (['--proxy-protocol'], dict(help="""(bool) 【alb Tcp、Udp协议】获取真实ip, 取值为False(不获取)或者True(获取,支持Proxy Protocol v1版本),默认为False """, dest='proxyProtocol', type=bool, required=False)), + (['--description'], dict(help="""(string) 描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--session-stickiness'], dict(help="""(bool) 会话保持, 取值为false(不开启)或者true(开启),默认为false
【alb Http协议,RoundRobin算法】支持基于cookie的会话保持
【nlb】支持基于报文源目的IP的会话保持 """, dest='sessionStickiness', type=bool, required=False)), + (['--session-sticky-timeout'], dict(help="""(int) 【nlb】会话保持超时时间,sessionStickiness开启时生效,默认300s, 取值范围[1-3600] """, dest='sessionStickyTimeout', type=int, required=False)), + (['--connection-draining-seconds'], dict(help="""(int) 【nlb】连接耗尽超时。移除target前,连接的最大保持时间,默认300s,取值范围[0-3600] """, dest='connectionDrainingSeconds', type=int, required=False)), + (['--http-cookie-expire-seconds'], dict(help="""(int) 【alb Http协议】cookie的过期时间,sessionStickiness开启时生效,取值范围为[0-86400], 默认为0(表示cookie与浏览器同生命周期) """, dest='httpCookieExpireSeconds', type=int, required=False)), + (['--http-forwarded-protocol'], dict(help="""(bool) 【alb Http协议】获取负载均衡的协议, 取值为False(不获取)或True(获取), 默认为False """, dest='httpForwardedProtocol', type=bool, required=False)), + (['--http-forwarded-port'], dict(help="""(bool) 【alb Http协议】获取负载均衡的端口, 取值为False(不获取)或True(获取), 默认为False """, dest='httpForwardedPort', type=bool, required=False)), + (['--http-forwarded-host'], dict(help="""(bool) 【alb Http协议】获取负载均衡的host信息, 取值为False(不获取)或True(获取), 默认为False """, dest='httpForwardedHost', type=bool, required=False)), + (['--http-forwarded-vip'], dict(help="""(bool) 【alb Http协议】获取负载均衡的vip, 取值为False(不获取)或True(获取), 默认为False """, dest='httpForwardedVip', type=bool, required=False)), + (['--http-forwarded-client-port'], dict(help="""(bool) 【alb Http协议】获取请求端使用的端口, 取值为False(不获取)或True(获取), 默认为False """, dest='httpForwardedClientPort', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 负载均衡绑定弹性公网IP ''', + help=''' 创建一个后端服务 ''', description=''' - 负载均衡绑定弹性公网IP。 + 创建一个后端服务。 - 示例: jdc lb associate-elastic-ip --load-balancer-id xxx --elastic-ip-id xxx + 示例: jdc lb create-backend --backend-name xxx --load-balancer-id xxx --protocol xxx --port 5 --health-check-spec '{"":""}' ''', ) - def associate_elastic_ip(self): + def create_backend(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.AssociateElasticIpRequest import AssociateElasticIpRequest + from jdcloud_sdk.services.lb.apis.CreateBackendRequest import CreateBackendRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AssociateElasticIpRequest(params_dict, headers) + req = CreateBackendRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -668,30 +727,30 @@ def associate_elastic_ip(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), - (['--elastic-ip-id'], dict(help="""(string) 弹性公网IP ID """, dest='elasticIpId', required=True)), + (['--backend-id'], dict(help="""(string) Backend Id """, dest='backendId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 负载均衡解绑弹性公网IP ''', + help=''' 查询后端服务详情 ''', description=''' - 负载均衡解绑弹性公网IP。 + 查询后端服务详情。 - 示例: jdc lb disassociate-elastic-ip --load-balancer-id xxx --elastic-ip-id xxx + 示例: jdc lb describe-backend --backend-id xxx ''', ) - def disassociate_elastic_ip(self): + def describe_backend(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DisassociateElasticIpRequest import DisassociateElasticIpRequest + from jdcloud_sdk.services.lb.apis.DescribeBackendRequest import DescribeBackendRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisassociateElasticIpRequest(params_dict, headers) + req = DescribeBackendRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -702,30 +761,47 @@ def disassociate_elastic_ip(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), - (['--security-group-ids'], dict(help="""(array: string) 安全组 ID列表 """, dest='securityGroupIds', required=False)), + (['--backend-id'], dict(help="""(string) Backend Id """, dest='backendId', required=True)), + (['--backend-name'], dict(help="""(string) 后端服务名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='backendName', required=False)), + (['--health-check-spec'], dict(help="""(healthCheckSpec) 健康检查信息 """, dest='healthCheckSpec', required=False)), + (['--algorithm'], dict(help="""(string) 调度算法
【alb,nlb】取值范围为[IpHash, RoundRobin, LeastConn](含义分别为:加权源Ip哈希,加权轮询和加权最小连接)
【dnlb】取值范围为[IpHash, QuintupleHash](含义分别为:加权源Ip哈希和加权五元组哈希) """, dest='algorithm', required=False)), + (['--target-group-ids'], dict(help="""(array: string) 虚拟服务器组的Id列表,目前只支持一个,且与agIds不能同时存在 """, dest='targetGroupIds', required=False)), + (['--ag-ids'], dict(help="""(array: string) 高可用组的Id列表,目前只支持一个,且与targetGroupIds不能同时存在 """, dest='agIds', required=False)), + (['--proxy-protocol'], dict(help="""(bool) 【alb Tcp、Udp协议】是否启用Proxy ProtocolV1协议获取真实源ip, 取值为false(不开启)或者true(开启), 默认为false """, dest='proxyProtocol', type=bool, required=False)), + (['--description'], dict(help="""(string) 描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--session-stickiness'], dict(help="""(bool) 会话保持, 取值为false(不开启)或者true(开启),默认为false
【alb Http协议,RoundRobin算法】支持基于cookie的会话保持
【nlb】支持基于报文源目的IP的会话保持 """, dest='sessionStickiness', type=bool, required=False)), + (['--session-sticky-timeout'], dict(help="""(int) 【nlb】会话保持超时时间,sessionStickiness开启时生效, 取值范围[1-3600] """, dest='sessionStickyTimeout', type=int, required=False)), + (['--connection-draining-seconds'], dict(help="""(int) 【nlb】连接耗尽超时,移除target前,连接的最大保持时间,默认300s,取值范围[0-3600] """, dest='connectionDrainingSeconds', type=int, required=False)), + (['--http-cookie-expire-seconds'], dict(help="""(int) 【alb Http协议】cookie的过期时间,sessionStickiness开启时生效,取值范围为[0-86400], 0表示cookie与浏览器同生命周期 """, dest='httpCookieExpireSeconds', type=int, required=False)), + (['--http-forwarded-protocol'], dict(help="""(bool) 【alb Http协议】获取负载均衡的协议, 取值为False(不获取)或True(获取) """, dest='httpForwardedProtocol', type=bool, required=False)), + (['--http-forwarded-port'], dict(help="""(bool) 【alb Http协议】获取负载均衡的端口, 取值为False(不获取)或True(获取) """, dest='httpForwardedPort', type=bool, required=False)), + (['--http-forwarded-host'], dict(help="""(bool) 【alb Http协议】获取负载均衡的host信息, 取值为False(不获取)或True(获取) """, dest='httpForwardedHost', type=bool, required=False)), + (['--http-forwarded-vip'], dict(help="""(bool) 【alb Http协议】获取负载均衡的vip, 取值为False(不获取)或True(获取) """, dest='httpForwardedVip', type=bool, required=False)), + (['--http-forwarded-client-port'], dict(help="""(bool) 【alb Http协议】获取请求端使用的端口, 取值为False(不获取)或True(获取) """, dest='httpForwardedClientPort', type=bool, required=False)), + (['--close-health-check'], dict(help="""(bool) 【alb,dnlb】关闭健康检查,取值为false(不关闭)或true(关闭) """, dest='closeHealthCheck', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 负载均衡绑定安全组 ''', + help=''' 修改一个后端服务的信息 ''', description=''' - 负载均衡绑定安全组。 + 修改一个后端服务的信息。 - 示例: jdc lb associate-security-group --load-balancer-id xxx + 示例: jdc lb update-backend --backend-id xxx ''', ) - def associate_security_group(self): + def update_backend(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.AssociateSecurityGroupRequest import AssociateSecurityGroupRequest + from jdcloud_sdk.services.lb.apis.UpdateBackendRequest import UpdateBackendRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AssociateSecurityGroupRequest(params_dict, headers) + req = UpdateBackendRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -736,30 +812,64 @@ def associate_security_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), - (['--security-group-ids'], dict(help="""(array: string) 安全组 ID列表 """, dest='securityGroupIds', required=False)), + (['--backend-id'], dict(help="""(string) Backend Id """, dest='backendId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 负载均衡解绑安全组 ''', + help=''' 删除一个后端服务 ''', description=''' - 负载均衡解绑安全组。 + 删除一个后端服务。 - 示例: jdc lb disassociate-security-group --load-balancer-id xxx + 示例: jdc lb delete-backend --backend-id xxx ''', ) - def disassociate_security_group(self): + def delete_backend(self): + client_factory = ClientFactory('lb') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.lb.apis.DeleteBackendRequest import DeleteBackendRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteBackendRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--backend-id'], dict(help="""(string) Backend Id """, dest='backendId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询后端服务下的target的健康状态 ''', + description=''' + 查询后端服务下的target的健康状态。 + + 示例: jdc lb describe-target-health --backend-id xxx + ''', + ) + def describe_target_health(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DisassociateSecurityGroupRequest import DisassociateSecurityGroupRequest + from jdcloud_sdk.services.lb.apis.DescribeTargetHealthRequest import DescribeTargetHealthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisassociateSecurityGroupRequest(params_dict, headers) + req = DescribeTargetHealthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -772,29 +882,31 @@ def disassociate_security_group(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) targetGroupIds - TargetGroup ID列表,支持多个; targetGroupNames - TargetGroup名称列表,支持多个; loadBalancerId - TargetGroup所属负载均衡的Id,支持单个; loadBalancerType - 负载均衡类型,取值为:alb、nlb、dnlb,默认alb,支持单个; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) loadBalancerType - 负载均衡类型,取值为:alb、nlb、dnlb,默认alb,支持单个; loadBalancerIds - 负载均衡ID列表,支持多个; loadBalancerNames - 负载均衡名称列表,支持多个; vpcId - 负载均衡所在Vpc的Id,支持单个; azType - 负载均衡所在可用区类型,取值包括:all(全部可用区)、standard(标准可用区)、edge(边缘可用区)。默认standard ,支持单个; azs - 边缘可用区,支持多个; """, dest='filters', required=False)), + (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询虚拟服务器组列表详情 ''', + help=''' 查询负载均衡列表详情 ''', description=''' - 查询虚拟服务器组列表详情。 + 查询负载均衡列表详情。 - 示例: jdc lb describe-target-groups + 示例: jdc lb describe-load-balancers ''', ) - def describe_target_groups(self): + def describe_load_balancers(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DescribeTargetGroupsRequest import DescribeTargetGroupsRequest + from jdcloud_sdk.services.lb.apis.DescribeLoadBalancersRequest import DescribeLoadBalancersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeTargetGroupsRequest(params_dict, headers) + req = DescribeLoadBalancersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -805,31 +917,40 @@ def describe_target_groups(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--target-group-name'], dict(help="""(string) 虚拟服务器组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='targetGroupName', required=True)), - (['--load-balancer-id'], dict(help="""(string) 负载均衡的Id """, dest='loadBalancerId', required=True)), - (['--description'], dict(help="""(string) 描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--load-balancer-name'], dict(help="""(string) LoadBalancer的名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='loadBalancerName', required=True)), + (['--subnet-id'], dict(help="""(string) LoadBalancer所属子网的Id """, dest='subnetId', required=True)), + (['--type'], dict(help="""(string) LoadBalancer的类型,取值:alb、nlb、dnlb,默认为alb """, dest='type', required=False)), + (['--azs'], dict(help="""(array: string) 【alb,nlb】LoadBalancer所属availability Zone列表,对于alb,nlb是必选参数,可用区个数不能超过2个
【dnlb】中心可用区,dnlb不需要传该参数,全可用区可用;边缘可用区,仅支持传入单可用区 """, dest='azs', required=False)), + (['--charge-spec'], dict(help="""(chargeSpec) 【alb】支持按用量计费,默认为按用量。【nlb】支持按用量计费。【dnlb】支持按配置计费 """, dest='chargeSpec', required=False)), + (['--elastic-ip'], dict(help="""(elasticIpSpec) 负载均衡关联的弹性IP规格 """, dest='elasticIp', required=False)), + (['--private-ip-address'], dict(help="""(string) 指定LoadBalancer的VIP(内网IPv4地址),需要属于指定的子网并且未被占用 """, dest='privateIpAddress', required=False)), + (['--security-group-ids'], dict(help="""(array: string) 【alb】 安全组 ID列表 """, dest='securityGroupIds', required=False)), + (['--description'], dict(help="""(string) LoadBalancer的描述信息,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--delete-protection'], dict(help="""(bool) 删除保护,取值为True(开启)或False(关闭),默认为False """, dest='deleteProtection', type=bool, required=False)), + (['--user-tags'], dict(help="""(array: tag) 用户tag 信息 """, dest='userTags', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个虚拟服务器组 ''', + help=''' 创建负载均衡 ''', description=''' - 创建一个虚拟服务器组。 + 创建负载均衡。 - 示例: jdc lb create-target-group --target-group-name xxx --load-balancer-id xxx + 示例: jdc lb create-load-balancer --load-balancer-name xxx --subnet-id xxx ''', ) - def create_target_group(self): + def create_load_balancer(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.CreateTargetGroupRequest import CreateTargetGroupRequest + from jdcloud_sdk.services.lb.apis.CreateLoadBalancerRequest import CreateLoadBalancerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateTargetGroupRequest(params_dict, headers) + req = CreateLoadBalancerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -840,29 +961,30 @@ def create_target_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), + (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询TargetGroup详情 ''', + help=''' 查询负载均衡详情 ''', description=''' - 查询TargetGroup详情。 + 查询负载均衡详情。 - 示例: jdc lb describe-target-group --target-group-id xxx + 示例: jdc lb describe-load-balancer --load-balancer-id xxx ''', ) - def describe_target_group(self): + def describe_load_balancer(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DescribeTargetGroupRequest import DescribeTargetGroupRequest + from jdcloud_sdk.services.lb.apis.DescribeLoadBalancerRequest import DescribeLoadBalancerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeTargetGroupRequest(params_dict, headers) + req = DescribeLoadBalancerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -873,31 +995,36 @@ def describe_target_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), - (['--description'], dict(help="""(string) 虚拟服务器组描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), - (['--target-group-name'], dict(help="""(string) 虚拟服务器组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='targetGroupName', required=False)), + (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), + (['--load-balancer-name'], dict(help="""(string) LoadBalancer的名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='loadBalancerName', required=False)), + (['--action'], dict(help="""(string) 启用或停止LoadBalancer,取值为Start(启用)或Stop(停止) """, dest='action', required=False)), + (['--description'], dict(help="""(string) LoadBalancer的描述信息,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--domain-enable'], dict(help="""(bool) 是否绑定域名,包括外网和内网,缺省为不改变原值 """, dest='domainEnable', type=bool, required=False)), + (['--delete-protection'], dict(help="""(bool) 删除保护,取值为True(开启)或False(关闭),默认为False """, dest='deleteProtection', type=bool, required=False)), + (['--private-ip-address'], dict(help="""(string) 变更loadBalancer的vip地址,新地址只允许是loadBalancer本子网中的空闲ip地址,缺省为不改变原值 """, dest='privateIpAddress', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改一个虚拟服务器组的信息 ''', + help=''' 更新负载均衡信息 ''', description=''' - 修改一个虚拟服务器组的信息。 + 更新负载均衡信息。 - 示例: jdc lb update-target-group --target-group-id xxx + 示例: jdc lb update-load-balancer --load-balancer-id xxx ''', ) - def update_target_group(self): + def update_load_balancer(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.UpdateTargetGroupRequest import UpdateTargetGroupRequest + from jdcloud_sdk.services.lb.apis.UpdateLoadBalancerRequest import UpdateLoadBalancerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateTargetGroupRequest(params_dict, headers) + req = UpdateLoadBalancerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -908,29 +1035,30 @@ def update_target_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), + (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除一个虚拟服务器组 ''', + help=''' 删除负载均衡,负载均衡下的监听器,转发规则组(仅alb支持),后端服务,服务器组会一起删除 ''', description=''' - 删除一个虚拟服务器组。 + 删除负载均衡,负载均衡下的监听器,转发规则组(仅alb支持),后端服务,服务器组会一起删除。 - 示例: jdc lb delete-target-group --target-group-id xxx + 示例: jdc lb delete-load-balancer --load-balancer-id xxx ''', ) - def delete_target_group(self): + def delete_load_balancer(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DeleteTargetGroupRequest import DeleteTargetGroupRequest + from jdcloud_sdk.services.lb.apis.DeleteLoadBalancerRequest import DeleteLoadBalancerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteTargetGroupRequest(params_dict, headers) + req = DeleteLoadBalancerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -941,30 +1069,31 @@ def delete_target_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), - (['--target-specs'], dict(help="""(array: targetSpec) 注册Target列表 """, dest='targetSpecs', required=True)), + (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), + (['--elastic-ip-id'], dict(help="""(string) 弹性公网IP ID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 往TargetGroup中加入Target ''', + help=''' 负载均衡绑定弹性公网IP ''', description=''' - 往TargetGroup中加入Target。 + 负载均衡绑定弹性公网IP。 - 示例: jdc lb register-targets --target-group-id xxx --target-specs ['{"":""}'] + 示例: jdc lb associate-elastic-ip --load-balancer-id xxx --elastic-ip-id xxx ''', ) - def register_targets(self): + def associate_elastic_ip(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.RegisterTargetsRequest import RegisterTargetsRequest + from jdcloud_sdk.services.lb.apis.AssociateElasticIpRequest import AssociateElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RegisterTargetsRequest(params_dict, headers) + req = AssociateElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -975,30 +1104,31 @@ def register_targets(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), - (['--target-ids'], dict(help="""(array: string) Target Id列表 """, dest='targetIds', required=False)), + (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), + (['--elastic-ip-id'], dict(help="""(string) 弹性公网IP ID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 从TargetGroup中移除一个或多个Target,失败则全部回滚。 成功移除后,所有target将不会再接收来自loadbalancer新建连接的流量 ''', + help=''' 负载均衡解绑弹性公网IP ''', description=''' - 从TargetGroup中移除一个或多个Target,失败则全部回滚。 成功移除后,所有target将不会再接收来自loadbalancer新建连接的流量。 + 负载均衡解绑弹性公网IP。 - 示例: jdc lb de-register-targets --target-group-id xxx + 示例: jdc lb disassociate-elastic-ip --load-balancer-id xxx --elastic-ip-id xxx ''', ) - def de_register_targets(self): + def disassociate_elastic_ip(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DeRegisterTargetsRequest import DeRegisterTargetsRequest + from jdcloud_sdk.services.lb.apis.DisassociateElasticIpRequest import DisassociateElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeRegisterTargetsRequest(params_dict, headers) + req = DisassociateElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1009,30 +1139,31 @@ def de_register_targets(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), - (['--target-update-specs'], dict(help="""(array: targetUpdateSpec) 修改target信息 """, dest='targetUpdateSpecs', required=True)), + (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), + (['--security-group-ids'], dict(help="""(array: string) 安全组 ID列表 """, dest='securityGroupIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改target信息 ''', + help=''' 负载均衡绑定安全组 ''', description=''' - 修改target信息。 + 负载均衡绑定安全组。 - 示例: jdc lb update-targets --target-group-id xxx --target-update-specs ['{"":""}'] + 示例: jdc lb associate-security-group --load-balancer-id xxx ''', ) - def update_targets(self): + def associate_security_group(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.UpdateTargetsRequest import UpdateTargetsRequest + from jdcloud_sdk.services.lb.apis.AssociateSecurityGroupRequest import AssociateSecurityGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateTargetsRequest(params_dict, headers) + req = AssociateSecurityGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1043,32 +1174,31 @@ def update_targets(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--target-group-id'], dict(help="""(string) TargetGroup Id """, dest='targetGroupId', required=True)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) targetIds - Target ID列表,支持多个; instanceId - Instance ID,支持单个; port - Target提供服务的端口,支持单个; """, dest='filters', required=False)), + (['--load-balancer-id'], dict(help="""(string) LB ID """, dest='loadBalancerId', required=True)), + (['--security-group-ids'], dict(help="""(array: string) 安全组 ID列表 """, dest='securityGroupIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询Target列表详情 ''', + help=''' 负载均衡解绑安全组 ''', description=''' - 查询Target列表详情。 + 负载均衡解绑安全组。 - 示例: jdc lb describe-targets --target-group-id xxx + 示例: jdc lb disassociate-security-group --load-balancer-id xxx ''', ) - def describe_targets(self): + def disassociate_security_group(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DescribeTargetsRequest import DescribeTargetsRequest + from jdcloud_sdk.services.lb.apis.DisassociateSecurityGroupRequest import DisassociateSecurityGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeTargetsRequest(params_dict, headers) + req = DisassociateSecurityGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1081,29 +1211,30 @@ def describe_targets(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) urlMapIds - 转发规则组Id列表,支持多个; urlMapNames -转发规则组名称列表,支持多个; loadBalancerId - 负载均衡器Id,支持单个; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) listenerNames - 监听器名称列表,支持多个; listenerIds - 监听器Id列表,支持多个; loadBalancerId - 负载均衡器Id,支持单个; loadBalancerType - 负载均衡类型,取值为:alb、nlb、dnlb,默认alb,支持单个; urlMapIds - 【仅alb支持】转发规则组Id列表,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询转发规则组列表详情 ''', + help=''' 查询监听器列表 ''', description=''' - 查询转发规则组列表详情。 + 查询监听器列表。 - 示例: jdc lb describe-url-maps + 示例: jdc lb describe-listeners ''', ) - def describe_url_maps(self): + def describe_listeners(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DescribeUrlMapsRequest import DescribeUrlMapsRequest + from jdcloud_sdk.services.lb.apis.DescribeListenersRequest import DescribeListenersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeUrlMapsRequest(params_dict, headers) + req = DescribeListenersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1114,31 +1245,41 @@ def describe_url_maps(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--url-map-name'], dict(help="""(string) 转发规则组名称,同一个负载均衡下,名称不能重复,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='urlMapName', required=True)), - (['--load-balancer-id'], dict(help="""(string) 转发规则组所属负载均衡的Id """, dest='loadBalancerId', required=True)), + (['--listener-name'], dict(help="""(string) Listener的名字,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='listenerName', required=True)), + (['--protocol'], dict(help="""(string) 监听协议, 取值为Tcp, Tls, Http, Https, Udp
【alb】支持Http, Https,Tcp、Tls和Udp
【nlb】支持Tcp, Udp
【dnlb】支持Tcp, Udp """, dest='protocol', required=True)), + (['--hsts-enable'], dict(help="""(bool) 【alb使用https时支持】是否开启HSTS,True(开启), False(关闭),缺省为False """, dest='hstsEnable', type=bool, required=False)), + (['--hsts-max-age'], dict(help="""(int) 【alb使用https时支持】HSTS过期时间(秒),取值范围为[1, 94608000(3年)],缺省为31536000(1年) """, dest='hstsMaxAge', type=int, required=False)), + (['--port'], dict(help="""(int) 监听端口,取值范围为[1, 65535] """, dest='port', type=int, required=True)), + (['--backend-id'], dict(help="""(string) 默认的后端服务Id """, dest='backendId', required=True)), + (['--load-balancer-id'], dict(help="""(string) Listener所属loadBalancer的Id """, dest='loadBalancerId', required=True)), + (['--url-map-id'], dict(help="""(string) 【alb Https和Http协议】转发规则组Id """, dest='urlMapId', required=False)), + (['--action'], dict(help="""(string) 默认后端服务的转发策略,取值为Forward或Redirect, 现只支持Forward, 默认为Forward """, dest='action', required=False)), + (['--certificate-specs'], dict(help="""(array: certificateSpec) 【alb Https和Tls协议】Listener绑定的默认证书,最多支持两个,两个证书的加密算法需要不同 """, dest='certificateSpecs', required=False)), + (['--connection-idle-time-seconds'], dict(help="""(int) 【alb、nlb】空闲连接超时时间, 范围为[1,86400]。
(Tcp和Tls协议)默认为:1800s
(Udp协议)默认为:300s
(Http和Https协议)默认为:60s
【dnlb】不支持 """, dest='connectionIdleTimeSeconds', type=int, required=False)), (['--description'], dict(help="""(string) 描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建转发规则组,仅alb支持 ''', + help=''' 创建一个监听器 ''', description=''' - 创建转发规则组,仅alb支持。 + 创建一个监听器。 - 示例: jdc lb create-url-map --url-map-name xxx --load-balancer-id xxx + 示例: jdc lb create-listener --listener-name xxx --protocol xxx --port 5 --backend-id xxx --load-balancer-id xxx ''', ) - def create_url_map(self): + def create_listener(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.CreateUrlMapRequest import CreateUrlMapRequest + from jdcloud_sdk.services.lb.apis.CreateListenerRequest import CreateListenerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateUrlMapRequest(params_dict, headers) + req = CreateListenerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1149,29 +1290,30 @@ def create_url_map(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--url-map-id'], dict(help="""(string) 转发规则组Id """, dest='urlMapId', required=True)), + (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询转发规则组详情 ''', + help=''' 查询监听器详情 ''', description=''' - 查询转发规则组详情。 + 查询监听器详情。 - 示例: jdc lb describe-url-map --url-map-id xxx + 示例: jdc lb describe-listener --listener-id xxx ''', ) - def describe_url_map(self): + def describe_listener(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DescribeUrlMapRequest import DescribeUrlMapRequest + from jdcloud_sdk.services.lb.apis.DescribeListenerRequest import DescribeListenerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeUrlMapRequest(params_dict, headers) + req = DescribeListenerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1182,31 +1324,39 @@ def describe_url_map(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--url-map-id'], dict(help="""(string) 转发规则组Id """, dest='urlMapId', required=True)), - (['--description'], dict(help="""(string) 转发规则组描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), - (['--url-map-name'], dict(help="""(string) 转发规则组名称,同一个负载均衡下,名称不能重复,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='urlMapName', required=False)), + (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--listener-name'], dict(help="""(string) 监听器名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='listenerName', required=False)), + (['--status'], dict(help="""(string) Listener状态, 取值为On或者为Off """, dest='status', required=False)), + (['--hsts-enable'], dict(help="""(bool) 【alb使用https时支持】是否开启HSTS,True(开启), False(关闭),缺省为不改变原值 """, dest='hstsEnable', type=bool, required=False)), + (['--hsts-max-age'], dict(help="""(int) 【alb使用https时支持】HSTS过期时间(秒),取值范围为[1, 94608000(3年)],缺省为不改变原值 """, dest='hstsMaxAge', type=int, required=False)), + (['--certificate-specs'], dict(help="""(array: certificateSpec) 【alb Https和Tls协议】Listener绑定的默认证书,最多支持两个,两个证书的加密算法需要不同 """, dest='certificateSpecs', required=False)), + (['--connection-idle-time-seconds'], dict(help="""(int) 【alb、nlb】空闲连接超时时间, 范围为[1,86400]。
(Tcp和Tls协议)默认为:1800s
(Http和Https协议)默认为:60s
【dnlb】不支持该功能 """, dest='connectionIdleTimeSeconds', type=int, required=False)), + (['--backend-id'], dict(help="""(string) 默认后端服务Id """, dest='backendId', required=False)), + (['--url-map-id'], dict(help="""(string) 【alb Https和Http协议】转发规则组Id """, dest='urlMapId', required=False)), + (['--description'], dict(help="""(string) 监听器描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改转发规则组 ''', + help=''' 修改一个监听器的信息 ''', description=''' - 修改转发规则组。 + 修改一个监听器的信息。 - 示例: jdc lb update-url-map --url-map-id xxx + 示例: jdc lb update-listener --listener-id xxx ''', ) - def update_url_map(self): + def update_listener(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.UpdateUrlMapRequest import UpdateUrlMapRequest + from jdcloud_sdk.services.lb.apis.UpdateListenerRequest import UpdateListenerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateUrlMapRequest(params_dict, headers) + req = UpdateListenerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1217,29 +1367,30 @@ def update_url_map(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--url-map-id'], dict(help="""(string) 转发规则组Id """, dest='urlMapId', required=True)), + (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除转发规则组 ''', + help=''' 删除一个监听器 ''', description=''' - 删除转发规则组。 + 删除一个监听器。 - 示例: jdc lb delete-url-map --url-map-id xxx + 示例: jdc lb delete-listener --listener-id xxx ''', ) - def delete_url_map(self): + def delete_listener(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DeleteUrlMapRequest import DeleteUrlMapRequest + from jdcloud_sdk.services.lb.apis.DeleteListenerRequest import DeleteListenerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteUrlMapRequest(params_dict, headers) + req = DeleteListenerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1250,30 +1401,31 @@ def delete_url_map(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--url-map-id'], dict(help="""(string) 转发规则组Id """, dest='urlMapId', required=True)), - (['--rule-specs'], dict(help="""(array: ruleSpec) 转发规则的信息 """, dest='ruleSpecs', required=True)), + (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--certificates'], dict(help="""(array: extCertificateSpec) 【alb Https和Tls协议】ssl server证书列表 """, dest='certificates', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 往转发规则组加入转发规则 ''', + help=''' listener批量添加扩展证书 ''', description=''' - 往转发规则组加入转发规则。 + listener批量添加扩展证书。 - 示例: jdc lb add-rules --url-map-id xxx --rule-specs ['{"":""}'] + 示例: jdc lb add-listener-certificates --listener-id xxx --certificates ['{"":""}'] ''', ) - def add_rules(self): + def add_listener_certificates(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.AddRulesRequest import AddRulesRequest + from jdcloud_sdk.services.lb.apis.AddListenerCertificatesRequest import AddListenerCertificatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddRulesRequest(params_dict, headers) + req = AddListenerCertificatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1284,30 +1436,31 @@ def add_rules(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--url-map-id'], dict(help="""(string) 转发规则组Id """, dest='urlMapId', required=True)), - (['--rule-update-specs'], dict(help="""(array: ruleUpdateSpec) 更新转发规则rules信息 """, dest='ruleUpdateSpecs', required=True)), + (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--certificates'], dict(help="""(array: extCertificateUpdateSpec) 【alb Https和Tls协议】Listener绑定的扩展证书列表 """, dest='certificates', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改转发规则 ''', + help=''' listener批量修改扩展证书 ''', description=''' - 修改转发规则。 + listener批量修改扩展证书。 - 示例: jdc lb update-rules --url-map-id xxx --rule-update-specs ['{"":""}'] + 示例: jdc lb update-listener-certificates --listener-id xxx --certificates ['{"":""}'] ''', ) - def update_rules(self): + def update_listener_certificates(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.UpdateRulesRequest import UpdateRulesRequest + from jdcloud_sdk.services.lb.apis.UpdateListenerCertificatesRequest import UpdateListenerCertificatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateRulesRequest(params_dict, headers) + req = UpdateListenerCertificatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1318,30 +1471,31 @@ def update_rules(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--url-map-id'], dict(help="""(string) 转发规则组Id """, dest='urlMapId', required=True)), - (['--rule-ids'], dict(help="""(array: string) rule Id列表 """, dest='ruleIds', required=False)), + (['--listener-id'], dict(help="""(string) 监听器ID """, dest='listenerId', required=True)), + (['--certificate-bind-ids'], dict(help="""(array: string) 【alb Https和Tls协议】扩展证书绑定Id """, dest='certificateBindIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除转发规则 ''', + help=''' listener批量删除扩展证书 ''', description=''' - 删除转发规则。 + listener批量删除扩展证书。 - 示例: jdc lb delete-rules --url-map-id xxx + 示例: jdc lb delete-listener-certificates --listener-id xxx ''', ) - def delete_rules(self): + def delete_listener_certificates(self): client_factory = ClientFactory('lb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.lb.apis.DeleteRulesRequest import DeleteRulesRequest + from jdcloud_sdk.services.lb.apis.DeleteListenerCertificatesRequest import DeleteListenerCertificatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteRulesRequest(params_dict, headers) + req = DeleteListenerCertificatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1351,7 +1505,7 @@ def delete_rules(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-backends','create-backend','describe-backend','update-backend','delete-backend','describe-target-health','describe-listeners','create-listener','describe-listener','update-listener','delete-listener','describe-load-balancers','create-load-balancer','describe-load-balancer','update-load-balancer','delete-load-balancer','associate-elastic-ip','disassociate-elastic-ip','associate-security-group','disassociate-security-group','describe-target-groups','create-target-group','describe-target-group','update-target-group','delete-target-group','register-targets','de-register-targets','update-targets','describe-targets','describe-url-maps','create-url-map','describe-url-map','update-url-map','delete-url-map','add-rules','update-rules','delete-rules',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-url-maps','create-url-map','describe-url-map','update-url-map','delete-url-map','add-rules','update-rules','delete-rules','describe-target-groups','create-target-group','describe-target-group','update-target-group','delete-target-group','register-targets','de-register-targets','update-targets','describe-targets','describe-backends','create-backend','describe-backend','update-backend','delete-backend','describe-target-health','describe-load-balancers','create-load-balancer','describe-load-balancer','update-load-balancer','delete-load-balancer','associate-elastic-ip','disassociate-elastic-ip','associate-security-group','disassociate-security-group','describe-listeners','create-listener','describe-listener','update-listener','delete-listener','add-listener-certificates','update-listener-certificates','delete-listener-certificates',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/live.py b/jdcloud_cli/controllers/services/live.py index 9ddba3b..ef21531 100644 --- a/jdcloud_cli/controllers/services/live.py +++ b/jdcloud_cli/controllers/services/live.py @@ -38,31 +38,34 @@ class Meta: @expose( arguments=[ - (['--page-num'], dict(help="""(int) 页码; - 取值范围: [1, 100000]; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围: [10, 100]; """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 域名下的app列表过滤条件:; - name: publishDomain 直播的推流域名; - values: 如果参数为空,则查询全部; - 过滤条件为空,则表示查询用户下的所有应用名; """, dest='filters', required=False)), + (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,查询时间跨度不超过1天; """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询域名下的APP列表 ''', + help=''' 查询推流监控数据 ''', description=''' - 查询域名下的APP列表。 + 查询推流监控数据。 - 示例: jdc live describe-live-app + 示例: jdc live describe-publish-stream-info-data --domain-name xxx --app-name xxx --stream-name xxx --start-time xxx ''', ) - def describe_live_app(self): + def describe_publish_stream_info_data(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveAppRequest import DescribeLiveAppRequest + from jdcloud_sdk.services.live.apis.DescribePublishStreamInfoDataRequest import DescribePublishStreamInfoDataRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveAppRequest(params_dict, headers) + req = DescribePublishStreamInfoDataRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -72,30 +75,38 @@ def describe_live_app(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 直播的推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称; - 取值: 数字字母中划线("-")下划线("_") 50个字符以内; """, dest='appName', required=True)), + (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=False)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), + (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), + (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), + (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间; """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加直播应用名; - 需要提前在应用(app)级别绑定功能模板时才需要提前新建应用名; - 新的应用名可以推流时自动创建; ''', + help=''' 查询直播流历史在线人数 ''', description=''' - 添加直播应用名; - 需要提前在应用(app)级别绑定功能模板时才需要提前新建应用名; - 新的应用名可以推流时自动创建; 。 + 查询直播流历史在线人数。 - 示例: jdc live add-live-app --publish-domain xxx --app-name xxx + 示例: jdc live describe-live-stream-history-user-num --start-time xxx ''', ) - def add_live_app(self): + def describe_live_stream_history_user_num(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveAppRequest import AddLiveAppRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamHistoryUserNumRequest import DescribeLiveStreamHistoryUserNumRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveAppRequest(params_dict, headers) + req = DescribeLiveStreamHistoryUserNumRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -105,30 +116,37 @@ def add_live_app(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 直播的推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=False)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), + (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), + (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), + (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间; """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 停用 运行中 状态的应用; - 停用应用之后,不能再用此应用名推流; ''', + help=''' 查询直播推流数 ''', description=''' - 停用 运行中 状态的应用; - 停用应用之后,不能再用此应用名推流; 。 + 查询直播推流数。 - 示例: jdc live stop-live-app --publish-domain xxx --app-name xxx + 示例: jdc live describe-live-publish-stream-num --start-time xxx ''', ) - def stop_live_app(self): + def describe_live_publish_stream_num(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.StopLiveAppRequest import StopLiveAppRequest + from jdcloud_sdk.services.live.apis.DescribeLivePublishStreamNumRequest import DescribeLivePublishStreamNumRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopLiveAppRequest(params_dict, headers) + req = DescribeLivePublishStreamNumRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -138,29 +156,34 @@ def stop_live_app(self): @expose( arguments=[ - (['--play-domain'], dict(help="""(string) (直播or时移)播放域名; - 仅支持精确匹配; """, dest='playDomain', required=True)), + (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--protocol-type'], dict(help="""(string) 协议,取值范围:"hdl,hls"; """, dest='protocolType', required=True)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,时间跨度不不超过⼀一天; """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询(直播or时移)播放鉴权KEY ''', + help=''' 查询直播流播放人数排行 ''', description=''' - 查询(直播or时移)播放鉴权KEY。 + 查询直播流播放人数排行。 - 示例: jdc live describe-live-play-auth-key --play-domain xxx + 示例: jdc live describe-live-stream-player-ranking-data --domain-name xxx --app-name xxx --protocol-type xxx --start-time xxx ''', ) - def describe_live_play_auth_key(self): + def describe_live_stream_player_ranking_data(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLivePlayAuthKeyRequest import DescribeLivePlayAuthKeyRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamPlayerRankingDataRequest import DescribeLiveStreamPlayerRankingDataRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLivePlayAuthKeyRequest(params_dict, headers) + req = DescribeLiveStreamPlayerRankingDataRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -170,31 +193,32 @@ def describe_live_play_auth_key(self): @expose( arguments=[ - (['--play-domain'], dict(help="""(string) (直播or时移)播放域名 """, dest='playDomain', required=True)), - (['--auth-status'], dict(help="""(string) (直播or时移)播放鉴权状态; on: 开启; off: 关闭; - 当播放鉴权状态on(开启)时,authKey不能为空; """, dest='authStatus', required=False)), - (['--auth-key'], dict(help="""(string) (直播or时移)播放鉴权key; - 取值: 支持大小写字母和数字 长度6-32位; """, dest='authKey', required=False)), + (['--domain-name'], dict(help="""(string) 推流域名; """, dest='domainName', required=True)), + (['--app-name'], dict(help="""(string) 应用名称; """, dest='appName', required=True)), + (['--stream-name'], dict(help="""(string) 流名称; """, dest='streamName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置(直播or时移)播放鉴权KEY ''', + help=''' 查询转码流信息 ''', description=''' - 设置(直播or时移)播放鉴权KEY。 + 查询转码流信息。 - 示例: jdc live set-live-play-auth-key --play-domain xxx + 示例: jdc live describe-live-transcode-stream-list --domain-name xxx --app-name xxx --stream-name xxx ''', ) - def set_live_play_auth_key(self): + def describe_live_transcode_stream_list(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.SetLivePlayAuthKeyRequest import SetLivePlayAuthKeyRequest + from jdcloud_sdk.services.live.apis.DescribeLiveTranscodeStreamListRequest import DescribeLiveTranscodeStreamListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLivePlayAuthKeyRequest(params_dict, headers) + req = DescribeLiveTranscodeStreamListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -204,29 +228,30 @@ def set_live_play_auth_key(self): @expose( arguments=[ - (['--restart-domain'], dict(help="""(string) 直播回看播放域名; - 仅支持精确匹配; """, dest='restartDomain', required=True)), + (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播回看播放鉴权KEY ''', + help=''' 查询转码流数量 ''', description=''' - 查询直播回看播放鉴权KEY。 + 查询转码流数量。 - 示例: jdc live describe-live-restart-auth-key --restart-domain xxx + 示例: jdc live describe-live-transcode-stream-num ''', ) - def describe_live_restart_auth_key(self): + def describe_live_transcode_stream_num(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveRestartAuthKeyRequest import DescribeLiveRestartAuthKeyRequest + from jdcloud_sdk.services.live.apis.DescribeLiveTranscodeStreamNumRequest import DescribeLiveTranscodeStreamNumRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveRestartAuthKeyRequest(params_dict, headers) + req = DescribeLiveTranscodeStreamNumRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -236,31 +261,37 @@ def describe_live_restart_auth_key(self): @expose( arguments=[ - (['--restart-domain'], dict(help="""(string) 直播回看播放域名 """, dest='restartDomain', required=True)), - (['--auth-status'], dict(help="""(string) 直播回看播放鉴权状态; on: 开启; off: 关闭; - 当回看播放鉴权状态on(开启)时,authKey不能为空; """, dest='authStatus', required=False)), - (['--auth-key'], dict(help="""(string) 直播回看播放鉴权key; - 取值: 支持大小写字母和数字 长度6-32位; """, dest='authKey', required=False)), + (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), + (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), + (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置直播回看播放鉴权KEY ''', + help=''' 查询转码流观看人数 ''', description=''' - 设置直播回看播放鉴权KEY。 + 查询转码流观看人数。 - 示例: jdc live set-live-restart-auth-key --restart-domain xxx + 示例: jdc live describe-live-transcode-stream-player-user-num --domain-name xxx --app-name xxx --start-time xxx ''', ) - def set_live_restart_auth_key(self): + def describe_live_transcode_stream_player_user_num(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.SetLiveRestartAuthKeyRequest import SetLiveRestartAuthKeyRequest + from jdcloud_sdk.services.live.apis.DescribeLiveTranscodeStreamPlayerUserNumRequest import DescribeLiveTranscodeStreamPlayerUserNumRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLiveRestartAuthKeyRequest(params_dict, headers) + req = DescribeLiveTranscodeStreamPlayerUserNumRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -270,29 +301,37 @@ def set_live_restart_auth_key(self): @expose( arguments=[ - (['--filters'], dict(help="""(array: filter) 传参字段描述:; startTime(必填) : 2019-08-21T16:15:10Z; endTime(必填) : 2019-08-21T18:10:10Z; billType(非必填) :; enum:; - 1 (online); - 2 (offline); userPin(非必填) : mt_test; """, dest='filters', required=False)), + (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), + (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), + (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播计费账单用量数据; 允许通过条件过滤查询,支持的过滤字段如下:; - startTime[eq] 账单开始时间; - endTime[eq] 账单结束时间; - billType[eq] 账单计费类型; - userPin[like] 用户PIN; ''', + help=''' 查询转码流播放带宽; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; ''', description=''' - 查询直播计费账单用量数据; 允许通过条件过滤查询,支持的过滤字段如下:; - startTime[eq] 账单开始时间; - endTime[eq] 账单结束时间; - billType[eq] 账单计费类型; - userPin[like] 用户PIN; 。 + 查询转码流播放带宽; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; 。 - 示例: jdc live describe-live-bill-data + 示例: jdc live describe-live-transcode-stream-bandwidth --domain-name xxx --app-name xxx --start-time xxx ''', ) - def describe_live_bill_data(self): + def describe_live_transcode_stream_bandwidth(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveBillDataRequest import DescribeLiveBillDataRequest + from jdcloud_sdk.services.live.apis.DescribeLiveTranscodeStreamBandwidthRequest import DescribeLiveTranscodeStreamBandwidthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveBillDataRequest(params_dict, headers) + req = DescribeLiveTranscodeStreamBandwidthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -302,29 +341,36 @@ def describe_live_bill_data(self): @expose( arguments=[ - (['--play-domain'], dict(help="""(string) (直播or时移)播放域名; - 仅支持精确匹配; """, dest='playDomain', required=True)), + (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), + (['--page-num'], dict(help="""(int) 页码,起始页码1; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页最大记录数,取值:[10,100],默认:10; """, dest='pageSize', type=int, required=False)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,查询时间跨度不超过30天; """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播播放证书 ''', + help=''' 查询在线流列表 ''', description=''' - 查询直播播放证书。 + 查询在线流列表。 - 示例: jdc live describe-live-domain-certificate --play-domain xxx + 示例: jdc live describe-domain-online-stream --domain-name xxx --start-time xxx ''', ) - def describe_live_domain_certificate(self): + def describe_domain_online_stream(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveDomainCertificateRequest import DescribeLiveDomainCertificateRequest + from jdcloud_sdk.services.live.apis.DescribeDomainOnlineStreamRequest import DescribeDomainOnlineStreamRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveDomainCertificateRequest(params_dict, headers) + req = DescribeDomainOnlineStreamRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -334,33 +380,33 @@ def describe_live_domain_certificate(self): @expose( arguments=[ - (['--play-domain'], dict(help="""(string) (直播or时移)播放域名 """, dest='playDomain', required=True)), - (['--cert-status'], dict(help="""(string) (直播or时移)播放证书状态; on: 开启; off: 关闭; - 当播放证书状态on(开启)时,cert和key不能为空; """, dest='certStatus', required=True)), - (['--cert'], dict(help="""(string) (直播or时移)播放证书; - 取值: 最大支持4098; - 当播放证书状态on(开启)时,cert不能为空; """, dest='cert', required=False)), - (['--key'], dict(help="""(string) (直播or时移)播放证书key; - 取值: 最大支持2048; - 当播放证书状态on(开启)时,key不能为空; """, dest='key', required=False)), - (['--title'], dict(help="""(string) (直播or时移)播放证书别名; - 取值: 支持大小写字母和数字 长度最大256; """, dest='title', required=False)), + (['--domains'], dict(help="""(string) 播放域名,多个时以逗号(,)分隔 """, dest='domains', required=True)), + (['--interval'], dict(help="""(string) 时间间隔,取值(hour,day),不传默认小时; - 按小时(hour)下载时是.log文件; - 按天(day)下载时是.zip文件; """, dest='interval', required=False)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间; """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置(直播or时移)播放证书; -- 设置成功之后30分钟以内生效; ''', + help=''' 日志下载 ''', description=''' - 设置(直播or时移)播放证书; -- 设置成功之后30分钟以内生效; 。 + 日志下载。 - 示例: jdc live set-live-domain-certificate --play-domain xxx --cert-status xxx + 示例: jdc live describe-domains-log --domains xxx --start-time xxx ''', ) - def set_live_domain_certificate(self): + def describe_domains_log(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.SetLiveDomainCertificateRequest import SetLiveDomainCertificateRequest + from jdcloud_sdk.services.live.apis.DescribeDomainsLogRequest import DescribeDomainsLogRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLiveDomainCertificateRequest(params_dict, headers) + req = DescribeDomainsLogRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -370,29 +416,34 @@ def set_live_domain_certificate(self): @expose( arguments=[ - (['--restart-domain'], dict(help="""(string) 直播回看域名; - 仅支持精确匹配; """, dest='restartDomain', required=True)), + (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=True)), + (['--size'], dict(help="""(int) 查询Top数量,默认20,即返回Top20的数据 """, dest='size', type=int, required=False)), + (['--rankfield'], dict(help="""(string) 排行依据字段,取值:["pv", "flow", "bandwidth"],默认pv; - pv 播放次数; - flow 流量; - bandwidth 带宽; """, dest='rankfield', required=False)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间; """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播回看播放证书 ''', + help=''' 查询URL播放排行 ''', description=''' - 查询直播回看播放证书。 + 查询URL播放排行。 - 示例: jdc live describe-live-restart-domain-certificate --restart-domain xxx + 示例: jdc live describe-url-ranking --domain-name xxx --start-time xxx ''', ) - def describe_live_restart_domain_certificate(self): + def describe_url_ranking(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveRestartDomainCertificateRequest import DescribeLiveRestartDomainCertificateRequest + from jdcloud_sdk.services.live.apis.DescribeUrlRankingRequest import DescribeUrlRankingRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveRestartDomainCertificateRequest(params_dict, headers) + req = DescribeUrlRankingRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -402,33 +453,36 @@ def describe_live_restart_domain_certificate(self): @expose( arguments=[ - (['--restart-domain'], dict(help="""(string) 直播回看域名 """, dest='restartDomain', required=True)), - (['--cert-status'], dict(help="""(string) 直播回看证书状态; on: 开启; off: 关闭; - 当播放证书状态on(开启)时,cert和key不能为空; """, dest='certStatus', required=True)), - (['--cert'], dict(help="""(string) 直播回看证书; - 取值: 最大支持4098; - 当播放证书状态on(开启)时,cert不能为空; """, dest='cert', required=False)), - (['--key'], dict(help="""(string) 直播回看证书key; - 取值: 最大支持2048; - 当播放证书状态on(开启)时,key不能为空; """, dest='key', required=False)), - (['--title'], dict(help="""(string) 直播回看证书别名; - 取值: 支持大小写字母和数字 长度最大256; """, dest='title', required=False)), + (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间; """, dest='endTime', required=False)), + (['--page-number'], dict(help="""(int) 页码,起始页码1; """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页最大记录数,取值:[10,1000],默认:100; """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置直播回看证书; -- 设置成功之后30分钟以内生效; ''', + help=''' 查询推流码率、帧率 ''', description=''' - 设置直播回看证书; -- 设置成功之后30分钟以内生效; 。 + 查询推流码率、帧率。 - 示例: jdc live set-live-restart-domain-certificate --restart-domain xxx --cert-status xxx + 示例: jdc live describe-live-stream-publish-info-by-page --domain-name xxx --start-time xxx ''', ) - def set_live_restart_domain_certificate(self): + def describe_live_stream_publish_info_by_page(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.SetLiveRestartDomainCertificateRequest import SetLiveRestartDomainCertificateRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamPublishInfoByPageRequest import DescribeLiveStreamPublishInfoByPageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLiveRestartDomainCertificateRequest(params_dict, headers) + req = DescribeLiveStreamPublishInfoByPageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -438,31 +492,36 @@ def set_live_restart_domain_certificate(self): @expose( arguments=[ - (['--page-num'], dict(help="""(int) 页码; - 取值范围[1, 100000]; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), - (['--publish-domain'], dict(help="""(string) 推流域名; - 目前仅支持精确查询; - 为空时,查询用户所有直播域名; """, dest='publishDomain', required=False)), + (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间; """, dest='endTime', required=False)), + (['--page-number'], dict(help="""(int) 页码,起始页码1; """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页最大记录数,取值:[10,1000],默认:100; """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询域名列表 ''', + help=''' 查询观看人数 ''', description=''' - 查询域名列表。 + 查询观看人数。 - 示例: jdc live describe-live-domains + 示例: jdc live describe-live-stream-play-info-by-page --domain-name xxx --start-time xxx ''', ) - def describe_live_domains(self): + def describe_live_stream_play_info_by_page(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveDomainsRequest import DescribeLiveDomainsRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamPlayInfoByPageRequest import DescribeLiveStreamPlayInfoByPageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveDomainsRequest(params_dict, headers) + req = DescribeLiveStreamPlayInfoByPageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -472,30 +531,30 @@ def describe_live_domains(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 直播的推流域名; - 不支持泛域名; """, dest='publishDomain', required=True)), - (['--play-domain'], dict(help="""(string) 直播的播放域名; - 不支持泛域名; """, dest='playDomain', required=True)), + (['--play-domain'], dict(help="""(string) (直播or时移)播放域名; - 仅支持精确匹配; """, dest='playDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加直播域名; - 创建直播域名之前,必须先开通直播服务; - 直播域名必须已经备案完成; ''', + help=''' 查询直播播放证书 ''', description=''' - 添加直播域名; - 创建直播域名之前,必须先开通直播服务; - 直播域名必须已经备案完成; 。 + 查询直播播放证书。 - 示例: jdc live add-live-domain --publish-domain xxx --play-domain xxx + 示例: jdc live describe-live-domain-certificate --play-domain xxx ''', ) - def add_live_domain(self): + def describe_live_domain_certificate(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveDomainRequest import AddLiveDomainRequest + from jdcloud_sdk.services.live.apis.DescribeLiveDomainCertificateRequest import DescribeLiveDomainCertificateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveDomainRequest(params_dict, headers) + req = DescribeLiveDomainCertificateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -505,29 +564,34 @@ def add_live_domain(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名; - 需要启动的域名对(推流域名,播放域名)中的推流域名; """, dest='publishDomain', required=True)), + (['--play-domain'], dict(help="""(string) (直播or时移)播放域名 """, dest='playDomain', required=True)), + (['--cert-status'], dict(help="""(string) (直播or时移)播放证书状态; on: 开启; off: 关闭; - 当播放证书状态on(开启)时,cert和key不能为空; """, dest='certStatus', required=True)), + (['--cert'], dict(help="""(string) (直播or时移)播放证书; - 取值: 最大支持4098; - 当播放证书状态on(开启)时,cert不能为空; """, dest='cert', required=False)), + (['--key'], dict(help="""(string) (直播or时移)播放证书key; - 取值: 最大支持2048; - 当播放证书状态on(开启)时,key不能为空; """, dest='key', required=False)), + (['--title'], dict(help="""(string) (直播or时移)播放证书别名; - 取值: 支持大小写字母和数字 长度最大256; """, dest='title', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启动域名; - 启用状态为 停用 的直播域名对(推流域名,播放域名)将DomainStatus变更为online; ''', + help=''' 设置(直播or时移)播放证书; -- 设置成功之后30分钟以内生效; ''', description=''' - 启动域名; - 启用状态为 停用 的直播域名对(推流域名,播放域名)将DomainStatus变更为online; 。 + 设置(直播or时移)播放证书; -- 设置成功之后30分钟以内生效; 。 - 示例: jdc live start-live-domain --publish-domain xxx + 示例: jdc live set-live-domain-certificate --play-domain xxx --cert-status xxx ''', ) - def start_live_domain(self): + def set_live_domain_certificate(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.StartLiveDomainRequest import StartLiveDomainRequest + from jdcloud_sdk.services.live.apis.SetLiveDomainCertificateRequest import SetLiveDomainCertificateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartLiveDomainRequest(params_dict, headers) + req = SetLiveDomainCertificateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -537,29 +601,30 @@ def start_live_domain(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名; - 需要停用的域名对(推流域名,播放域名)中的推流域名; """, dest='publishDomain', required=True)), + (['--restart-domain'], dict(help="""(string) 直播回看域名; - 仅支持精确匹配; """, dest='restartDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 停用域名; - 停用直播域名对(推流域名,播放域名),将DomainStatus变更为offline; - 停用该直播域名对后,直播域名信息仍保留,但用户将不能再用该推流域名推流或播放域名播放; ''', + help=''' 查询直播回看播放证书 ''', description=''' - 停用域名; - 停用直播域名对(推流域名,播放域名),将DomainStatus变更为offline; - 停用该直播域名对后,直播域名信息仍保留,但用户将不能再用该推流域名推流或播放域名播放; 。 + 查询直播回看播放证书。 - 示例: jdc live stop-live-domain --publish-domain xxx + 示例: jdc live describe-live-restart-domain-certificate --restart-domain xxx ''', ) - def stop_live_domain(self): + def describe_live_restart_domain_certificate(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.StopLiveDomainRequest import StopLiveDomainRequest + from jdcloud_sdk.services.live.apis.DescribeLiveRestartDomainCertificateRequest import DescribeLiveRestartDomainCertificateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopLiveDomainRequest(params_dict, headers) + req = DescribeLiveRestartDomainCertificateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -569,29 +634,34 @@ def stop_live_domain(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名; - 需要停用的域名对(推流域名,播放域名)中的推流域名; """, dest='publishDomain', required=True)), + (['--restart-domain'], dict(help="""(string) 直播回看域名 """, dest='restartDomain', required=True)), + (['--cert-status'], dict(help="""(string) 直播回看证书状态; on: 开启; off: 关闭; - 当播放证书状态on(开启)时,cert和key不能为空; """, dest='certStatus', required=True)), + (['--cert'], dict(help="""(string) 直播回看证书; - 取值: 最大支持4098; - 当播放证书状态on(开启)时,cert不能为空; """, dest='cert', required=False)), + (['--key'], dict(help="""(string) 直播回看证书key; - 取值: 最大支持2048; - 当播放证书状态on(开启)时,key不能为空; """, dest='key', required=False)), + (['--title'], dict(help="""(string) 直播回看证书别名; - 取值: 支持大小写字母和数字 长度最大256; """, dest='title', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询指定域名相关信息 ''', + help=''' 设置直播回看证书; -- 设置成功之后30分钟以内生效; ''', description=''' - 查询指定域名相关信息。 + 设置直播回看证书; -- 设置成功之后30分钟以内生效; 。 - 示例: jdc live describe-live-domain-detail --publish-domain xxx + 示例: jdc live set-live-restart-domain-certificate --restart-domain xxx --cert-status xxx ''', ) - def describe_live_domain_detail(self): + def set_live_restart_domain_certificate(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveDomainDetailRequest import DescribeLiveDomainDetailRequest + from jdcloud_sdk.services.live.apis.SetLiveRestartDomainCertificateRequest import SetLiveRestartDomainCertificateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveDomainDetailRequest(params_dict, headers) + req = SetLiveRestartDomainCertificateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -601,29 +671,31 @@ def describe_live_domain_detail(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名; """, dest='publishDomain', required=True)), + (['--publish-domain'], dict(help="""(string) 直播的推流域名 """, dest='publishDomain', required=True)), + (['--template'], dict(help="""(string) 转码模版; - 取值范围: 系统标准转码模板, 用户自定义转码模板; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/25f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/25f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除直播域名; - 请慎重操作(建议在进行域名删除前到域名解析服务商处恢复域名A记录),以免导致删除操作后此域名不可访问。; deleteLiveDomain调用成功后将删除本条直播域名的全部相关记录,对于仅需要暂停使用该直播域名,推荐stopLiveDomain接口; ''', + help=''' 添加域名级别转码配置; - 添加域名级别的转码模板配置; ''', description=''' - 删除直播域名; - 请慎重操作(建议在进行域名删除前到域名解析服务商处恢复域名A记录),以免导致删除操作后此域名不可访问。; deleteLiveDomain调用成功后将删除本条直播域名的全部相关记录,对于仅需要暂停使用该直播域名,推荐stopLiveDomain接口; 。 + 添加域名级别转码配置; - 添加域名级别的转码模板配置; 。 - 示例: jdc live delete-live-domain --publish-domain xxx + 示例: jdc live add-live-stream-domain-transcode --publish-domain xxx --template xxx ''', ) - def delete_live_domain(self): + def add_live_stream_domain_transcode(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveDomainRequest import DeleteLiveDomainRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamDomainTranscodeRequest import AddLiveStreamDomainTranscodeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveDomainRequest(params_dict, headers) + req = AddLiveStreamDomainTranscodeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -633,30 +705,32 @@ def delete_live_domain(self): @expose( arguments=[ - (['--play-domain'], dict(help="""(string) 直播的播放域名; - 回看域名所对应的原播放域名,新建的回看域名将绑定到此播放域名下; """, dest='playDomain', required=True)), - (['--restart-domain'], dict(help="""(string) 直播回看域名; - 直播域名必须已经备案完成; """, dest='restartDomain', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--template'], dict(help="""(string) 转码模版; - 取值范围: 系统标准转码模板, 用户自定义转码模板; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/25f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/25f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加回看域名; ''', + help=''' 添加应用转码配置; - 添加应用级别的转码模板配置; ''', description=''' - 添加回看域名; 。 + 添加应用转码配置; - 添加应用级别的转码模板配置; 。 - 示例: jdc live add-live-restart-domain --play-domain xxx --restart-domain xxx + 示例: jdc live add-live-stream-app-transcode --publish-domain xxx --app-name xxx --template xxx ''', ) - def add_live_restart_domain(self): + def add_live_stream_app_transcode(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveRestartDomainRequest import AddLiveRestartDomainRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamAppTranscodeRequest import AddLiveStreamAppTranscodeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveRestartDomainRequest(params_dict, headers) + req = AddLiveStreamAppTranscodeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -666,30 +740,43 @@ def add_live_restart_domain(self): @expose( arguments=[ - (['--template'], dict(help="""(string) 模板名称。长度不超过128个字符。UTF-8编码; """, dest='template', required=True)), - (['--modules'], dict(help="""(array: string) 检测项列表。取值范围:; BlackScreen - 黑屏; PureColor - 纯色; ColorCast - 偏色; FrozenFrame - 静帧; Brightness - 亮度; Contrast - 对比度; """, dest='modules', required=False)), + (['--template-name'], dict(help="""(string) 转码模板名称; - 长度范围:[1,50]; """, dest='templateName', required=False)), + (['--video-codec'], dict(help="""(string) 视频编码格式,取值:h264,h265,默认h264; - h264时,分辨率小于等于1080p; - h265时,分辨率小于等于4k; """, dest='videoCodec', required=False)), + (['--video-code-rate'], dict(help="""(int) 转码输出的码率值; - 取值范围: [128,15000]; - 单位: kpbs; """, dest='videoCodeRate', type=int, required=True)), + (['--video-frame-rate'], dict(help="""(string) 转码输出的帧率值; - 取值:[1,30]; """, dest='videoFrameRate', required=True)), + (['--width'], dict(help="""(int) 转码输出视频宽度; - 取值: [128,4096]; - 如果(width,height)只设置其中之一,则按所设置参数项等比缩放另一项输出转码; - 如果(width,height)都不设置,则按源流大小输出转码; """, dest='width', type=int, required=False)), + (['--height'], dict(help="""(int) 转码输出视频高度; - 取值: [128,4096]; - 如果(width,height)只设置其中之一,则按所设置参数项等比缩放另一项输出转码; - 如果(width,height)都不设置,则按源流大小输出转码; """, dest='height', type=int, required=False)), + (['--template'], dict(help="""(string) 转码模板(转码流输出后缀); - 取值要求:数字、大小写字母或短横线("-"),必须以数字或字母作为开头和结尾,长度不超过50字符; - 注意: 不能与系统的标准的转码模板和当前用户已自定义命名重复; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/25f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/25f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); """, dest='template', required=True)), + (['--audio-codec'], dict(help="""(string) 转码输出音频编码格式; - 取值: aac、mp3; - 不区分大小写; """, dest='audioCodec', required=True)), + (['--audio-format'], dict(help="""(string) 转码输出音频格式; - 取值: aac_lc,aac_low,aac_he,aac_he_v2; 默认:aac_he; - 不区分大小写; """, dest='audioFormat', required=False)), + (['--audio-sample-rate'], dict(help="""(int) 转码输出音频采样率; - 取值: [44100,48000]; """, dest='audioSampleRate', type=int, required=True)), + (['--audio-channel'], dict(help="""(int) 转码输出音频通道数; 1: 单声道; 2: 双声道; """, dest='audioChannel', type=int, required=True)), + (['--audio-code-rate'], dict(help="""(int) 转码输出音频码率; - 取值: [16,128]; - 单位: kbps; """, dest='audioCodeRate', type=int, required=True)), + (['--jdchd'], dict(help="""(string) 京享超清开关; - 取值: jdchd-1.0,off; - 京享超清暂时只支持h.264; """, dest='jdchd', required=False)), + (['--audio-comfort'], dict(help="""(string) 舒适音频; - 取值: on,off; """, dest='audioComfort', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加直播质量检测模板 ''', + help=''' 添加自定义转码模板; - 系统为您预设了标准转码模板,如果不能满足您的转码需求,可以通过此接口添加自定义转码模板; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/25f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/25f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); ''', description=''' - 添加直播质量检测模板。 + 添加自定义转码模板; - 系统为您预设了标准转码模板,如果不能满足您的转码需求,可以通过此接口添加自定义转码模板; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/25f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/25f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); 。 - 示例: jdc live add-custom-live-stream-quality-detection-template --template xxx + 示例: jdc live add-custom-live-stream-transcode-template --video-code-rate 5 --video-frame-rate xxx --template xxx --audio-codec xxx --audio-sample-rate 5 --audio-channel 5 --audio-code-rate 5 ''', ) - def add_custom_live_stream_quality_detection_template(self): + def add_custom_live_stream_transcode_template(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddCustomLiveStreamQualityDetectionTemplateRequest import AddCustomLiveStreamQualityDetectionTemplateRequest + from jdcloud_sdk.services.live.apis.AddCustomLiveStreamTranscodeTemplateRequest import AddCustomLiveStreamTranscodeTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddCustomLiveStreamQualityDetectionTemplateRequest(params_dict, headers) + req = AddCustomLiveStreamTranscodeTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -701,29 +788,30 @@ def add_custom_live_stream_quality_detection_template(self): arguments=[ (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 质量检测模板查询过滤条件; - name: template 质量检测自定义名称; - value: 如果参数为空,则查询全部; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) 转码模板查询过滤条件:; - name: template 转码模板自定义名称; - value: 如果参数为空,则查询全部; - 如果为空,则表示查询该用下所有自定义的转码模板; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播质量检测模板列表 ''', + help=''' 查询用户自定义转码模板列表; ''', description=''' - 查询直播质量检测模板列表。 + 查询用户自定义转码模板列表; 。 - 示例: jdc live describe-custom-live-stream-quality-detection-templates + 示例: jdc live describe-custom-live-stream-transcode-templates ''', ) - def describe_custom_live_stream_quality_detection_templates(self): + def describe_custom_live_stream_transcode_templates(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamQualityDetectionTemplatesRequest import DescribeCustomLiveStreamQualityDetectionTemplatesRequest + from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamTranscodeTemplatesRequest import DescribeCustomLiveStreamTranscodeTemplatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCustomLiveStreamQualityDetectionTemplatesRequest(params_dict, headers) + req = DescribeCustomLiveStreamTranscodeTemplatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -733,31 +821,32 @@ def describe_custom_live_stream_quality_detection_templates(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--template'], dict(help="""(string) 质量检测模板; """, dest='template', required=True)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 转码模板查询过滤条件:; - name: template 转码模板自定义名称; - value: 如果参数为空,则查询全部; - 如果为空,则表示查询该用下所有自定义的转码模板; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加应用质量检测配置; - 添加应用级别的质量检测模板配置; ''', + help=''' 查询系统默认转码模板列表; ''', description=''' - 添加应用质量检测配置; - 添加应用级别的质量检测模板配置; 。 + 查询系统默认转码模板列表; 。 - 示例: jdc live add-live-stream-app-quality-detection --publish-domain xxx --app-name xxx --template xxx + 示例: jdc live describe-system-live-stream-transcode-templates ''', ) - def add_live_stream_app_quality_detection(self): + def describe_system_live_stream_transcode_templates(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveStreamAppQualityDetectionRequest import AddLiveStreamAppQualityDetectionRequest + from jdcloud_sdk.services.live.apis.DescribeSystemLiveStreamTranscodeTemplatesRequest import DescribeSystemLiveStreamTranscodeTemplatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveStreamAppQualityDetectionRequest(params_dict, headers) + req = DescribeSystemLiveStreamTranscodeTemplatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -767,30 +856,32 @@ def add_live_stream_app_quality_detection(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--template'], dict(help="""(string) 质量检测模板; """, dest='template', required=True)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 模板配置查询过滤条件:; - name: publishDomain 必填(推流域名); - value: 参数; - name: appName 必填(应用名称); - value: 参数; - name: streamName 非必填(流名称); - value: 参数; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加域名质量检测配置; - 添加域名级别的质量检测模板配置; ''', + help=''' 查询转码模板配置; - 转码模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效原则; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的转码模板配置,并非各级的模板绑定情况; ''', description=''' - 添加域名质量检测配置; - 添加域名级别的质量检测模板配置; 。 + 查询转码模板配置; - 转码模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效原则; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的转码模板配置,并非各级的模板绑定情况; 。 - 示例: jdc live add-live-stream-domain-quality-detection --publish-domain xxx --template xxx + 示例: jdc live describe-live-stream-transcode-config ''', ) - def add_live_stream_domain_quality_detection(self): + def describe_live_stream_transcode_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveStreamDomainQualityDetectionRequest import AddLiveStreamDomainQualityDetectionRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamTranscodeConfigRequest import DescribeLiveStreamTranscodeConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveStreamDomainQualityDetectionRequest(params_dict, headers) + req = DescribeLiveStreamTranscodeConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -801,29 +892,30 @@ def add_live_stream_domain_quality_detection(self): @expose( arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--notify-url'], dict(help="""(string) 质量检测回调通知的URL地址:; - 以 http:// 开头,外网可访问的地址; """, dest='notifyUrl', required=True)), + (['--template'], dict(help="""(string) 转码模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置直播质量检测回调通知地址; ''', + help=''' 删除域名级别转码模板配置; - 删除域名级别转码模板配置,重新推流后生效; ''', description=''' - 设置直播质量检测回调通知地址; 。 + 删除域名级别转码模板配置; - 删除域名级别转码模板配置,重新推流后生效; 。 - 示例: jdc live set-live-stream-quality-detection-notify-config --publish-domain xxx --notify-url xxx + 示例: jdc live delete-live-stream-domain-transcode --publish-domain xxx --template xxx ''', ) - def set_live_stream_quality_detection_notify_config(self): + def delete_live_stream_domain_transcode(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.SetLiveStreamQualityDetectionNotifyConfigRequest import SetLiveStreamQualityDetectionNotifyConfigRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamDomainTranscodeRequest import DeleteLiveStreamDomainTranscodeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLiveStreamQualityDetectionNotifyConfigRequest(params_dict, headers) + req = DeleteLiveStreamDomainTranscodeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -833,29 +925,32 @@ def set_live_stream_quality_detection_notify_config(self): @expose( arguments=[ - (['--template'], dict(help="""(string) 质量检测模板 """, dest='template', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--template'], dict(help="""(string) 转码模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除直播质量检测模板; - 删除质量检测模板前,请先删除此模板相关的质量检测配置,否则无法删除; ''', + help=''' 删除应用级别转码模板配置; - 删除应用级别的转码模板配置,重新推流后生效; ''', description=''' - 删除直播质量检测模板; - 删除质量检测模板前,请先删除此模板相关的质量检测配置,否则无法删除; 。 + 删除应用级别转码模板配置; - 删除应用级别的转码模板配置,重新推流后生效; 。 - 示例: jdc live delete-custom-live-stream-quality-detection-template --template xxx + 示例: jdc live delete-live-stream-app-transcode --publish-domain xxx --app-name xxx --template xxx ''', ) - def delete_custom_live_stream_quality_detection_template(self): + def delete_live_stream_app_transcode(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteCustomLiveStreamQualityDetectionTemplateRequest import DeleteCustomLiveStreamQualityDetectionTemplateRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamAppTranscodeRequest import DeleteLiveStreamAppTranscodeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteCustomLiveStreamQualityDetectionTemplateRequest(params_dict, headers) + req = DeleteLiveStreamAppTranscodeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -865,31 +960,30 @@ def delete_custom_live_stream_quality_detection_template(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--template'], dict(help="""(string) 质量检测模板 """, dest='template', required=True)), + (['--template'], dict(help="""(string) 转码模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除应用级别质量检测模板配置; - 删除应用级别质量检测模板配置,重新推流后生效; ''', + help=''' 查询用户自定义转码模板详情; - 查询用户自定义转码模板详情; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/24f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/24f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); ''', description=''' - 删除应用级别质量检测模板配置; - 删除应用级别质量检测模板配置,重新推流后生效; 。 + 查询用户自定义转码模板详情; - 查询用户自定义转码模板详情; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/24f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/24f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); 。 - 示例: jdc live delete-live-stream-app-quality-detection --publish-domain xxx --app-name xxx --template xxx + 示例: jdc live describe-custom-live-stream-transcode-template --template xxx ''', ) - def delete_live_stream_app_quality_detection(self): + def describe_custom_live_stream_transcode_template(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamAppQualityDetectionRequest import DeleteLiveStreamAppQualityDetectionRequest + from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamTranscodeTemplateRequest import DescribeCustomLiveStreamTranscodeTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamAppQualityDetectionRequest(params_dict, headers) + req = DescribeCustomLiveStreamTranscodeTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -899,30 +993,30 @@ def delete_live_stream_app_quality_detection(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--template'], dict(help="""(string) 质量检测模板 """, dest='template', required=True)), + (['--template'], dict(help="""(string) 转码模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除域名质量检测配置; - 删除域名级别的质量检测模板配置,重新推流后生效; ''', + help=''' 删除用户自定义转码模板; - 删除用户自定义转码模板之前必须先删除此模板在各域名、应用、流级别的转码设置; ''', description=''' - 删除域名质量检测配置; - 删除域名级别的质量检测模板配置,重新推流后生效; 。 + 删除用户自定义转码模板; - 删除用户自定义转码模板之前必须先删除此模板在各域名、应用、流级别的转码设置; 。 - 示例: jdc live delete-live-stream-domain-quality-detection --publish-domain xxx --template xxx + 示例: jdc live delete-custom-live-stream-transcode-template --template xxx ''', ) - def delete_live_stream_domain_quality_detection(self): + def delete_custom_live_stream_transcode_template(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamDomainQualityDetectionRequest import DeleteLiveStreamDomainQualityDetectionRequest + from jdcloud_sdk.services.live.apis.DeleteCustomLiveStreamTranscodeTemplateRequest import DeleteCustomLiveStreamTranscodeTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamDomainQualityDetectionRequest(params_dict, headers) + req = DeleteCustomLiveStreamTranscodeTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -932,29 +1026,30 @@ def delete_live_stream_domain_quality_detection(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--template'], dict(help="""(string) 转码模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询质量检测回调配置; ''', + help=''' 查询转码模板绑定; ''', description=''' - 查询质量检测回调配置; 。 + 查询转码模板绑定; 。 - 示例: jdc live describe-live-stream-quality-detection-notify-config --publish-domain xxx + 示例: jdc live describe-transcode-binding --template xxx ''', ) - def describe_live_stream_quality_detection_notify_config(self): + def describe_transcode_binding(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamQualityDetectionNotifyConfigRequest import DescribeLiveStreamQualityDetectionNotifyConfigRequest + from jdcloud_sdk.services.live.apis.DescribeTranscodeBindingRequest import DescribeTranscodeBindingRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamQualityDetectionNotifyConfigRequest(params_dict, headers) + req = DescribeTranscodeBindingRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -964,29 +1059,31 @@ def describe_live_stream_quality_detection_notify_config(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--template'], dict(help="""(string) 模板名称。长度不超过128个字符。UTF-8编码; """, dest='template', required=True)), + (['--modules'], dict(help="""(array: string) 检测项列表。取值范围:; BlackScreen - 黑屏; PureColor - 纯色; ColorCast - 偏色; FrozenFrame - 静帧; Brightness - 亮度; Contrast - 对比度; """, dest='modules', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除质量检测回调配置; ''', + help=''' 添加直播质量检测模板 ''', description=''' - 删除质量检测回调配置; 。 + 添加直播质量检测模板。 - 示例: jdc live delete-live-stream-quality-detection-notify-config --publish-domain xxx + 示例: jdc live add-custom-live-stream-quality-detection-template --template xxx ''', ) - def delete_live_stream_quality_detection_notify_config(self): + def add_custom_live_stream_quality_detection_template(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamQualityDetectionNotifyConfigRequest import DeleteLiveStreamQualityDetectionNotifyConfigRequest + from jdcloud_sdk.services.live.apis.AddCustomLiveStreamQualityDetectionTemplateRequest import AddCustomLiveStreamQualityDetectionTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamQualityDetectionNotifyConfigRequest(params_dict, headers) + req = AddCustomLiveStreamQualityDetectionTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -996,29 +1093,32 @@ def delete_live_stream_quality_detection_notify_config(self): @expose( arguments=[ - (['--template'], dict(help="""(string) 质量检测模板 """, dest='template', required=True)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 质量检测模板查询过滤条件; - name: template 质量检测自定义名称; - value: 如果参数为空,则查询全部; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询质量检测模板绑定; ''', + help=''' 查询直播质量检测模板列表 ''', description=''' - 查询质量检测模板绑定; 。 + 查询直播质量检测模板列表。 - 示例: jdc live describe-quality-detection-binding --template xxx + 示例: jdc live describe-custom-live-stream-quality-detection-templates ''', ) - def describe_quality_detection_binding(self): + def describe_custom_live_stream_quality_detection_templates(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeQualityDetectionBindingRequest import DescribeQualityDetectionBindingRequest + from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamQualityDetectionTemplatesRequest import DescribeCustomLiveStreamQualityDetectionTemplatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeQualityDetectionBindingRequest(params_dict, headers) + req = DescribeCustomLiveStreamQualityDetectionTemplatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1028,29 +1128,32 @@ def describe_quality_detection_binding(self): @expose( arguments=[ - (['--play-domain'], dict(help="""(string) 播放域名 """, dest='playDomain', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--template'], dict(help="""(string) 质量检测模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启P2P; ''', + help=''' 添加应用质量检测配置; - 添加应用级别的质量检测模板配置; ''', description=''' - 开启P2P; 。 + 添加应用质量检测配置; - 添加应用级别的质量检测模板配置; 。 - 示例: jdc live open-live-p2p + 示例: jdc live add-live-stream-app-quality-detection --publish-domain xxx --app-name xxx --template xxx ''', ) - def open_live_p2p(self): + def add_live_stream_app_quality_detection(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.OpenLiveP2pRequest import OpenLiveP2pRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamAppQualityDetectionRequest import AddLiveStreamAppQualityDetectionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = OpenLiveP2pRequest(params_dict, headers) + req = AddLiveStreamAppQualityDetectionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1060,29 +1163,31 @@ def open_live_p2p(self): @expose( arguments=[ - (['--play-domain'], dict(help="""(string) 播放域名 """, dest='playDomain', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--template'], dict(help="""(string) 质量检测模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 关闭P2P ''', + help=''' 添加域名质量检测配置; - 添加域名级别的质量检测模板配置; ''', description=''' - 关闭P2P。 + 添加域名质量检测配置; - 添加域名级别的质量检测模板配置; 。 - 示例: jdc live close-live-p2p + 示例: jdc live add-live-stream-domain-quality-detection --publish-domain xxx --template xxx ''', ) - def close_live_p2p(self): + def add_live_stream_domain_quality_detection(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.CloseLiveP2pRequest import CloseLiveP2pRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamDomainQualityDetectionRequest import AddLiveStreamDomainQualityDetectionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CloseLiveP2pRequest(params_dict, headers) + req = AddLiveStreamDomainQualityDetectionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1092,31 +1197,31 @@ def close_live_p2p(self): @expose( arguments=[ - (['--page-number'], dict(help="""(int) 页码; - 取值范围[1, 100000]; """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), - (['--play-domain'], dict(help="""(string) 直播的播放域名; - 目前仅支持精确匹配; """, dest='playDomain', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--notify-url'], dict(help="""(string) 质量检测回调通知的URL地址:; - 以 http:// 开头,外网可访问的地址; """, dest='notifyUrl', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询P2P配置 ''', + help=''' 设置直播质量检测回调通知地址; ''', description=''' - 查询P2P配置。 + 设置直播质量检测回调通知地址; 。 - 示例: jdc live describe-live-p2p-configs --play-domain xxx + 示例: jdc live set-live-stream-quality-detection-notify-config --publish-domain xxx --notify-url xxx ''', ) - def describe_live_p2p_configs(self): + def set_live_stream_quality_detection_notify_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveP2pConfigsRequest import DescribeLiveP2pConfigsRequest + from jdcloud_sdk.services.live.apis.SetLiveStreamQualityDetectionNotifyConfigRequest import SetLiveStreamQualityDetectionNotifyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveP2pConfigsRequest(params_dict, headers) + req = SetLiveStreamQualityDetectionNotifyConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1126,31 +1231,30 @@ def describe_live_p2p_configs(self): @expose( arguments=[ - (['--page-num'], dict(help="""(int) 页码; - 取值范围[1, 100000]; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 录制模板列表查询过滤条件:; - name: template 录制模板自定义名称; - value: 如果参数为空,则查询全部; """, dest='filters', required=False)), + (['--template'], dict(help="""(string) 质量检测模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户自定义直播录制模板列表; ''', + help=''' 删除直播质量检测模板; - 删除质量检测模板前,请先删除此模板相关的质量检测配置,否则无法删除; ''', description=''' - 查询用户自定义直播录制模板列表; 。 + 删除直播质量检测模板; - 删除质量检测模板前,请先删除此模板相关的质量检测配置,否则无法删除; 。 - 示例: jdc live describe-custom-live-stream-record-templates + 示例: jdc live delete-custom-live-stream-quality-detection-template --template xxx ''', ) - def describe_custom_live_stream_record_templates(self): + def delete_custom_live_stream_quality_detection_template(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamRecordTemplatesRequest import DescribeCustomLiveStreamRecordTemplatesRequest + from jdcloud_sdk.services.live.apis.DeleteCustomLiveStreamQualityDetectionTemplateRequest import DeleteCustomLiveStreamQualityDetectionTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCustomLiveStreamRecordTemplatesRequest(params_dict, headers) + req = DeleteCustomLiveStreamQualityDetectionTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1160,33 +1264,32 @@ def describe_custom_live_stream_record_templates(self): @expose( arguments=[ - (['--record-period'], dict(help="""(int) 自动录制周期; - 取值: [15,360]; - 单位: 分钟; """, dest='recordPeriod', type=int, required=True)), - (['--save-bucket'], dict(help="""(string) 存储桶; """, dest='saveBucket', required=True)), - (['--save-endpoint'], dict(help="""(string) endpoint; """, dest='saveEndpoint', required=False)), - (['--record-file-type'], dict(help="""(string) 录制文件格式:; - 取值: ts,flv,mp4 (多种类型之间用;隔开); - 不区分大小写; """, dest='recordFileType', required=True)), - (['--template'], dict(help="""(string) 录制模板自定义名称:; - 取值要求:数字、大小写字母或短横线("-")、下划线("_"),; 最大长度50个字符; - 注意: 不能与已定义命名重复; """, dest='template', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--template'], dict(help="""(string) 质量检测模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加用户自定义直播录制模板; ''', + help=''' 删除应用级别质量检测模板配置; - 删除应用级别质量检测模板配置,重新推流后生效; ''', description=''' - 添加用户自定义直播录制模板; 。 + 删除应用级别质量检测模板配置; - 删除应用级别质量检测模板配置,重新推流后生效; 。 - 示例: jdc live add-custom-live-stream-record-template --record-period 0 --save-bucket xxx --record-file-type xxx --template xxx + 示例: jdc live delete-live-stream-app-quality-detection --publish-domain xxx --app-name xxx --template xxx ''', ) - def add_custom_live_stream_record_template(self): + def delete_live_stream_app_quality_detection(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddCustomLiveStreamRecordTemplateRequest import AddCustomLiveStreamRecordTemplateRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamAppQualityDetectionRequest import DeleteLiveStreamAppQualityDetectionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddCustomLiveStreamRecordTemplateRequest(params_dict, headers) + req = DeleteLiveStreamAppQualityDetectionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1197,30 +1300,30 @@ def add_custom_live_stream_record_template(self): @expose( arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--template'], dict(help="""(string) 录制模版 """, dest='template', required=True)), + (['--template'], dict(help="""(string) 质量检测模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加应用级别直播录制配置; - 添加应用级别的直播录制模板配置; ''', + help=''' 删除域名质量检测配置; - 删除域名级别的质量检测模板配置,重新推流后生效; ''', description=''' - 添加应用级别直播录制配置; - 添加应用级别的直播录制模板配置; 。 + 删除域名质量检测配置; - 删除域名级别的质量检测模板配置,重新推流后生效; 。 - 示例: jdc live add-live-stream-app-record --publish-domain xxx --app-name xxx --template xxx + 示例: jdc live delete-live-stream-domain-quality-detection --publish-domain xxx --template xxx ''', ) - def add_live_stream_app_record(self): + def delete_live_stream_domain_quality_detection(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveStreamAppRecordRequest import AddLiveStreamAppRecordRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamDomainQualityDetectionRequest import DeleteLiveStreamDomainQualityDetectionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveStreamAppRecordRequest(params_dict, headers) + req = DeleteLiveStreamDomainQualityDetectionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1231,29 +1334,29 @@ def add_live_stream_app_record(self): @expose( arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--template'], dict(help="""(string) 录制模版 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加域名级别直播录制配置; - 添加域名级别的直播录制模板配置; ''', + help=''' 查询质量检测回调配置; ''', description=''' - 添加域名级别直播录制配置; - 添加域名级别的直播录制模板配置; 。 + 查询质量检测回调配置; 。 - 示例: jdc live add-live-stream-domain-record --publish-domain xxx --template xxx + 示例: jdc live describe-live-stream-quality-detection-notify-config --publish-domain xxx ''', ) - def add_live_stream_domain_record(self): + def describe_live_stream_quality_detection_notify_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveStreamDomainRecordRequest import AddLiveStreamDomainRecordRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamQualityDetectionNotifyConfigRequest import DescribeLiveStreamQualityDetectionNotifyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveStreamDomainRecordRequest(params_dict, headers) + req = DescribeLiveStreamQualityDetectionNotifyConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1263,31 +1366,30 @@ def add_live_stream_domain_record(self): @expose( arguments=[ - (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 录制配置查询过滤条件:; - name: publishDomain,必填(推流域名); - value: 参数; - name: appName,必填(应用名称); - value: 参数; - name: streamName,非必填(流名称); - value: 参数; """, dest='filters', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播直播录制配置; - 录制模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的录制模板配置,并非各级的模板绑定情况; ''', + help=''' 删除质量检测回调配置; ''', description=''' - 查询直播直播录制配置; - 录制模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的录制模板配置,并非各级的模板绑定情况; 。 + 删除质量检测回调配置; 。 - 示例: jdc live describe-custom-live-stream-record-config + 示例: jdc live delete-live-stream-quality-detection-notify-config --publish-domain xxx ''', ) - def describe_custom_live_stream_record_config(self): + def delete_live_stream_quality_detection_notify_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamRecordConfigRequest import DescribeCustomLiveStreamRecordConfigRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamQualityDetectionNotifyConfigRequest import DeleteLiveStreamQualityDetectionNotifyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCustomLiveStreamRecordConfigRequest(params_dict, headers) + req = DeleteLiveStreamQualityDetectionNotifyConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1297,30 +1399,30 @@ def describe_custom_live_stream_record_config(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--notify-url'], dict(help="""(string) 录制回调通知的URL地址; - 以 http:// 开头,外网可访问的地址; """, dest='notifyUrl', required=True)), + (['--template'], dict(help="""(string) 质量检测模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置直播录制回调通知; ''', + help=''' 查询质量检测模板绑定; ''', description=''' - 设置直播录制回调通知; 。 + 查询质量检测模板绑定; 。 - 示例: jdc live set-live-stream-record-notify-config --publish-domain xxx --notify-url xxx + 示例: jdc live describe-quality-detection-binding --template xxx ''', ) - def set_live_stream_record_notify_config(self): + def describe_quality_detection_binding(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.SetLiveStreamRecordNotifyConfigRequest import SetLiveStreamRecordNotifyConfigRequest + from jdcloud_sdk.services.live.apis.DescribeQualityDetectionBindingRequest import DescribeQualityDetectionBindingRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLiveStreamRecordNotifyConfigRequest(params_dict, headers) + req = DescribeQualityDetectionBindingRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1330,29 +1432,30 @@ def set_live_stream_record_notify_config(self): @expose( arguments=[ - (['--template'], dict(help="""(string) 录制模板 """, dest='template', required=True)), + (['--play-domain'], dict(help="""(string) (直播or时移)播放域名; - 仅支持精确匹配; """, dest='playDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除用户自定义录制模板; - 删除用户自定义录制模板之前必须先删除此模板在各域名、应用、流级别的录制设置; ''', + help=''' 查询(直播or时移)播放鉴权KEY ''', description=''' - 删除用户自定义录制模板; - 删除用户自定义录制模板之前必须先删除此模板在各域名、应用、流级别的录制设置; 。 + 查询(直播or时移)播放鉴权KEY。 - 示例: jdc live delete-custom-live-stream-record-template --template xxx + 示例: jdc live describe-live-play-auth-key --play-domain xxx ''', ) - def delete_custom_live_stream_record_template(self): + def describe_live_play_auth_key(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteCustomLiveStreamRecordTemplateRequest import DeleteCustomLiveStreamRecordTemplateRequest + from jdcloud_sdk.services.live.apis.DescribeLivePlayAuthKeyRequest import DescribeLivePlayAuthKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteCustomLiveStreamRecordTemplateRequest(params_dict, headers) + req = DescribeLivePlayAuthKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1362,31 +1465,32 @@ def delete_custom_live_stream_record_template(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--template'], dict(help="""(string) 录制模板; """, dest='template', required=True)), + (['--play-domain'], dict(help="""(string) (直播or时移)播放域名 """, dest='playDomain', required=True)), + (['--auth-status'], dict(help="""(string) (直播or时移)播放鉴权状态; on: 开启; off: 关闭; - 当播放鉴权状态on(开启)时,authKey不能为空; """, dest='authStatus', required=False)), + (['--auth-key'], dict(help="""(string) (直播or时移)播放鉴权key; - 取值: 支持大小写字母和数字 长度6-32位; """, dest='authKey', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除应用级别录制模板配置; - 删除应用级别的录制模板配置,重新推流后生效; ''', + help=''' 设置(直播or时移)播放鉴权KEY ''', description=''' - 删除应用级别录制模板配置; - 删除应用级别的录制模板配置,重新推流后生效; 。 + 设置(直播or时移)播放鉴权KEY。 - 示例: jdc live delete-live-stream-app-record --publish-domain xxx --app-name xxx --template xxx + 示例: jdc live set-live-play-auth-key --play-domain xxx ''', ) - def delete_live_stream_app_record(self): + def set_live_play_auth_key(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamAppRecordRequest import DeleteLiveStreamAppRecordRequest + from jdcloud_sdk.services.live.apis.SetLivePlayAuthKeyRequest import SetLivePlayAuthKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamAppRecordRequest(params_dict, headers) + req = SetLivePlayAuthKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1396,30 +1500,30 @@ def delete_live_stream_app_record(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--template'], dict(help="""(string) 录制模板; """, dest='template', required=True)), + (['--restart-domain'], dict(help="""(string) 直播回看播放域名; - 仅支持精确匹配; """, dest='restartDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除域名级别录制模板配置; - 删除域名级别录制模板配置,重新推流后生效; ''', + help=''' 查询直播回看播放鉴权KEY ''', description=''' - 删除域名级别录制模板配置; - 删除域名级别录制模板配置,重新推流后生效; 。 + 查询直播回看播放鉴权KEY。 - 示例: jdc live delete-live-stream-domain-record --publish-domain xxx --template xxx + 示例: jdc live describe-live-restart-auth-key --restart-domain xxx ''', ) - def delete_live_stream_domain_record(self): + def describe_live_restart_auth_key(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamDomainRecordRequest import DeleteLiveStreamDomainRecordRequest + from jdcloud_sdk.services.live.apis.DescribeLiveRestartAuthKeyRequest import DescribeLiveRestartAuthKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamDomainRecordRequest(params_dict, headers) + req = DescribeLiveRestartAuthKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1429,29 +1533,32 @@ def delete_live_stream_domain_record(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--restart-domain'], dict(help="""(string) 直播回看播放域名 """, dest='restartDomain', required=True)), + (['--auth-status'], dict(help="""(string) 直播回看播放鉴权状态; on: 开启; off: 关闭; - 当回看播放鉴权状态on(开启)时,authKey不能为空; """, dest='authStatus', required=False)), + (['--auth-key'], dict(help="""(string) 直播回看播放鉴权key; - 取值: 支持大小写字母和数字 长度6-32位; """, dest='authKey', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询录制回调配置; ''', + help=''' 设置直播回看播放鉴权KEY ''', description=''' - 查询录制回调配置; 。 + 设置直播回看播放鉴权KEY。 - 示例: jdc live describe-live-stream-record-notify-config --publish-domain xxx + 示例: jdc live set-live-restart-auth-key --restart-domain xxx ''', ) - def describe_live_stream_record_notify_config(self): + def set_live_restart_auth_key(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamRecordNotifyConfigRequest import DescribeLiveStreamRecordNotifyConfigRequest + from jdcloud_sdk.services.live.apis.SetLiveRestartAuthKeyRequest import SetLiveRestartAuthKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamRecordNotifyConfigRequest(params_dict, headers) + req = SetLiveRestartAuthKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1461,29 +1568,39 @@ def describe_live_stream_record_notify_config(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--position'], dict(help="""(int) 水印位置; - 取值范围:左上:1,右上:3, 左下:7,右下:9,默认:1; """, dest='position', type=int, required=False)), + (['--offset-unit'], dict(help="""(string) 偏移量单位; - 取值: percent,pixel; - percent:按百分比; pixel:像素 默认:pixel; """, dest='offsetUnit', required=False)), + (['--offset-x'], dict(help="""(int) x轴偏移量; - 取值范围; percent: (0,100]; pixel: (0,1920]; """, dest='offsetX', type=int, required=True)), + (['--offset-y'], dict(help="""(int) y轴偏移量:; - 取值范围; percent: (0,100]; pixel: (0,1920]; """, dest='offsetY', type=int, required=True)), + (['--size-unit'], dict(help="""(string) 水印大小单位; - 取值: percent,pixel; - percent:按百分比; pixel:像素 默认:pixel; """, dest='sizeUnit', required=False)), + (['--width'], dict(help="""(int) 水印宽度:; - 取值范围; percent: (0,100]; pixel: (0,1920]; """, dest='width', type=int, required=True)), + (['--height'], dict(help="""(int) 水印高度:; - 取值范围; percent: (0,100]; pixel: (0,1920]; """, dest='height', type=int, required=True)), + (['--template'], dict(help="""(string) 自定义水印模板名称; - 取值要求: 数字、大小写字母、短横线("-")、下划线("_"),;   首尾不能有特殊字符("-"),;   不超过50字符,utf-8格式; - 注意: 不能与已定义命名重复; """, dest='template', required=True)), + (['--upload-id'], dict(help="""(string) 创建上传任务时返回的uploadId参数,当通过接口上传水印图片时,uploadId必填; """, dest='uploadId', required=False)), + (['--url'], dict(help="""(string) 水印地址
- 以 http:// 开头,可公开访问地址
""", dest='url', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除录制回调配置; ''', + help=''' 添加用户自定义水印模板; ''', description=''' - 删除录制回调配置; 。 + 添加用户自定义水印模板; 。 - 示例: jdc live delete-live-stream-record-notify-config --publish-domain xxx + 示例: jdc live add-custom-live-stream-watermark-template --offset-x 5 --offset-y 5 --width 5 --height 5 --template xxx --url xxx ''', ) - def delete_live_stream_record_notify_config(self): + def add_custom_live_stream_watermark_template(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamRecordNotifyConfigRequest import DeleteLiveStreamRecordNotifyConfigRequest + from jdcloud_sdk.services.live.apis.AddCustomLiveStreamWatermarkTemplateRequest import AddCustomLiveStreamWatermarkTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamRecordNotifyConfigRequest(params_dict, headers) + req = AddCustomLiveStreamWatermarkTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1493,37 +1610,32 @@ def delete_live_stream_record_notify_config(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), - (['--record-times'], dict(help="""(array: recordTime) 录制时间集合; - 最大支持10段,多段合并成一个文件; - 多段时间跨度最小不能小于10s; - 多段时间跨度最大不能超过8小时; """, dest='recordTimes', required=True)), - (['--save-bucket'], dict(help="""(string) 存储桶 """, dest='saveBucket', required=True)), - (['--save-endpoint'], dict(help="""(string) 存储地址 """, dest='saveEndpoint', required=True)), - (['--record-file-type'], dict(help="""(string) 录制文件类型:; - 取值: ts,flv,mp4 (多种类型之间用;隔开); - 不区分大小写; """, dest='recordFileType', required=True)), - (['--save-object'], dict(help="""(string) 录制文件存储Object:; - 默认: /record/{Date}/{ServerId}/{AppName}/{StreamName}/{StartTime}_{EndTime}; """, dest='saveObject', required=False)), - (['--task-external-id'], dict(help="""(string) 打点录制任务外部id(可传入您的id,在回调时会在该字段返回); """, dest='taskExternalId', required=False)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 水印模板列表查询过滤条件:; - name: template 录制模板自定义名称; - value: 如果参数为空,则查询全部; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加打点录制任务; - 您可以调用此接口精确提取已录制的文件中所需要的部分; ''', + help=''' 查询用户定义水印模板列表; ''', description=''' - 添加打点录制任务; - 您可以调用此接口精确提取已录制的文件中所需要的部分; 。 + 查询用户定义水印模板列表; 。 - 示例: jdc live add-live-record-task --publish-domain xxx --app-name xxx --stream-name xxx --record-times ['{"":""}'] --save-bucket xxx --save-endpoint xxx --record-file-type xxx + 示例: jdc live describe-custom-live-stream-watermark-templates ''', ) - def add_live_record_task(self): + def describe_custom_live_stream_watermark_templates(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveRecordTaskRequest import AddLiveRecordTaskRequest + from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamWatermarkTemplatesRequest import DescribeCustomLiveStreamWatermarkTemplatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveRecordTaskRequest(params_dict, headers) + req = DescribeCustomLiveStreamWatermarkTemplatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1533,29 +1645,32 @@ def add_live_record_task(self): @expose( arguments=[ - (['--template'], dict(help="""(string) 录制模板 """, dest='template', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--template'], dict(help="""(string) 水印模板名称; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询录制模板绑定; ''', + help=''' 添加应用级别水印配置; ''', description=''' - 查询录制模板绑定; 。 + 添加应用级别水印配置; 。 - 示例: jdc live describe-record-binding --template xxx + 示例: jdc live add-live-stream-app-watermark --publish-domain xxx --app-name xxx --template xxx ''', ) - def describe_record_binding(self): + def add_live_stream_app_watermark(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeRecordBindingRequest import DescribeRecordBindingRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamAppWatermarkRequest import AddLiveStreamAppWatermarkRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeRecordBindingRequest(params_dict, headers) + req = AddLiveStreamAppWatermarkRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1565,36 +1680,31 @@ def describe_record_binding(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=False)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), - (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), - (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), - (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,查询时间跨度不超过1天; """, dest='endTime', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--template'], dict(help="""(string) 水印模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询流分组统计数据 ''', + help=''' 添加域名水印配置; ''', description=''' - 查询流分组统计数据。 + 添加域名水印配置; 。 - 示例: jdc live describe-live-statistic-group-by-stream --start-time xxx + 示例: jdc live add-live-stream-domain-watermark --publish-domain xxx --template xxx ''', ) - def describe_live_statistic_group_by_stream(self): + def add_live_stream_domain_watermark(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStatisticGroupByStreamRequest import DescribeLiveStatisticGroupByStreamRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamDomainWatermarkRequest import AddLiveStreamDomainWatermarkRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStatisticGroupByStreamRequest(params_dict, headers) + req = AddLiveStreamDomainWatermarkRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1604,36 +1714,32 @@ def describe_live_statistic_group_by_stream(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), - (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), - (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), - (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,查询时间跨度不超过1天; """, dest='endTime', required=False)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 水印配置查询过滤条件:; - name: publishDomain,必填(推流域名); - value: 参数; - name: appName,必填(应用名称); - value: 参数; - name: streamName,非必填(流名称); - value: 参数; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询地域分组统计数据 ''', + help=''' 查询直播水印配置; - 水印模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的水印模板配置,并非各级的模板绑定情况; ''', description=''' - 查询地域分组统计数据。 + 查询直播水印配置; - 水印模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的水印模板配置,并非各级的模板绑定情况; 。 - 示例: jdc live describe-live-statistic-group-by-area --domain-name xxx --app-name xxx --stream-name xxx --start-time xxx + 示例: jdc live describe-custom-live-stream-watermark-config ''', ) - def describe_live_statistic_group_by_area(self): + def describe_custom_live_stream_watermark_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStatisticGroupByAreaRequest import DescribeLiveStatisticGroupByAreaRequest + from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamWatermarkConfigRequest import DescribeCustomLiveStreamWatermarkConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStatisticGroupByAreaRequest(params_dict, headers) + req = DescribeCustomLiveStreamWatermarkConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1643,37 +1749,30 @@ def describe_live_statistic_group_by_area(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), - (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), - (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), - (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), - (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,查询时间跨度不超过1天; """, dest='endTime', required=False)), + (['--template'], dict(help="""(string) 水印模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询地域/运营商分组统计数据 ''', + help=''' 删除用户自定义水印模板; - 删除用户自定义水印模板之前必须先删除此模板在各域名、应用、流级别的水印设置; ''', description=''' - 查询地域/运营商分组统计数据。 + 删除用户自定义水印模板; - 删除用户自定义水印模板之前必须先删除此模板在各域名、应用、流级别的水印设置; 。 - 示例: jdc live describe-live-statistic-group-by-area-isp --domain-name xxx --app-name xxx --stream-name xxx --start-time xxx + 示例: jdc live delete-custom-live-stream-watermark-template --template xxx ''', ) - def describe_live_statistic_group_by_area_isp(self): + def delete_custom_live_stream_watermark_template(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStatisticGroupByAreaIspRequest import DescribeLiveStatisticGroupByAreaIspRequest + from jdcloud_sdk.services.live.apis.DeleteCustomLiveStreamWatermarkTemplateRequest import DeleteCustomLiveStreamWatermarkTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStatisticGroupByAreaIspRequest(params_dict, headers) + req = DeleteCustomLiveStreamWatermarkTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1683,33 +1782,32 @@ def describe_live_statistic_group_by_area_isp(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), - (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,查询时间跨度不超过1天; """, dest='endTime', required=False)), + (['--template'], dict(help="""(string) 水印模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询推流监控数据 ''', + help=''' 删除应用级别水印模板配置; - 删除应用级别的水印模板配置,重新推流后生效; ''', description=''' - 查询推流监控数据。 + 删除应用级别水印模板配置; - 删除应用级别的水印模板配置,重新推流后生效; 。 - 示例: jdc live describe-publish-stream-info-data --domain-name xxx --app-name xxx --stream-name xxx --start-time xxx + 示例: jdc live delete-live-stream-app-watermark --publish-domain xxx --app-name xxx --template xxx ''', ) - def describe_publish_stream_info_data(self): + def delete_live_stream_app_watermark(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribePublishStreamInfoDataRequest import DescribePublishStreamInfoDataRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamAppWatermarkRequest import DeleteLiveStreamAppWatermarkRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribePublishStreamInfoDataRequest(params_dict, headers) + req = DeleteLiveStreamAppWatermarkRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1719,37 +1817,31 @@ def describe_publish_stream_info_data(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=False)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), - (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), - (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), - (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), - (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间; """, dest='endTime', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--template'], dict(help="""(string) 水印模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播流历史在线人数 ''', + help=''' 删除域名级别水印模板配置; - 删除域名级别水印模板配置,重新推流后生效; ''', description=''' - 查询直播流历史在线人数。 + 删除域名级别水印模板配置; - 删除域名级别水印模板配置,重新推流后生效; 。 - 示例: jdc live describe-live-stream-history-user-num --start-time xxx + 示例: jdc live delete-live-stream-domain-watermark --publish-domain xxx --template xxx ''', ) - def describe_live_stream_history_user_num(self): + def delete_live_stream_domain_watermark(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamHistoryUserNumRequest import DescribeLiveStreamHistoryUserNumRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamDomainWatermarkRequest import DeleteLiveStreamDomainWatermarkRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamHistoryUserNumRequest(params_dict, headers) + req = DeleteLiveStreamDomainWatermarkRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1759,36 +1851,30 @@ def describe_live_stream_history_user_num(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=False)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), - (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), - (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), - (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), - (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间; """, dest='endTime', required=False)), + (['--template'], dict(help="""(string) 水印模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播推流数 ''', + help=''' 查询水印模板绑定; ''', description=''' - 查询直播推流数。 + 查询水印模板绑定; 。 - 示例: jdc live describe-live-publish-stream-num --start-time xxx + 示例: jdc live describe-watermark-binding --template xxx ''', ) - def describe_live_publish_stream_num(self): + def describe_watermark_binding(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLivePublishStreamNumRequest import DescribeLivePublishStreamNumRequest + from jdcloud_sdk.services.live.apis.DescribeWatermarkBindingRequest import DescribeWatermarkBindingRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLivePublishStreamNumRequest(params_dict, headers) + req = DescribeWatermarkBindingRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1798,33 +1884,37 @@ def describe_live_publish_stream_num(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--protocol-type'], dict(help="""(string) 协议,取值范围:"hdl,hls"; """, dest='protocolType', required=True)), - (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,时间跨度不不超过⼀一天; """, dest='endTime', required=False)), + (['--source-url'], dict(help="""(string) 拉流地址; - 支持rtmp; """, dest='sourceUrl', required=True)), + (['--push-url'], dict(help="""(string) 转推地址; - 支持rtmp; """, dest='pushUrl', required=True)), + (['--start-mode'], dict(help="""(string) 执行方式; - StartNow: 立即执行; - StartAsScheduled: 定时执行,根据参数设定的时间; """, dest='startMode', required=True)), + (['--start-time'], dict(help="""(string) 开始时间; - UTC时间, ISO8601示例:2021-07-26T08:08:08Z; - 不填表示立即开始; """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 结束时间; - UTC时间, ISO8601示例:2021-07-26T08:08:08Z; - 最大支持365天,与开始时间间隔不超过7天。; - 假设当前时间2021年03月30日11:50:01,则:结束时间不可超过2022年03月30日11:50:01。; - 不填拉不到流10分钟自动结束; """, dest='endTime', required=False)), + (['--callback-events'], dict(help="""(array: string) 回调类型; - 不填发送全部回调; - TaskStart 任务开始; - TaskExit 任务结束; - callbackUrl非空的情况下,callbackEvents有效; """, dest='callbackEvents', required=False)), + (['--callback-url'], dict(help="""(string) 事件回调地址; """, dest='callbackUrl', required=False)), + (['--name'], dict(help="""(string) 任务名称; - 最大255字符; """, dest='name', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播流播放人数排行 ''', + help=''' 创建直播拉流转推任务; ''', description=''' - 查询直播流播放人数排行。 + 创建直播拉流转推任务; 。 - 示例: jdc live describe-live-stream-player-ranking-data --domain-name xxx --app-name xxx --protocol-type xxx --start-time xxx + 示例: jdc live create-live-forward-task --source-url xxx --push-url xxx --start-mode xxx ''', ) - def describe_live_stream_player_ranking_data(self): + def create_live_forward_task(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamPlayerRankingDataRequest import DescribeLiveStreamPlayerRankingDataRequest + from jdcloud_sdk.services.live.apis.CreateLiveForwardTaskRequest import CreateLiveForwardTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamPlayerRankingDataRequest(params_dict, headers) + req = CreateLiveForwardTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1834,31 +1924,37 @@ def describe_live_stream_player_ranking_data(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 推流域名; """, dest='domainName', required=True)), - (['--app-name'], dict(help="""(string) 应用名称; """, dest='appName', required=True)), - (['--stream-name'], dict(help="""(string) 流名称; """, dest='streamName', required=True)), + (['--task-id'], dict(help="""(string) 任务ID; """, dest='taskId', required=True)), + (['--source-url'], dict(help="""(string) 拉流地址; - 支持rtmp; """, dest='sourceUrl', required=False)), + (['--push-url'], dict(help="""(string) 转推地址; - 支持rtmp; """, dest='pushUrl', required=False)), + (['--start-time'], dict(help="""(string) 开始时间; - UTC时间, ISO8601示例:2021-07-26T08:08:08Z; - 不填表示立即开始; """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 结束时间; - UTC时间, ISO8601示例:2021-07-26T08:08:08Z; - 最大支持365天,与开始时间间隔不超过7天。; - 不填拉不到流10分钟自动结束; """, dest='endTime', required=False)), + (['--callback-events'], dict(help="""(array: string) 回调类型; - 不填发送全部回调; - TaskStart 任务开始; - TaskExit 任务结束; - callbackUrl非空的情况下,callbackEvents有效; """, dest='callbackEvents', required=False)), + (['--callback-url'], dict(help="""(string) 事件回调地址; """, dest='callbackUrl', required=False)), + (['--name'], dict(help="""(string) 任务名称; - 最大255字符; """, dest='name', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询转码流信息 ''', + help=''' 更新直播拉流转推任务; ''', description=''' - 查询转码流信息。 + 更新直播拉流转推任务; 。 - 示例: jdc live describe-live-transcode-stream-list --domain-name xxx --app-name xxx --stream-name xxx + 示例: jdc live update-live-forward-task --task-id xxx ''', ) - def describe_live_transcode_stream_list(self): + def update_live_forward_task(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveTranscodeStreamListRequest import DescribeLiveTranscodeStreamListRequest + from jdcloud_sdk.services.live.apis.UpdateLiveForwardTaskRequest import UpdateLiveForwardTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveTranscodeStreamListRequest(params_dict, headers) + req = UpdateLiveForwardTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1868,29 +1964,32 @@ def describe_live_transcode_stream_list(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=False)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 拉流转推任务查询过滤条件:; - name: taskId 任务ID; - value: 如果参数为空,则查询全部; - name: taskName 任务名称; - value: 如果参数为空,则查询全部; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询转码流数量 ''', + help=''' 查询直播拉流转推任务; ''', description=''' - 查询转码流数量。 + 查询直播拉流转推任务; 。 - 示例: jdc live describe-live-transcode-stream-num + 示例: jdc live query-live-forward-task ''', ) - def describe_live_transcode_stream_num(self): + def query_live_forward_task(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveTranscodeStreamNumRequest import DescribeLiveTranscodeStreamNumRequest + from jdcloud_sdk.services.live.apis.QueryLiveForwardTaskRequest import QueryLiveForwardTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveTranscodeStreamNumRequest(params_dict, headers) + req = QueryLiveForwardTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1900,36 +1999,30 @@ def describe_live_transcode_stream_num(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), - (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), - (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), - (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--task-ids'], dict(help="""(string) 任务ID,批量用,分隔; """, dest='taskIds', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询转码流观看人数 ''', + help=''' 开始直播拉流转推任务; ''', description=''' - 查询转码流观看人数。 + 开始直播拉流转推任务; 。 - 示例: jdc live describe-live-transcode-stream-player-user-num --domain-name xxx --app-name xxx --start-time xxx + 示例: jdc live start-live-forward-task --task-ids xxx ''', ) - def describe_live_transcode_stream_player_user_num(self): + def start_live_forward_task(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveTranscodeStreamPlayerUserNumRequest import DescribeLiveTranscodeStreamPlayerUserNumRequest + from jdcloud_sdk.services.live.apis.StartLiveForwardTaskRequest import StartLiveForwardTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveTranscodeStreamPlayerUserNumRequest(params_dict, headers) + req = StartLiveForwardTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1939,36 +2032,30 @@ def describe_live_transcode_stream_player_user_num(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), - (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), - (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), - (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--task-ids'], dict(help="""(string) 任务ID,批量用,分隔; """, dest='taskIds', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询转码流播放带宽; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; ''', + help=''' 停止直播拉流转推任务; ''', description=''' - 查询转码流播放带宽; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; 。 + 停止直播拉流转推任务; 。 - 示例: jdc live describe-live-transcode-stream-bandwidth --domain-name xxx --app-name xxx --start-time xxx + 示例: jdc live stop-live-forward-task --task-ids xxx ''', ) - def describe_live_transcode_stream_bandwidth(self): + def stop_live_forward_task(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveTranscodeStreamBandwidthRequest import DescribeLiveTranscodeStreamBandwidthRequest + from jdcloud_sdk.services.live.apis.StopLiveForwardTaskRequest import StopLiveForwardTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveTranscodeStreamBandwidthRequest(params_dict, headers) + req = StopLiveForwardTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1978,35 +2065,30 @@ def describe_live_transcode_stream_bandwidth(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 推流域名 """, dest='domainName', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), - (['--page-num'], dict(help="""(int) 页码,起始页码1; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页最大记录数,取值:[10,100],默认:10; """, dest='pageSize', type=int, required=False)), - (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,查询时间跨度不超过30天; """, dest='endTime', required=False)), + (['--task-ids'], dict(help="""(string) 任务ID,批量用,分隔; """, dest='taskIds', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询在线流列表 ''', + help=''' 删除直播拉流转推任务; ''', description=''' - 查询在线流列表。 + 删除直播拉流转推任务; 。 - 示例: jdc live describe-domain-online-stream --domain-name xxx --start-time xxx + 示例: jdc live delete-live-forward-task --task-ids xxx ''', ) - def describe_domain_online_stream(self): + def delete_live_forward_task(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeDomainOnlineStreamRequest import DescribeDomainOnlineStreamRequest + from jdcloud_sdk.services.live.apis.DeleteLiveForwardTaskRequest import DeleteLiveForwardTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDomainOnlineStreamRequest(params_dict, headers) + req = DeleteLiveForwardTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2016,32 +2098,31 @@ def describe_domain_online_stream(self): @expose( arguments=[ - (['--domains'], dict(help="""(string) 播放域名,多个时以逗号(,)分隔 """, dest='domains', required=True)), - (['--interval'], dict(help="""(string) 时间间隔,取值(hour,day),不传默认小时; - 按小时(hour)下载时是.log文件; - 按天(day)下载时是.zip文件; """, dest='interval', required=False)), - (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间; """, dest='endTime', required=False)), + (['--file-url'], dict(help="""(string) 需要删除的录制文件在oss的url; """, dest='fileUrl', required=True)), + (['--completely'], dict(help="""(bool) 是否深度删除所有的ts文件,仅对.m3u8录制文件生效。默认: true; """, dest='completely', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 日志下载 ''', + help=''' 删除录制文件; ''', description=''' - 日志下载。 + 删除录制文件; 。 - 示例: jdc live describe-domains-log --domains xxx --start-time xxx + 示例: jdc live delete-live-recordings --file-url xxx ''', ) - def describe_domains_log(self): + def delete_live_recordings(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeDomainsLogRequest import DescribeDomainsLogRequest + from jdcloud_sdk.services.live.apis.DeleteLiveRecordingsRequest import DeleteLiveRecordingsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDomainsLogRequest(params_dict, headers) + req = DeleteLiveRecordingsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2051,33 +2132,31 @@ def describe_domains_log(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=True)), - (['--size'], dict(help="""(int) 查询Top数量,默认20,即返回Top20的数据 """, dest='size', type=int, required=False)), - (['--rankfield'], dict(help="""(string) 排行依据字段,取值:["pv", "flow", "bandwidth"],默认pv; - pv 播放次数; - flow 流量; - bandwidth 带宽; """, dest='rankfield', required=False)), - (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间; """, dest='endTime', required=False)), + (['--publish-domain'], dict(help="""(string) 直播的推流域名 """, dest='publishDomain', required=True)), + (['--template'], dict(help="""(string) 翻译模版; - 取值范围: 系统标准翻译模板, 用户自定义翻译模板; - 系统标准翻译模板; system-zh-en (中译英); system-en-zh (英译中); """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询URL播放排行 ''', + help=''' 添加域名翻译配置; - 添加域名级别的翻译模板配置; - 一个域名最多可绑定一个翻译模板; - 重新推流后生效; ''', description=''' - 查询URL播放排行。 + 添加域名翻译配置; - 添加域名级别的翻译模板配置; - 一个域名最多可绑定一个翻译模板; - 重新推流后生效; 。 - 示例: jdc live describe-url-ranking --domain-name xxx --start-time xxx + 示例: jdc live add-live-stream-domain-translate --publish-domain xxx --template xxx ''', ) - def describe_url_ranking(self): + def add_live_stream_domain_translate(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeUrlRankingRequest import DescribeUrlRankingRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamDomainTranslateRequest import AddLiveStreamDomainTranslateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeUrlRankingRequest(params_dict, headers) + req = AddLiveStreamDomainTranslateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2087,32 +2166,32 @@ def describe_url_ranking(self): @expose( arguments=[ - (['--grade'], dict(help="""(string) 码率档次,可以查询指定档次的转码时长,取值:; - video_h264_4k_1; - video_h264_2k_1; - video_h264_shd_1; - video_h264_hd_1; - video_h264_sd_1; - video_h265_4k_1; - video_h265_2k_1; - video_h265_shd_1; - video_h265_hd_1; - video_h265_sd_1; """, dest='grade', required=False)), - (['--period'], dict(help="""(string) 查询周期,取值范围:“day,month,year,followTime”,分别表示1天,1月,1年,跟随时间。默认为空,表示day。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--template'], dict(help="""(string) 翻译模版; - 取值范围: 系统标准翻译模板, 用户自定义翻译模板; - 系统标准翻译模板; system-zh-en (中译英); system-en-zh (英译中); """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询转码时长数据 ''', + help=''' 添加应用翻译配置; - 添加应用级别的翻译模板配置; - 一个应用最多可绑定一个翻译模板; - 重新推流后生效; ''', description=''' - 查询转码时长数据。 + 添加应用翻译配置; - 添加应用级别的翻译模板配置; - 一个应用最多可绑定一个翻译模板; - 重新推流后生效; 。 - 示例: jdc live describe-live-transcoding-duration-data --start-time xxx + 示例: jdc live add-live-stream-app-translate --publish-domain xxx --app-name xxx --template xxx ''', ) - def describe_live_transcoding_duration_data(self): + def add_live_stream_app_translate(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveTranscodingDurationDataRequest import DescribeLiveTranscodingDurationDataRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamAppTranslateRequest import AddLiveStreamAppTranslateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveTranscodingDurationDataRequest(params_dict, headers) + req = AddLiveStreamAppTranslateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2122,31 +2201,33 @@ def describe_live_transcoding_duration_data(self): @expose( arguments=[ - (['--period'], dict(help="""(string) 查询周期,取值范围:“day,month,year,followTime”,分别表示1天,1月,1年,跟随时间。默认为空,表示day。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), + (['--template'], dict(help="""(string) 翻译模版; - 取值范围: 系统标准翻译模板, 用户自定义翻译模板; - 系统标准翻译模板; system-zh-en (中译英); system-en-zh (英译中); """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询存储空间数据 ''', + help=''' 添加流翻译配置; - 添加流级别的翻译模板配置; - 一个流最多可绑定一个翻译模板; - 重新推流后生效; ''', description=''' - 查询存储空间数据。 + 添加流翻译配置; - 添加流级别的翻译模板配置; - 一个流最多可绑定一个翻译模板; - 重新推流后生效; 。 - 示例: jdc live describe-live-file-storage-data --start-time xxx + 示例: jdc live add-live-stream-translate --publish-domain xxx --app-name xxx --stream-name xxx --template xxx ''', ) - def describe_live_file_storage_data(self): + def add_live_stream_translate(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveFileStorageDataRequest import DescribeLiveFileStorageDataRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamTranslateRequest import AddLiveStreamTranslateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveFileStorageDataRequest(params_dict, headers) + req = AddLiveStreamTranslateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2156,37 +2237,32 @@ def describe_live_file_storage_data(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 播放域名,可以通过指定域名查询该域名下产生的带宽数据。; """, dest='domainName', required=False)), - (['--app-name'], dict(help="""(string) 推流AppName,将AppName作为查询条件时须指定域名。; """, dest='appName', required=False)), - (['--stream-name'], dict(help="""(string) 流名称,将流名称作为查询条件时须指定域名和AppName。; """, dest='streamName', required=False)), - (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), - (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), - (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), - (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 翻译模板查询过滤条件:; - name: template 翻译模板名称; - value: 如果参数为空,则查询全部; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询带宽数据; - 查询某个时间段内的带宽数据(平均带宽); - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; ''', + help=''' 查询系统默认翻译模板列表; ''', description=''' - 查询带宽数据; - 查询某个时间段内的带宽数据(平均带宽); - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; 。 + 查询系统默认翻译模板列表; 。 - 示例: jdc live describe-live-stream-bandwidth-data --start-time xxx + 示例: jdc live describe-system-live-stream-translate-templates ''', ) - def describe_live_stream_bandwidth_data(self): + def describe_system_live_stream_translate_templates(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamBandwidthDataRequest import DescribeLiveStreamBandwidthDataRequest + from jdcloud_sdk.services.live.apis.DescribeSystemLiveStreamTranslateTemplatesRequest import DescribeSystemLiveStreamTranslateTemplatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamBandwidthDataRequest(params_dict, headers) + req = DescribeSystemLiveStreamTranslateTemplatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2196,37 +2272,32 @@ def describe_live_stream_bandwidth_data(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 推流域名,可以通过指定域名查询该域名下产生的带宽数据。; """, dest='domainName', required=False)), - (['--app-name'], dict(help="""(string) 推流AppName,将AppName作为查询条件时须指定域名。; """, dest='appName', required=False)), - (['--stream-name'], dict(help="""(string) 流名称,将流名称作为查询条件时须指定域名和AppName。; """, dest='streamName', required=False)), - (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), - (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), - (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), - (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 模板配置查询过滤条件:; - name: publishDomain 必填(推流域名); - value: 参数; - name: appName 必填(应用名称); - value: 参数; - name: streamName 非必填(流名称); - value: 参数; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询推流带宽; - 查询某个时间段内的推流上行带宽数据; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; ''', + help=''' 查询翻译模板配置; - 翻译模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效原则; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的翻译模板配置,并非各级的模板绑定情况; ''', description=''' - 查询推流带宽; - 查询某个时间段内的推流上行带宽数据; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; 。 + 查询翻译模板配置; - 翻译模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效原则; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的翻译模板配置,并非各级的模板绑定情况; 。 - 示例: jdc live describe-live-stream-publish-bandwidth-data --start-time xxx + 示例: jdc live describe-live-stream-translate-config ''', ) - def describe_live_stream_publish_bandwidth_data(self): + def describe_live_stream_translate_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamPublishBandwidthDataRequest import DescribeLiveStreamPublishBandwidthDataRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamTranslateConfigRequest import DescribeLiveStreamTranslateConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamPublishBandwidthDataRequest(params_dict, headers) + req = DescribeLiveStreamTranslateConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2236,37 +2307,30 @@ def describe_live_stream_publish_bandwidth_data(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 播放域名,可以通过指定域名查询该域名下产生的带宽数据。; """, dest='domainName', required=False)), - (['--app-name'], dict(help="""(string) 推流AppName,将AppName作为查询条件时须指定域名。; """, dest='appName', required=False)), - (['--stream-name'], dict(help="""(string) 流名称; """, dest='streamName', required=False)), - (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), - (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), - (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), - (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--filters'], dict(help="""(array: filter) 模板配置查询过滤条件:; - name: publishDomain 必填(推流域名); - value: 参数; - name: level 非必填(Level); - value: 参数,取值:domain,app,stream; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询流量数据; - 查询某个时间段内的流量数据。; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; ''', + help=''' 查询域名下的翻译模板配置; ''', description=''' - 查询流量数据; - 查询某个时间段内的流量数据。; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; 。 + 查询域名下的翻译模板配置; 。 - 示例: jdc live describe-live-stream-traffic-data --start-time xxx + 示例: jdc live describe-live-domain-translate-config ''', ) - def describe_live_stream_traffic_data(self): + def describe_live_domain_translate_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamTrafficDataRequest import DescribeLiveStreamTrafficDataRequest + from jdcloud_sdk.services.live.apis.DescribeLiveDomainTranslateConfigRequest import DescribeLiveDomainTranslateConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamTrafficDataRequest(params_dict, headers) + req = DescribeLiveDomainTranslateConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2276,37 +2340,31 @@ def describe_live_stream_traffic_data(self): @expose( arguments=[ - (['--domain-name'], dict(help="""(string) 推流域名,可以通过指定域名查询该域名下产生的带宽数据。; """, dest='domainName', required=False)), - (['--app-name'], dict(help="""(string) 推流AppName,将AppName作为查询条件时须指定域名。; """, dest='appName', required=False)), - (['--stream-name'], dict(help="""(string) 流名称; """, dest='streamName', required=False)), - (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), - (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), - (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), - (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), - (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--template'], dict(help="""(string) 翻译模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询推流上行流量数据; - 查询某个时间段内的流量数据。; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; ''', + help=''' 删除域名的翻译模板配置; - 删除域名级别翻译模板配置,重新推流后生效; ''', description=''' - 查询推流上行流量数据; - 查询某个时间段内的流量数据。; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; 。 + 删除域名的翻译模板配置; - 删除域名级别翻译模板配置,重新推流后生效; 。 - 示例: jdc live describe-live-stream-publish-traffic-data --start-time xxx + 示例: jdc live delete-live-stream-domain-translate --publish-domain xxx --template xxx ''', ) - def describe_live_stream_publish_traffic_data(self): + def delete_live_stream_domain_translate(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamPublishTrafficDataRequest import DescribeLiveStreamPublishTrafficDataRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamDomainTranslateRequest import DeleteLiveStreamDomainTranslateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamPublishTrafficDataRequest(params_dict, headers) + req = DeleteLiveStreamDomainTranslateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2316,33 +2374,32 @@ def describe_live_stream_publish_traffic_data(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=False)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), - (['--start-time'], dict(help="""(string) 起始时间:; - UTC时间; 格式: yyyy-MM-dd'T'HH:mm:ss'Z'; 示例: 2018-10-21T10:00:00Z; - 支持最大查询90天以内的数据; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式: yyyy-MM-dd'T'HH:mm:ss'Z'; 示例: 2018-10-21T10:00:00Z; - 为空,默认当前时间; """, dest='endTime', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--template'], dict(help="""(string) 翻译模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播截图张数数据 ''', + help=''' 删除应用的翻译模板配置; - 删除应用级别的翻译模板配置,重新推流后生效; ''', description=''' - 查询直播截图张数数据。 + 删除应用的翻译模板配置; - 删除应用级别的翻译模板配置,重新推流后生效; 。 - 示例: jdc live describe-live-snapshot-data --start-time xxx + 示例: jdc live delete-live-stream-app-translate --publish-domain xxx --app-name xxx --template xxx ''', ) - def describe_live_snapshot_data(self): + def delete_live_stream_app_translate(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveSnapshotDataRequest import DescribeLiveSnapshotDataRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamAppTranslateRequest import DeleteLiveStreamAppTranslateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveSnapshotDataRequest(params_dict, headers) + req = DeleteLiveStreamAppTranslateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2352,33 +2409,33 @@ def describe_live_snapshot_data(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=False)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), - (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 支持最大查询90天以内的数据; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间; """, dest='endTime', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), + (['--template'], dict(help="""(string) 翻译模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播鉴黄张数数据 ''', + help=''' 删除流的翻译模板配置; - 删除流级别翻译模板配置,重新推流后生效; ''', description=''' - 查询直播鉴黄张数数据。 + 删除流的翻译模板配置; - 删除流级别翻译模板配置,重新推流后生效; 。 - 示例: jdc live describe-live-porn-data --start-time xxx + 示例: jdc live delete-live-stream-translate --publish-domain xxx --app-name xxx --stream-name xxx --template xxx ''', ) - def describe_live_porn_data(self): + def delete_live_stream_translate(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLivePornDataRequest import DescribeLivePornDataRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamTranslateRequest import DeleteLiveStreamTranslateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLivePornDataRequest(params_dict, headers) + req = DeleteLiveStreamTranslateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2388,37 +2445,30 @@ def describe_live_porn_data(self): @expose( arguments=[ - (['--format'], dict(help="""(string) 截图格式; - 取值: jpg, png; - 不区分大小写; """, dest='format', required=True)), - (['--width'], dict(help="""(int) 截图宽度; - 取值: [8,8192]; - 如果(width,height)只设置其中之一,则按所设置参数项等比缩放另一项输出截图; - 如果(width,height)都不设置,则按源流大小输出截图; """, dest='width', type=int, required=False)), - (['--height'], dict(help="""(int) 截图高度; - 取值: [8,8192]; - 如果(width,height)只设置其中之一,则按所设置参数项等比缩放另一项输出截图; - 如果(width,height)都不设置,则按源流大小输出截图; """, dest='height', type=int, required=False)), - (['--fill-type'], dict(help="""(int) 截图与设定的宽高不匹配时的处理规则; 1: 拉伸; 2: 留黑; 3: 留白; 4: 高斯模糊; - 1是按照设定宽高拉伸; - 2,3,4是等比例的缩放多余或不足处按调置处理; """, dest='fillType', type=int, required=True)), - (['--snapshot-interval'], dict(help="""(int) 截图周期; - 取值范围 [5,3600]; - 单位: 秒; """, dest='snapshotInterval', type=int, required=True)), - (['--save-mode'], dict(help="""(int) 存储模式; 1: 覆盖存储; 2: 顺序存储; """, dest='saveMode', type=int, required=True)), - (['--save-bucket'], dict(help="""(string) 存储桶 """, dest='saveBucket', required=True)), - (['--save-endpoint'], dict(help="""(string) 存储地址 """, dest='saveEndpoint', required=False)), - (['--template'], dict(help="""(string) 截图模板自定义名称:; - 取值要求: 数字、大小写字母或短横线("-")、下划线("_"),; 首尾不能有特殊字符("-"); 最大长度50个字符; - 注意: 不能与已定义命名重复; """, dest='template', required=True)), + (['--template'], dict(help="""(string) 翻译模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加直播截图模板 ''', + help=''' 查询翻译模板绑定; ''', description=''' - 添加直播截图模板。 + 查询翻译模板绑定; 。 - 示例: jdc live add-custom-live-stream-snapshot-template --format xxx --fill-type 0 --snapshot-interval 0 --save-mode 0 --save-bucket xxx --template xxx + 示例: jdc live describe-translate-binding --template xxx ''', ) - def add_custom_live_stream_snapshot_template(self): + def describe_translate_binding(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddCustomLiveStreamSnapshotTemplateRequest import AddCustomLiveStreamSnapshotTemplateRequest + from jdcloud_sdk.services.live.apis.DescribeTranslateBindingRequest import DescribeTranslateBindingRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddCustomLiveStreamSnapshotTemplateRequest(params_dict, headers) + req = DescribeTranslateBindingRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2428,31 +2478,32 @@ def add_custom_live_stream_snapshot_template(self): @expose( arguments=[ - (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 直播截图查询过滤条件:; - name: publishDomain 必填(推流域名); - value: 参数; - name: appName 必填(应用名称); - value: 参数; - name: streamName 非必填(流名称); - value: 参数; """, dest='filters', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) APP名 """, dest='appName', required=True)), + (['--stream-name'], dict(help="""(string) 流名 """, dest='streamName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播截图配置; - 截图模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的截图模板配置,并非各级的模板绑定情况; ''', + help=''' 暂停指定流的翻译任务; - 暂停添加实时翻译字幕到指定流; - 指定的流需在线且配置了翻译模板; ''', description=''' - 查询直播截图配置; - 截图模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的截图模板配置,并非各级的模板绑定情况; 。 + 暂停指定流的翻译任务; - 暂停添加实时翻译字幕到指定流; - 指定的流需在线且配置了翻译模板; 。 - 示例: jdc live describe-custom-live-stream-snapshot-config + 示例: jdc live pause-live-stream-translate --publish-domain xxx --app-name xxx --stream-name xxx ''', ) - def describe_custom_live_stream_snapshot_config(self): + def pause_live_stream_translate(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamSnapshotConfigRequest import DescribeCustomLiveStreamSnapshotConfigRequest + from jdcloud_sdk.services.live.apis.PauseLiveStreamTranslateRequest import PauseLiveStreamTranslateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCustomLiveStreamSnapshotConfigRequest(params_dict, headers) + req = PauseLiveStreamTranslateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2462,31 +2513,32 @@ def describe_custom_live_stream_snapshot_config(self): @expose( arguments=[ - (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 截图模板查询过滤条件; - name: template 录制模板自定义名称; - value: 如果参数为空,则查询全部; """, dest='filters', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) APP名 """, dest='appName', required=True)), + (['--stream-name'], dict(help="""(string) 流名 """, dest='streamName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播截图模板列表 ''', + help=''' 恢复指定流的翻译任务; - 恢复添加实时翻译字幕到指定流; - 指定的流需在线且配置了翻译模板,同时处于翻译暂停状态; ''', description=''' - 查询直播截图模板列表。 + 恢复指定流的翻译任务; - 恢复添加实时翻译字幕到指定流; - 指定的流需在线且配置了翻译模板,同时处于翻译暂停状态; 。 - 示例: jdc live describe-custom-live-stream-snapshot-templates + 示例: jdc live resume-live-stream-translate --publish-domain xxx --app-name xxx --stream-name xxx ''', ) - def describe_custom_live_stream_snapshot_templates(self): + def resume_live_stream_translate(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamSnapshotTemplatesRequest import DescribeCustomLiveStreamSnapshotTemplatesRequest + from jdcloud_sdk.services.live.apis.ResumeLiveStreamTranslateRequest import ResumeLiveStreamTranslateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCustomLiveStreamSnapshotTemplatesRequest(params_dict, headers) + req = ResumeLiveStreamTranslateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2498,29 +2550,31 @@ def describe_custom_live_stream_snapshot_templates(self): arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--template'], dict(help="""(string) 截图模板; """, dest='template', required=True)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), + (['--forbid-time'], dict(help="""(int) 禁流时长,单位:s 0表示永久禁流;大于0为限时禁流,超过时长自动解禁 """, dest='forbidTime', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加应用截图配置; - 添加应用级别的截图模板配置; ''', + help=''' 禁止直播流推送 ''', description=''' - 添加应用截图配置; - 添加应用级别的截图模板配置; 。 + 禁止直播流推送。 - 示例: jdc live add-live-stream-app-snapshot --publish-domain xxx --app-name xxx --template xxx + 示例: jdc live forbid-live-stream --publish-domain xxx --app-name xxx --stream-name xxx ''', ) - def add_live_stream_app_snapshot(self): + def forbid_live_stream(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveStreamAppSnapshotRequest import AddLiveStreamAppSnapshotRequest + from jdcloud_sdk.services.live.apis.ForbidLiveStreamRequest import ForbidLiveStreamRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveStreamAppSnapshotRequest(params_dict, headers) + req = ForbidLiveStreamRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2531,29 +2585,31 @@ def add_live_stream_app_snapshot(self): @expose( arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--template'], dict(help="""(string) 截图模板; """, dest='template', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加域名截图配置; - 添加域名级别的截图模板配置; ''', + help=''' 恢复直播流推送 ''', description=''' - 添加域名截图配置; - 添加域名级别的截图模板配置; 。 + 恢复直播流推送。 - 示例: jdc live add-live-stream-domain-snapshot --publish-domain xxx --template xxx + 示例: jdc live resume-live-stream --publish-domain xxx --app-name xxx --stream-name xxx ''', ) - def add_live_stream_domain_snapshot(self): + def resume_live_stream(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveStreamDomainSnapshotRequest import AddLiveStreamDomainSnapshotRequest + from jdcloud_sdk.services.live.apis.ResumeLiveStreamRequest import ResumeLiveStreamRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveStreamDomainSnapshotRequest(params_dict, headers) + req = ResumeLiveStreamRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2564,29 +2620,31 @@ def add_live_stream_domain_snapshot(self): @expose( arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--notify-url'], dict(help="""(string) 截图回调通知的URL地址:; - 以 http:// 开头,外网可访问的地址; """, dest='notifyUrl', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置直播截图回调通知地址; ''', + help=''' 中断直播流推送; - 中断操作1秒后可以继续推流; ''', description=''' - 设置直播截图回调通知地址; 。 + 中断直播流推送; - 中断操作1秒后可以继续推流; 。 - 示例: jdc live set-live-stream-snapshot-notify-config --publish-domain xxx --notify-url xxx + 示例: jdc live interrupt-live-stream --publish-domain xxx --app-name xxx --stream-name xxx ''', ) - def set_live_stream_snapshot_notify_config(self): + def interrupt_live_stream(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.SetLiveStreamSnapshotNotifyConfigRequest import SetLiveStreamSnapshotNotifyConfigRequest + from jdcloud_sdk.services.live.apis.InterruptLiveStreamRequest import InterruptLiveStreamRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLiveStreamSnapshotNotifyConfigRequest(params_dict, headers) + req = InterruptLiveStreamRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2596,29 +2654,32 @@ def set_live_stream_snapshot_notify_config(self): @expose( arguments=[ - (['--template'], dict(help="""(string) 截图模板 """, dest='template', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除用户自定义直播截图模板; - 删除截图模板前,请先删除此模板相关的截图配置,否则将会影响线上业务; ''', + help=''' 查询直播实时流信息; ''', description=''' - 删除用户自定义直播截图模板; - 删除截图模板前,请先删除此模板相关的截图配置,否则将会影响线上业务; 。 + 查询直播实时流信息; 。 - 示例: jdc live delete-custom-live-stream-snapshot-template --template xxx + 示例: jdc live describe-live-stream-info --publish-domain xxx --app-name xxx --stream-name xxx ''', ) - def delete_custom_live_stream_snapshot_template(self): + def describe_live_stream_info(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteCustomLiveStreamSnapshotTemplateRequest import DeleteCustomLiveStreamSnapshotTemplateRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamInfoRequest import DescribeLiveStreamInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteCustomLiveStreamSnapshotTemplateRequest(params_dict, headers) + req = DescribeLiveStreamInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2629,30 +2690,30 @@ def delete_custom_live_stream_snapshot_template(self): @expose( arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--template'], dict(help="""(string) 截图模板; """, dest='template', required=True)), + (['--notify-url'], dict(help="""(string) 直播流状态回调地址; - 必须以 http:// 开头; """, dest='notifyUrl', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除APP截图配置 ''', + help=''' 设置直播流状态回调地址 ''', description=''' - 删除APP截图配置。 + 设置直播流状态回调地址。 - 示例: jdc live delete-live-stream-app-snapshot --publish-domain xxx --app-name xxx --template xxx + 示例: jdc live set-live-stream-notify-config --publish-domain xxx --notify-url xxx ''', ) - def delete_live_stream_app_snapshot(self): + def set_live_stream_notify_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamAppSnapshotRequest import DeleteLiveStreamAppSnapshotRequest + from jdcloud_sdk.services.live.apis.SetLiveStreamNotifyConfigRequest import SetLiveStreamNotifyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamAppSnapshotRequest(params_dict, headers) + req = SetLiveStreamNotifyConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2663,29 +2724,29 @@ def delete_live_stream_app_snapshot(self): @expose( arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--template'], dict(help="""(string) 截图模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除域名截图配置; - 删除域名级别的截图模板配置,重新推流后生效; ''', + help=''' 查询直播流状态回调地址 ''', description=''' - 删除域名截图配置; - 删除域名级别的截图模板配置,重新推流后生效; 。 + 查询直播流状态回调地址。 - 示例: jdc live delete-live-stream-domain-snapshot --publish-domain xxx --template xxx + 示例: jdc live describe-live-stream-notify-config --publish-domain xxx ''', ) - def delete_live_stream_domain_snapshot(self): + def describe_live_stream_notify_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamDomainSnapshotRequest import DeleteLiveStreamDomainSnapshotRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamNotifyConfigRequest import DescribeLiveStreamNotifyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamDomainSnapshotRequest(params_dict, headers) + req = DescribeLiveStreamNotifyConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2697,27 +2758,28 @@ def delete_live_stream_domain_snapshot(self): arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询截图回调配置; ''', + help=''' 删除直播流状态回调地址 ''', description=''' - 查询截图回调配置; 。 + 删除直播流状态回调地址。 - 示例: jdc live describe-live-stream-snapshot-notify-config --publish-domain xxx + 示例: jdc live delete-live-stream-notify-config --publish-domain xxx ''', ) - def describe_live_stream_snapshot_notify_config(self): + def delete_live_stream_notify_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamSnapshotNotifyConfigRequest import DescribeLiveStreamSnapshotNotifyConfigRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamNotifyConfigRequest import DeleteLiveStreamNotifyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamSnapshotNotifyConfigRequest(params_dict, headers) + req = DeleteLiveStreamNotifyConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2728,28 +2790,32 @@ def describe_live_stream_snapshot_notify_config(self): @expose( arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围[1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除截图回调配置; ''', + help=''' 查询直播中的流的信息 ''', description=''' - 删除截图回调配置; 。 + 查询直播中的流的信息。 - 示例: jdc live delete-live-stream-snapshot-notify-config --publish-domain xxx + 示例: jdc live describe-live-stream-online-list --publish-domain xxx ''', ) - def delete_live_stream_snapshot_notify_config(self): + def describe_live_stream_online_list(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamSnapshotNotifyConfigRequest import DeleteLiveStreamSnapshotNotifyConfigRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamOnlineListRequest import DescribeLiveStreamOnlineListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamSnapshotNotifyConfigRequest(params_dict, headers) + req = DescribeLiveStreamOnlineListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2759,29 +2825,36 @@ def delete_live_stream_snapshot_notify_config(self): @expose( arguments=[ - (['--template'], dict(help="""(string) 截图模板 """, dest='template', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--page-num'], dict(help="""(int) 页码
; - 取值范围[1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小
; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), + (['--start-time'], dict(help="""(string) 推流起始时间
; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 最大支持最近30天内的流历史查询; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 推流结束时间
; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 最大支持最近30天内的流历史查询; - 结束时间为空默认为当前时间; """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询截图模板绑定; ''', + help=''' 查看推流历史记录 ''', description=''' - 查询截图模板绑定; 。 + 查看推流历史记录。 - 示例: jdc live describe-snapshot-binding --template xxx + 示例: jdc live describe-live-stream-publish-list --publish-domain xxx --start-time xxx ''', ) - def describe_snapshot_binding(self): + def describe_live_stream_publish_list(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeSnapshotBindingRequest import DescribeSnapshotBindingRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamPublishListRequest import DescribeLiveStreamPublishListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSnapshotBindingRequest(params_dict, headers) + req = DescribeLiveStreamPublishListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2791,32 +2864,30 @@ def describe_snapshot_binding(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), - (['--forbid-time'], dict(help="""(int) 禁流时长,单位:s 0表示永久禁流;大于0为限时禁流,超过时长自动解禁 """, dest='forbidTime', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 传参字段描述:; startTime(必填) : 2019-08-21T16:15:10Z; endTime(必填) : 2019-08-21T18:10:10Z; billType(非必填) :; enum:; - 1 (online); - 2 (offline); userPin(非必填) : mt_test; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 禁止直播流推送 ''', + help=''' 查询直播计费账单用量数据; 允许通过条件过滤查询,支持的过滤字段如下:; - startTime[eq] 账单开始时间; - endTime[eq] 账单结束时间; - billType[eq] 账单计费类型; - userPin[like] 用户PIN; ''', description=''' - 禁止直播流推送。 + 查询直播计费账单用量数据; 允许通过条件过滤查询,支持的过滤字段如下:; - startTime[eq] 账单开始时间; - endTime[eq] 账单结束时间; - billType[eq] 账单计费类型; - userPin[like] 用户PIN; 。 - 示例: jdc live forbid-live-stream --publish-domain xxx --app-name xxx --stream-name xxx + 示例: jdc live describe-live-bill-data ''', ) - def forbid_live_stream(self): + def describe_live_bill_data(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.ForbidLiveStreamRequest import ForbidLiveStreamRequest + from jdcloud_sdk.services.live.apis.DescribeLiveBillDataRequest import DescribeLiveBillDataRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ForbidLiveStreamRequest(params_dict, headers) + req = DescribeLiveBillDataRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2826,31 +2897,30 @@ def forbid_live_stream(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), + (['--restart-domain'], dict(help="""(string) 回看的播放域名 """, dest='restartDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 恢复直播流推送 ''', + help=''' 开启回看; 1、直播回看文件格式仅支持m3u8。; 2、回看时长用户可以配置,最大支持7天,即用户请求回看内容,最多可以请求最近7天的直播回看内容。; 3、域名格式:http://{restartDomain}/{appName}/{streamName}/index.m3u8?starttime=1527756680&endtime=1527760280 (unix时间戳); 4、starttime-endtime最长可支持24小时,可跨天; ''', description=''' - 恢复直播流推送。 + 开启回看; 1、直播回看文件格式仅支持m3u8。; 2、回看时长用户可以配置,最大支持7天,即用户请求回看内容,最多可以请求最近7天的直播回看内容。; 3、域名格式:http://{restartDomain}/{appName}/{streamName}/index.m3u8?starttime=1527756680&endtime=1527760280 (unix时间戳); 4、starttime-endtime最长可支持24小时,可跨天; 。 - 示例: jdc live resume-live-stream --publish-domain xxx --app-name xxx --stream-name xxx + 示例: jdc live open-live-restart --restart-domain xxx ''', ) - def resume_live_stream(self): + def open_live_restart(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.ResumeLiveStreamRequest import ResumeLiveStreamRequest + from jdcloud_sdk.services.live.apis.OpenLiveRestartRequest import OpenLiveRestartRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ResumeLiveStreamRequest(params_dict, headers) + req = OpenLiveRestartRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2860,31 +2930,30 @@ def resume_live_stream(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), + (['--restart-domain'], dict(help="""(string) 回看的播放域名 """, dest='restartDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 中断直播流推送; - 中断操作1秒后可以继续推流; ''', + help=''' 关闭回看 ''', description=''' - 中断直播流推送; - 中断操作1秒后可以继续推流; 。 + 关闭回看。 - 示例: jdc live interrupt-live-stream --publish-domain xxx --app-name xxx --stream-name xxx + 示例: jdc live close-live-restart --restart-domain xxx ''', ) - def interrupt_live_stream(self): + def close_live_restart(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.InterruptLiveStreamRequest import InterruptLiveStreamRequest + from jdcloud_sdk.services.live.apis.CloseLiveRestartRequest import CloseLiveRestartRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = InterruptLiveStreamRequest(params_dict, headers) + req = CloseLiveRestartRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2894,31 +2963,32 @@ def interrupt_live_stream(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), + (['--page-num'], dict(help="""(int) 页码;默认为1;取值范围[1, 100000] """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--restart-domain'], dict(help="""(string) 回看的推流域名 """, dest='restartDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播实时流信息; ''', + help=''' 查询回看配置 ''', description=''' - 查询直播实时流信息; 。 + 查询回看配置。 - 示例: jdc live describe-live-stream-info --publish-domain xxx --app-name xxx --stream-name xxx + 示例: jdc live describe-live-restart-configs --restart-domain xxx ''', ) - def describe_live_stream_info(self): + def describe_live_restart_configs(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamInfoRequest import DescribeLiveStreamInfoRequest + from jdcloud_sdk.services.live.apis.DescribeLiveRestartConfigsRequest import DescribeLiveRestartConfigsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamInfoRequest(params_dict, headers) + req = DescribeLiveRestartConfigsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2928,30 +2998,30 @@ def describe_live_stream_info(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--notify-url'], dict(help="""(string) 直播流状态回调地址; - 必须以 http:// 开头; """, dest='notifyUrl', required=True)), + (['--play-domain'], dict(help="""(string) 播放域名 """, dest='playDomain', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置直播流状态回调地址 ''', + help=''' 开启P2P; ''', description=''' - 设置直播流状态回调地址。 + 开启P2P; 。 - 示例: jdc live set-live-stream-notify-config --publish-domain xxx --notify-url xxx + 示例: jdc live open-live-p2p ''', ) - def set_live_stream_notify_config(self): + def open_live_p2p(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.SetLiveStreamNotifyConfigRequest import SetLiveStreamNotifyConfigRequest + from jdcloud_sdk.services.live.apis.OpenLiveP2pRequest import OpenLiveP2pRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetLiveStreamNotifyConfigRequest(params_dict, headers) + req = OpenLiveP2pRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2961,29 +3031,30 @@ def set_live_stream_notify_config(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--play-domain'], dict(help="""(string) 播放域名 """, dest='playDomain', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播流状态回调地址 ''', + help=''' 关闭P2P ''', description=''' - 查询直播流状态回调地址。 + 关闭P2P。 - 示例: jdc live describe-live-stream-notify-config --publish-domain xxx + 示例: jdc live close-live-p2p ''', ) - def describe_live_stream_notify_config(self): + def close_live_p2p(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamNotifyConfigRequest import DescribeLiveStreamNotifyConfigRequest + from jdcloud_sdk.services.live.apis.CloseLiveP2pRequest import CloseLiveP2pRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamNotifyConfigRequest(params_dict, headers) + req = CloseLiveP2pRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2993,29 +3064,32 @@ def describe_live_stream_notify_config(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--page-number'], dict(help="""(int) 页码; - 取值范围[1, 100000]; """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), + (['--play-domain'], dict(help="""(string) 直播的播放域名; - 目前仅支持精确匹配; """, dest='playDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除直播流状态回调地址 ''', + help=''' 查询P2P配置 ''', description=''' - 删除直播流状态回调地址。 + 查询P2P配置。 - 示例: jdc live delete-live-stream-notify-config --publish-domain xxx + 示例: jdc live describe-live-p2p-configs --play-domain xxx ''', ) - def delete_live_stream_notify_config(self): + def describe_live_p2p_configs(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamNotifyConfigRequest import DeleteLiveStreamNotifyConfigRequest + from jdcloud_sdk.services.live.apis.DescribeLiveP2pConfigsRequest import DescribeLiveP2pConfigsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamNotifyConfigRequest(params_dict, headers) + req = DescribeLiveP2pConfigsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3025,32 +3099,38 @@ def delete_live_stream_notify_config(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--page-num'], dict(help="""(int) 页码; - 取值范围[1, 100000]; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), + (['--format'], dict(help="""(string) 截图格式; - 取值: jpg, png; - 不区分大小写; """, dest='format', required=True)), + (['--width'], dict(help="""(int) 截图宽度; - 取值: [8,8192]; - 如果(width,height)只设置其中之一,则按所设置参数项等比缩放另一项输出截图; - 如果(width,height)都不设置,则按源流大小输出截图; """, dest='width', type=int, required=False)), + (['--height'], dict(help="""(int) 截图高度; - 取值: [8,8192]; - 如果(width,height)只设置其中之一,则按所设置参数项等比缩放另一项输出截图; - 如果(width,height)都不设置,则按源流大小输出截图; """, dest='height', type=int, required=False)), + (['--fill-type'], dict(help="""(int) 截图与设定的宽高不匹配时的处理规则; 1: 拉伸; 2: 留黑; 3: 留白; 4: 高斯模糊; - 1是按照设定宽高拉伸; - 2,3,4是等比例的缩放多余或不足处按调置处理; """, dest='fillType', type=int, required=True)), + (['--snapshot-interval'], dict(help="""(int) 截图周期; - 取值范围 [5,3600]; - 单位: 秒; """, dest='snapshotInterval', type=int, required=True)), + (['--save-mode'], dict(help="""(int) 存储模式; 1: 覆盖存储; 2: 顺序存储; """, dest='saveMode', type=int, required=True)), + (['--save-bucket'], dict(help="""(string) 存储桶 """, dest='saveBucket', required=True)), + (['--save-endpoint'], dict(help="""(string) 存储地址 """, dest='saveEndpoint', required=False)), + (['--template'], dict(help="""(string) 截图模板自定义名称:; - 取值要求: 数字、大小写字母或短横线("-")、下划线("_"),; 首尾不能有特殊字符("-"); 最大长度50个字符; - 注意: 不能与已定义命名重复; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播中的流的信息 ''', + help=''' 添加直播截图模板 ''', description=''' - 查询直播中的流的信息。 + 添加直播截图模板。 - 示例: jdc live describe-live-stream-online-list --publish-domain xxx + 示例: jdc live add-custom-live-stream-snapshot-template --format xxx --fill-type 5 --snapshot-interval 5 --save-mode 5 --save-bucket xxx --template xxx ''', ) - def describe_live_stream_online_list(self): + def add_custom_live_stream_snapshot_template(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamOnlineListRequest import DescribeLiveStreamOnlineListRequest + from jdcloud_sdk.services.live.apis.AddCustomLiveStreamSnapshotTemplateRequest import AddCustomLiveStreamSnapshotTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamOnlineListRequest(params_dict, headers) + req = AddCustomLiveStreamSnapshotTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3060,35 +3140,32 @@ def describe_live_stream_online_list(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--page-num'], dict(help="""(int) 页码
; - 取值范围[1, 100000]; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小
; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), - (['--start-time'], dict(help="""(string) 推流起始时间
; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 最大支持最近30天内的流历史查询; """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 推流结束时间
; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 最大支持最近30天内的流历史查询; - 结束时间为空默认为当前时间; """, dest='endTime', required=False)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 直播截图查询过滤条件:; - name: publishDomain 必填(推流域名); - value: 参数; - name: appName 必填(应用名称); - value: 参数; - name: streamName 非必填(流名称); - value: 参数; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看推流历史记录 ''', + help=''' 查询直播截图配置; - 截图模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的截图模板配置,并非各级的模板绑定情况; ''', description=''' - 查看推流历史记录。 + 查询直播截图配置; - 截图模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的截图模板配置,并非各级的模板绑定情况; 。 - 示例: jdc live describe-live-stream-publish-list --publish-domain xxx --start-time xxx + 示例: jdc live describe-custom-live-stream-snapshot-config ''', ) - def describe_live_stream_publish_list(self): + def describe_custom_live_stream_snapshot_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamPublishListRequest import DescribeLiveStreamPublishListRequest + from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamSnapshotConfigRequest import DescribeCustomLiveStreamSnapshotConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamPublishListRequest(params_dict, headers) + req = DescribeCustomLiveStreamSnapshotConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3098,29 +3175,32 @@ def describe_live_stream_publish_list(self): @expose( arguments=[ - (['--restart-domain'], dict(help="""(string) 回看的播放域名 """, dest='restartDomain', required=True)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 截图模板查询过滤条件; - name: template 录制模板自定义名称; - value: 如果参数为空,则查询全部; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启回看; 1、直播回看文件格式仅支持m3u8。; 2、回看时长用户可以配置,最大支持7天,即用户请求回看内容,最多可以请求最近7天的直播回看内容。; 3、域名格式:http://{restartDomain}/{appName}/{streamName}/index.m3u8?starttime=1527756680&endtime=1527760280 (unix时间戳); 4、starttime-endtime最长可支持24小时,可跨天; ''', + help=''' 查询直播截图模板列表 ''', description=''' - 开启回看; 1、直播回看文件格式仅支持m3u8。; 2、回看时长用户可以配置,最大支持7天,即用户请求回看内容,最多可以请求最近7天的直播回看内容。; 3、域名格式:http://{restartDomain}/{appName}/{streamName}/index.m3u8?starttime=1527756680&endtime=1527760280 (unix时间戳); 4、starttime-endtime最长可支持24小时,可跨天; 。 + 查询直播截图模板列表。 - 示例: jdc live open-live-restart --restart-domain xxx + 示例: jdc live describe-custom-live-stream-snapshot-templates ''', ) - def open_live_restart(self): + def describe_custom_live_stream_snapshot_templates(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.OpenLiveRestartRequest import OpenLiveRestartRequest + from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamSnapshotTemplatesRequest import DescribeCustomLiveStreamSnapshotTemplatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = OpenLiveRestartRequest(params_dict, headers) + req = DescribeCustomLiveStreamSnapshotTemplatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3130,29 +3210,32 @@ def open_live_restart(self): @expose( arguments=[ - (['--restart-domain'], dict(help="""(string) 回看的播放域名 """, dest='restartDomain', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--template'], dict(help="""(string) 截图模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 关闭回看 ''', + help=''' 添加应用截图配置; - 添加应用级别的截图模板配置; ''', description=''' - 关闭回看。 + 添加应用截图配置; - 添加应用级别的截图模板配置; 。 - 示例: jdc live close-live-restart --restart-domain xxx + 示例: jdc live add-live-stream-app-snapshot --publish-domain xxx --app-name xxx --template xxx ''', ) - def close_live_restart(self): + def add_live_stream_app_snapshot(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.CloseLiveRestartRequest import CloseLiveRestartRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamAppSnapshotRequest import AddLiveStreamAppSnapshotRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CloseLiveRestartRequest(params_dict, headers) + req = AddLiveStreamAppSnapshotRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3162,31 +3245,31 @@ def close_live_restart(self): @expose( arguments=[ - (['--page-num'], dict(help="""(int) 页码;默认为1;取值范围[1, 100000] """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--restart-domain'], dict(help="""(string) 回看的推流域名 """, dest='restartDomain', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--template'], dict(help="""(string) 截图模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询回看配置 ''', + help=''' 添加域名截图配置; - 添加域名级别的截图模板配置; ''', description=''' - 查询回看配置。 + 添加域名截图配置; - 添加域名级别的截图模板配置; 。 - 示例: jdc live describe-live-restart-configs --restart-domain xxx + 示例: jdc live add-live-stream-domain-snapshot --publish-domain xxx --template xxx ''', ) - def describe_live_restart_configs(self): + def add_live_stream_domain_snapshot(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveRestartConfigsRequest import DescribeLiveRestartConfigsRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamDomainSnapshotRequest import AddLiveStreamDomainSnapshotRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveRestartConfigsRequest(params_dict, headers) + req = AddLiveStreamDomainSnapshotRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3196,29 +3279,31 @@ def describe_live_restart_configs(self): @expose( arguments=[ - (['--play-domain'], dict(help="""(string) 直播的播放域名 """, dest='playDomain', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--notify-url'], dict(help="""(string) 截图回调通知的URL地址:; - 以 http:// 开头,外网可访问的地址; """, dest='notifyUrl', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启时移; 直播支持最大4小时的HLS时移,使用方式为在播放域名后增加时移参数来实现,参数类型支持指定开始时间和时间偏移量2种方式进行时移。 开启直播时移后,重新推流生效,使用播放域名带相应参数访问即可播放; - 域名格式:; 1、http://{playDomain}/{appName}/{streamName}/index.m3u8?timeshift=400(秒,指从当前时间往前时移的偏移量); 2、http://{playDomain}/{appName}/{streamName}/index.m3u8?starttime=1529223702 (unix时间戳); ''', + help=''' 设置直播截图回调通知地址; ''', description=''' - 开启时移; 直播支持最大4小时的HLS时移,使用方式为在播放域名后增加时移参数来实现,参数类型支持指定开始时间和时间偏移量2种方式进行时移。 开启直播时移后,重新推流生效,使用播放域名带相应参数访问即可播放; - 域名格式:; 1、http://{playDomain}/{appName}/{streamName}/index.m3u8?timeshift=400(秒,指从当前时间往前时移的偏移量); 2、http://{playDomain}/{appName}/{streamName}/index.m3u8?starttime=1529223702 (unix时间戳); 。 + 设置直播截图回调通知地址; 。 - 示例: jdc live open-live-timeshift --play-domain xxx + 示例: jdc live set-live-stream-snapshot-notify-config --publish-domain xxx --notify-url xxx ''', ) - def open_live_timeshift(self): + def set_live_stream_snapshot_notify_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.OpenLiveTimeshiftRequest import OpenLiveTimeshiftRequest + from jdcloud_sdk.services.live.apis.SetLiveStreamSnapshotNotifyConfigRequest import SetLiveStreamSnapshotNotifyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = OpenLiveTimeshiftRequest(params_dict, headers) + req = SetLiveStreamSnapshotNotifyConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3228,29 +3313,30 @@ def open_live_timeshift(self): @expose( arguments=[ - (['--play-domain'], dict(help="""(string) 直播的播放域名 """, dest='playDomain', required=True)), + (['--template'], dict(help="""(string) 截图模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 关闭时移 ''', + help=''' 删除用户自定义直播截图模板; - 删除截图模板前,请先删除此模板相关的截图配置,否则将会影响线上业务; ''', description=''' - 关闭时移。 + 删除用户自定义直播截图模板; - 删除截图模板前,请先删除此模板相关的截图配置,否则将会影响线上业务; 。 - 示例: jdc live close-live-timeshift --play-domain xxx + 示例: jdc live delete-custom-live-stream-snapshot-template --template xxx ''', ) - def close_live_timeshift(self): + def delete_custom_live_stream_snapshot_template(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.CloseLiveTimeshiftRequest import CloseLiveTimeshiftRequest + from jdcloud_sdk.services.live.apis.DeleteCustomLiveStreamSnapshotTemplateRequest import DeleteCustomLiveStreamSnapshotTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CloseLiveTimeshiftRequest(params_dict, headers) + req = DeleteCustomLiveStreamSnapshotTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3260,31 +3346,32 @@ def close_live_timeshift(self): @expose( arguments=[ - (['--page-number'], dict(help="""(int) 页码; - 取值范围[1, 100000]; """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), - (['--play-domain'], dict(help="""(string) 直播的播放域名; - 目前仅支持精确匹配; """, dest='playDomain', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--template'], dict(help="""(string) 截图模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询时移配置 ''', + help=''' 删除APP截图配置 ''', description=''' - 查询时移配置。 + 删除APP截图配置。 - 示例: jdc live describe-live-timeshift-configs --play-domain xxx + 示例: jdc live delete-live-stream-app-snapshot --publish-domain xxx --app-name xxx --template xxx ''', ) - def describe_live_timeshift_configs(self): + def delete_live_stream_app_snapshot(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveTimeshiftConfigsRequest import DescribeLiveTimeshiftConfigsRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamAppSnapshotRequest import DeleteLiveStreamAppSnapshotRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveTimeshiftConfigsRequest(params_dict, headers) + req = DeleteLiveStreamAppSnapshotRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3294,30 +3381,31 @@ def describe_live_timeshift_configs(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 直播的推流域名 """, dest='publishDomain', required=True)), - (['--template'], dict(help="""(string) 转码模版; - 取值范围: 系统标准转码模板, 用户自定义转码模板; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/25f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/25f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); """, dest='template', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--template'], dict(help="""(string) 截图模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加域名级别转码配置; - 添加域名级别的转码模板配置; ''', + help=''' 删除域名截图配置; - 删除域名级别的截图模板配置,重新推流后生效; ''', description=''' - 添加域名级别转码配置; - 添加域名级别的转码模板配置; 。 + 删除域名截图配置; - 删除域名级别的截图模板配置,重新推流后生效; 。 - 示例: jdc live add-live-stream-domain-transcode --publish-domain xxx --template xxx + 示例: jdc live delete-live-stream-domain-snapshot --publish-domain xxx --template xxx ''', ) - def add_live_stream_domain_transcode(self): + def delete_live_stream_domain_snapshot(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveStreamDomainTranscodeRequest import AddLiveStreamDomainTranscodeRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamDomainSnapshotRequest import DeleteLiveStreamDomainSnapshotRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveStreamDomainTranscodeRequest(params_dict, headers) + req = DeleteLiveStreamDomainSnapshotRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3328,30 +3416,29 @@ def add_live_stream_domain_transcode(self): @expose( arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--template'], dict(help="""(string) 转码模版; - 取值范围: 系统标准转码模板, 用户自定义转码模板; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/25f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/25f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加应用转码配置; - 添加应用级别的转码模板配置; ''', + help=''' 查询截图回调配置; ''', description=''' - 添加应用转码配置; - 添加应用级别的转码模板配置; 。 + 查询截图回调配置; 。 - 示例: jdc live add-live-stream-app-transcode --publish-domain xxx --app-name xxx --template xxx + 示例: jdc live describe-live-stream-snapshot-notify-config --publish-domain xxx ''', ) - def add_live_stream_app_transcode(self): + def describe_live_stream_snapshot_notify_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveStreamAppTranscodeRequest import AddLiveStreamAppTranscodeRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamSnapshotNotifyConfigRequest import DescribeLiveStreamSnapshotNotifyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveStreamAppTranscodeRequest(params_dict, headers) + req = DescribeLiveStreamSnapshotNotifyConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3361,42 +3448,30 @@ def add_live_stream_app_transcode(self): @expose( arguments=[ - (['--template-name'], dict(help="""(string) 转码模板名称; - 长度范围:[1,50]; """, dest='templateName', required=False)), - (['--video-codec'], dict(help="""(string) 视频编码格式,取值:h264,h265,默认h264; - h264时,分辨率小于等于1080p; - h265时,分辨率小于等于4k; """, dest='videoCodec', required=False)), - (['--video-code-rate'], dict(help="""(int) 转码输出的码率值; - 取值范围: [128,15000]; - 单位: kpbs; """, dest='videoCodeRate', type=int, required=True)), - (['--video-frame-rate'], dict(help="""(string) 转码输出的帧率值; - 取值:[1,30]; """, dest='videoFrameRate', required=True)), - (['--width'], dict(help="""(int) 转码输出视频宽度; - 取值: [128,4096]; - 如果(width,height)只设置其中之一,则按所设置参数项等比缩放另一项输出转码; - 如果(width,height)都不设置,则按源流大小输出转码; """, dest='width', type=int, required=False)), - (['--height'], dict(help="""(int) 转码输出视频高度; - 取值: [128,4096]; - 如果(width,height)只设置其中之一,则按所设置参数项等比缩放另一项输出转码; - 如果(width,height)都不设置,则按源流大小输出转码; """, dest='height', type=int, required=False)), - (['--template'], dict(help="""(string) 转码模板(转码流输出后缀); - 取值要求:数字、大小写字母或短横线("-"),必须以数字或字母作为开头和结尾,长度不超过50字符; - 注意: 不能与系统的标准的转码模板和当前用户已自定义命名重复; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/25f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/25f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); """, dest='template', required=True)), - (['--audio-codec'], dict(help="""(string) 转码输出音频编码格式; - 取值: aac、mp3; - 不区分大小写; """, dest='audioCodec', required=True)), - (['--audio-format'], dict(help="""(string) 转码输出音频格式; - 取值: aac_lc,aac_low,aac_he,aac_he_v2; 默认:aac_he; - 不区分大小写; """, dest='audioFormat', required=False)), - (['--audio-sample-rate'], dict(help="""(int) 转码输出音频采样率; - 取值: [44100,48000]; """, dest='audioSampleRate', type=int, required=True)), - (['--audio-channel'], dict(help="""(int) 转码输出音频通道数; 1: 单声道; 2: 双声道; """, dest='audioChannel', type=int, required=True)), - (['--audio-code-rate'], dict(help="""(int) 转码输出音频码率; - 取值: [16,128]; - 单位: kbps; """, dest='audioCodeRate', type=int, required=True)), - (['--jdchd'], dict(help="""(string) 京享超清开关; - 取值: jdchd-1.0,off; - 京享超清暂时只支持h.264; """, dest='jdchd', required=False)), - (['--audio-comfort'], dict(help="""(string) 舒适音频; - 取值: on,off; """, dest='audioComfort', required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加自定义转码模板; - 系统为您预设了标准转码模板,如果不能满足您的转码需求,可以通过此接口添加自定义转码模板; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/25f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/25f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); ''', + help=''' 删除截图回调配置; ''', description=''' - 添加自定义转码模板; - 系统为您预设了标准转码模板,如果不能满足您的转码需求,可以通过此接口添加自定义转码模板; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/25f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/25f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); 。 + 删除截图回调配置; 。 - 示例: jdc live add-custom-live-stream-transcode-template --video-code-rate 0 --video-frame-rate xxx --template xxx --audio-codec xxx --audio-sample-rate 0 --audio-channel 0 --audio-code-rate 0 + 示例: jdc live delete-live-stream-snapshot-notify-config --publish-domain xxx ''', ) - def add_custom_live_stream_transcode_template(self): + def delete_live_stream_snapshot_notify_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddCustomLiveStreamTranscodeTemplateRequest import AddCustomLiveStreamTranscodeTemplateRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamSnapshotNotifyConfigRequest import DeleteLiveStreamSnapshotNotifyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddCustomLiveStreamTranscodeTemplateRequest(params_dict, headers) + req = DeleteLiveStreamSnapshotNotifyConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3406,31 +3481,30 @@ def add_custom_live_stream_transcode_template(self): @expose( arguments=[ - (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 转码模板查询过滤条件:; - name: template 转码模板自定义名称; - value: 如果参数为空,则查询全部; - 如果为空,则表示查询该用下所有自定义的转码模板; """, dest='filters', required=False)), + (['--template'], dict(help="""(string) 截图模板 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户自定义转码模板列表; ''', + help=''' 查询截图模板绑定; ''', description=''' - 查询用户自定义转码模板列表; 。 + 查询截图模板绑定; 。 - 示例: jdc live describe-custom-live-stream-transcode-templates + 示例: jdc live describe-snapshot-binding --template xxx ''', ) - def describe_custom_live_stream_transcode_templates(self): + def describe_snapshot_binding(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamTranscodeTemplatesRequest import DescribeCustomLiveStreamTranscodeTemplatesRequest + from jdcloud_sdk.services.live.apis.DescribeSnapshotBindingRequest import DescribeSnapshotBindingRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCustomLiveStreamTranscodeTemplatesRequest(params_dict, headers) + req = DescribeSnapshotBindingRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3440,31 +3514,32 @@ def describe_custom_live_stream_transcode_templates(self): @expose( arguments=[ - (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 转码模板查询过滤条件:; - name: template 转码模板自定义名称; - value: 如果参数为空,则查询全部; - 如果为空,则表示查询该用下所有自定义的转码模板; """, dest='filters', required=False)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围[1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名; - 目前仅支持精确查询; - 为空时,查询用户所有直播域名; """, dest='publishDomain', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询系统默认转码模板列表; ''', + help=''' 查询域名列表 ''', description=''' - 查询系统默认转码模板列表; 。 + 查询域名列表。 - 示例: jdc live describe-system-live-stream-transcode-templates + 示例: jdc live describe-live-domains ''', ) - def describe_system_live_stream_transcode_templates(self): + def describe_live_domains(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeSystemLiveStreamTranscodeTemplatesRequest import DescribeSystemLiveStreamTranscodeTemplatesRequest + from jdcloud_sdk.services.live.apis.DescribeLiveDomainsRequest import DescribeLiveDomainsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSystemLiveStreamTranscodeTemplatesRequest(params_dict, headers) + req = DescribeLiveDomainsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3474,31 +3549,31 @@ def describe_system_live_stream_transcode_templates(self): @expose( arguments=[ - (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 模板配置查询过滤条件:; - name: publishDomain 必填(推流域名); - value: 参数; - name: appName 必填(应用名称); - value: 参数; - name: streamName 非必填(流名称); - value: 参数; """, dest='filters', required=False)), + (['--publish-domain'], dict(help="""(string) 直播的推流域名; - 不支持泛域名; """, dest='publishDomain', required=True)), + (['--play-domain'], dict(help="""(string) 直播的播放域名; - 不支持泛域名; """, dest='playDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询转码模板配置; - 转码模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效原则; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的转码模板配置,并非各级的模板绑定情况; ''', + help=''' 添加直播域名; - 创建直播域名之前,必须先开通直播服务; - 直播域名必须已经备案完成; ''', description=''' - 查询转码模板配置; - 转码模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效原则; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的转码模板配置,并非各级的模板绑定情况; 。 + 添加直播域名; - 创建直播域名之前,必须先开通直播服务; - 直播域名必须已经备案完成; 。 - 示例: jdc live describe-live-stream-transcode-config + 示例: jdc live add-live-domain --publish-domain xxx --play-domain xxx ''', ) - def describe_live_stream_transcode_config(self): + def add_live_domain(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeLiveStreamTranscodeConfigRequest import DescribeLiveStreamTranscodeConfigRequest + from jdcloud_sdk.services.live.apis.AddLiveDomainRequest import AddLiveDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLiveStreamTranscodeConfigRequest(params_dict, headers) + req = AddLiveDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3508,30 +3583,30 @@ def describe_live_stream_transcode_config(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--template'], dict(help="""(string) 转码模板 """, dest='template', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名; - 需要启动的域名对(推流域名,播放域名)中的推流域名; """, dest='publishDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除域名级别转码模板配置; - 删除域名级别转码模板配置,重新推流后生效; ''', + help=''' 启动域名; - 启用状态为 停用 的直播域名对(推流域名,播放域名)将DomainStatus变更为online; ''', description=''' - 删除域名级别转码模板配置; - 删除域名级别转码模板配置,重新推流后生效; 。 + 启动域名; - 启用状态为 停用 的直播域名对(推流域名,播放域名)将DomainStatus变更为online; 。 - 示例: jdc live delete-live-stream-domain-transcode --publish-domain xxx --template xxx + 示例: jdc live start-live-domain --publish-domain xxx ''', ) - def delete_live_stream_domain_transcode(self): + def start_live_domain(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamDomainTranscodeRequest import DeleteLiveStreamDomainTranscodeRequest + from jdcloud_sdk.services.live.apis.StartLiveDomainRequest import StartLiveDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamDomainTranscodeRequest(params_dict, headers) + req = StartLiveDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3541,31 +3616,30 @@ def delete_live_stream_domain_transcode(self): @expose( arguments=[ - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--template'], dict(help="""(string) 转码模板; """, dest='template', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名; - 需要停用的域名对(推流域名,播放域名)中的推流域名; """, dest='publishDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除应用级别转码模板配置; - 删除应用级别的转码模板配置,重新推流后生效; ''', + help=''' 停用域名; - 停用直播域名对(推流域名,播放域名),将DomainStatus变更为offline; - 停用该直播域名对后,直播域名信息仍保留,但用户将不能再用该推流域名推流或播放域名播放; ''', description=''' - 删除应用级别转码模板配置; - 删除应用级别的转码模板配置,重新推流后生效; 。 + 停用域名; - 停用直播域名对(推流域名,播放域名),将DomainStatus变更为offline; - 停用该直播域名对后,直播域名信息仍保留,但用户将不能再用该推流域名推流或播放域名播放; 。 - 示例: jdc live delete-live-stream-app-transcode --publish-domain xxx --app-name xxx --template xxx + 示例: jdc live stop-live-domain --publish-domain xxx ''', ) - def delete_live_stream_app_transcode(self): + def stop_live_domain(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamAppTranscodeRequest import DeleteLiveStreamAppTranscodeRequest + from jdcloud_sdk.services.live.apis.StopLiveDomainRequest import StopLiveDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamAppTranscodeRequest(params_dict, headers) + req = StopLiveDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3575,29 +3649,30 @@ def delete_live_stream_app_transcode(self): @expose( arguments=[ - (['--template'], dict(help="""(string) 转码模板 """, dest='template', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名; - 需要停用的域名对(推流域名,播放域名)中的推流域名; """, dest='publishDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户自定义转码模板详情; - 查询用户自定义转码模板详情; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/24f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/24f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); ''', + help=''' 查询指定域名相关信息 ''', description=''' - 查询用户自定义转码模板详情; - 查询用户自定义转码模板详情; - 系统标准转码模板; ld (h.264/640*360/15f); sd (h.264/960*540/24f); hd (h.264/1280*720/25f); shd (h.264/1920*1080/30f); ld-265 (h.265/640*360/15f); sd-265 (h.265/960*540/24f); hd-265 (h.265/1280*720/25f); shd-265 (h.265/1920*1080/30f); 。 + 查询指定域名相关信息。 - 示例: jdc live describe-custom-live-stream-transcode-template --template xxx + 示例: jdc live describe-live-domain-detail --publish-domain xxx ''', ) - def describe_custom_live_stream_transcode_template(self): + def describe_live_domain_detail(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamTranscodeTemplateRequest import DescribeCustomLiveStreamTranscodeTemplateRequest + from jdcloud_sdk.services.live.apis.DescribeLiveDomainDetailRequest import DescribeLiveDomainDetailRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCustomLiveStreamTranscodeTemplateRequest(params_dict, headers) + req = DescribeLiveDomainDetailRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3607,29 +3682,30 @@ def describe_custom_live_stream_transcode_template(self): @expose( arguments=[ - (['--template'], dict(help="""(string) 转码模板; """, dest='template', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名; """, dest='publishDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除用户自定义转码模板; - 删除用户自定义转码模板之前必须先删除此模板在各域名、应用、流级别的转码设置; ''', + help=''' 删除直播域名; - 请慎重操作(建议在进行域名删除前到域名解析服务商处恢复域名A记录),以免导致删除操作后此域名不可访问。; deleteLiveDomain调用成功后将删除本条直播域名的全部相关记录,对于仅需要暂停使用该直播域名,推荐stopLiveDomain接口; ''', description=''' - 删除用户自定义转码模板; - 删除用户自定义转码模板之前必须先删除此模板在各域名、应用、流级别的转码设置; 。 + 删除直播域名; - 请慎重操作(建议在进行域名删除前到域名解析服务商处恢复域名A记录),以免导致删除操作后此域名不可访问。; deleteLiveDomain调用成功后将删除本条直播域名的全部相关记录,对于仅需要暂停使用该直播域名,推荐stopLiveDomain接口; 。 - 示例: jdc live delete-custom-live-stream-transcode-template --template xxx + 示例: jdc live delete-live-domain --publish-domain xxx ''', ) - def delete_custom_live_stream_transcode_template(self): + def delete_live_domain(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteCustomLiveStreamTranscodeTemplateRequest import DeleteCustomLiveStreamTranscodeTemplateRequest + from jdcloud_sdk.services.live.apis.DeleteLiveDomainRequest import DeleteLiveDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteCustomLiveStreamTranscodeTemplateRequest(params_dict, headers) + req = DeleteLiveDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3639,29 +3715,31 @@ def delete_custom_live_stream_transcode_template(self): @expose( arguments=[ - (['--template'], dict(help="""(string) 转码模板 """, dest='template', required=True)), + (['--play-domain'], dict(help="""(string) 直播的播放域名; - 回看域名所对应的原播放域名,新建的回看域名将绑定到此播放域名下; """, dest='playDomain', required=True)), + (['--restart-domain'], dict(help="""(string) 直播回看域名; - 直播域名必须已经备案完成; """, dest='restartDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询转码模板绑定; ''', + help=''' 添加回看域名; ''', description=''' - 查询转码模板绑定; 。 + 添加回看域名; 。 - 示例: jdc live describe-transcode-binding --template xxx + 示例: jdc live add-live-restart-domain --play-domain xxx --restart-domain xxx ''', ) - def describe_transcode_binding(self): + def add_live_restart_domain(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeTranscodeBindingRequest import DescribeTranscodeBindingRequest + from jdcloud_sdk.services.live.apis.AddLiveRestartDomainRequest import AddLiveRestartDomainRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeTranscodeBindingRequest(params_dict, headers) + req = AddLiveRestartDomainRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3671,38 +3749,32 @@ def describe_transcode_binding(self): @expose( arguments=[ - (['--position'], dict(help="""(int) 水印位置; - 取值范围:左上:1,右上:3, 左下:7,右下:9,默认:1; """, dest='position', type=int, required=False)), - (['--offset-unit'], dict(help="""(string) 偏移量单位; - 取值: percent,pixel; - percent:按百分比; pixel:像素 默认:pixel; """, dest='offsetUnit', required=False)), - (['--offset-x'], dict(help="""(int) x轴偏移量; - 取值范围; percent: (0,100]; pixel: (0,1920]; """, dest='offsetX', type=int, required=True)), - (['--offset-y'], dict(help="""(int) y轴偏移量:; - 取值范围; percent: (0,100]; pixel: (0,1920]; """, dest='offsetY', type=int, required=True)), - (['--size-unit'], dict(help="""(string) 水印大小单位; - 取值: percent,pixel; - percent:按百分比; pixel:像素 默认:pixel; """, dest='sizeUnit', required=False)), - (['--width'], dict(help="""(int) 水印宽度:; - 取值范围; percent: (0,100]; pixel: (0,1920]; """, dest='width', type=int, required=True)), - (['--height'], dict(help="""(int) 水印高度:; - 取值范围; percent: (0,100]; pixel: (0,1920]; """, dest='height', type=int, required=True)), - (['--template'], dict(help="""(string) 自定义水印模板名称; - 取值要求: 数字、大小写字母、短横线("-")、下划线("_"),;   首尾不能有特殊字符("-"),;   不超过50字符,utf-8格式; - 注意: 不能与已定义命名重复; """, dest='template', required=True)), - (['--upload-id'], dict(help="""(string) 创建上传任务时返回的uploadId参数,当通过接口上传水印图片时,uploadId必填; """, dest='uploadId', required=False)), - (['--url'], dict(help="""(string) 水印地址
- 以 http:// 开头,可公开访问地址
""", dest='url', required=True)), + (['--page-num'], dict(help="""(int) 页码; - 取值范围[1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 录制模板列表查询过滤条件:; - name: template 录制模板自定义名称; - value: 如果参数为空,则查询全部; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加用户自定义水印模板; ''', + help=''' 查询用户自定义直播录制模板列表; ''', description=''' - 添加用户自定义水印模板; 。 + 查询用户自定义直播录制模板列表; 。 - 示例: jdc live add-custom-live-stream-watermark-template --offset-x 0 --offset-y 0 --width 0 --height 0 --template xxx --url xxx + 示例: jdc live describe-custom-live-stream-record-templates ''', ) - def add_custom_live_stream_watermark_template(self): + def describe_custom_live_stream_record_templates(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddCustomLiveStreamWatermarkTemplateRequest import AddCustomLiveStreamWatermarkTemplateRequest + from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamRecordTemplatesRequest import DescribeCustomLiveStreamRecordTemplatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddCustomLiveStreamWatermarkTemplateRequest(params_dict, headers) + req = DescribeCustomLiveStreamRecordTemplatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3712,31 +3784,34 @@ def add_custom_live_stream_watermark_template(self): @expose( arguments=[ - (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 水印模板列表查询过滤条件:; - name: template 录制模板自定义名称; - value: 如果参数为空,则查询全部; """, dest='filters', required=False)), + (['--record-period'], dict(help="""(int) 自动录制周期; - 取值: [15,360]; - 单位: 分钟; """, dest='recordPeriod', type=int, required=True)), + (['--save-bucket'], dict(help="""(string) 存储桶; """, dest='saveBucket', required=True)), + (['--save-endpoint'], dict(help="""(string) endpoint; """, dest='saveEndpoint', required=False)), + (['--record-file-type'], dict(help="""(string) 录制文件格式:; - 取值: ts,flv,mp4 (多种类型之间用;隔开); - 不区分大小写; """, dest='recordFileType', required=True)), + (['--template'], dict(help="""(string) 录制模板自定义名称:; - 取值要求:数字、大小写字母或短横线("-")、下划线("_"),; 最大长度50个字符; - 注意: 不能与已定义命名重复; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户定义水印模板列表; ''', + help=''' 添加用户自定义直播录制模板; ''', description=''' - 查询用户定义水印模板列表; 。 + 添加用户自定义直播录制模板; 。 - 示例: jdc live describe-custom-live-stream-watermark-templates + 示例: jdc live add-custom-live-stream-record-template --record-period 5 --save-bucket xxx --record-file-type xxx --template xxx ''', ) - def describe_custom_live_stream_watermark_templates(self): + def add_custom_live_stream_record_template(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamWatermarkTemplatesRequest import DescribeCustomLiveStreamWatermarkTemplatesRequest + from jdcloud_sdk.services.live.apis.AddCustomLiveStreamRecordTemplateRequest import AddCustomLiveStreamRecordTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCustomLiveStreamWatermarkTemplatesRequest(params_dict, headers) + req = AddCustomLiveStreamRecordTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3748,29 +3823,30 @@ def describe_custom_live_stream_watermark_templates(self): arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--template'], dict(help="""(string) 水印模板名称; """, dest='template', required=True)), + (['--template'], dict(help="""(string) 录制模版 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加应用级别水印配置; ''', + help=''' 添加应用级别直播录制配置; - 添加应用级别的直播录制模板配置; ''', description=''' - 添加应用级别水印配置; 。 + 添加应用级别直播录制配置; - 添加应用级别的直播录制模板配置; 。 - 示例: jdc live add-live-stream-app-watermark --publish-domain xxx --app-name xxx --template xxx + 示例: jdc live add-live-stream-app-record --publish-domain xxx --app-name xxx --template xxx ''', ) - def add_live_stream_app_watermark(self): + def add_live_stream_app_record(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveStreamAppWatermarkRequest import AddLiveStreamAppWatermarkRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamAppRecordRequest import AddLiveStreamAppRecordRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveStreamAppWatermarkRequest(params_dict, headers) + req = AddLiveStreamAppRecordRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3781,29 +3857,30 @@ def add_live_stream_app_watermark(self): @expose( arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--template'], dict(help="""(string) 水印模板; """, dest='template', required=True)), + (['--template'], dict(help="""(string) 录制模版 """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加域名水印配置; ''', + help=''' 添加域名级别直播录制配置; - 添加域名级别的直播录制模板配置; ''', description=''' - 添加域名水印配置; 。 + 添加域名级别直播录制配置; - 添加域名级别的直播录制模板配置; 。 - 示例: jdc live add-live-stream-domain-watermark --publish-domain xxx --template xxx + 示例: jdc live add-live-stream-domain-record --publish-domain xxx --template xxx ''', ) - def add_live_stream_domain_watermark(self): + def add_live_stream_domain_record(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.AddLiveStreamDomainWatermarkRequest import AddLiveStreamDomainWatermarkRequest + from jdcloud_sdk.services.live.apis.AddLiveStreamDomainRecordRequest import AddLiveStreamDomainRecordRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddLiveStreamDomainWatermarkRequest(params_dict, headers) + req = AddLiveStreamDomainRecordRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3815,29 +3892,30 @@ def add_live_stream_domain_watermark(self): arguments=[ (['--page-num'], dict(help="""(int) 页码; - 取值范围 [1, 100000]; """, dest='pageNum', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小; - 取值范围 [10, 100]; """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 水印配置查询过滤条件:; - name: publishDomain,必填(推流域名); - value: 参数; - name: appName,必填(应用名称); - value: 参数; - name: streamName,非必填(流名称); - value: 参数; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) 录制配置查询过滤条件:; - name: publishDomain,必填(推流域名); - value: 参数; - name: appName,必填(应用名称); - value: 参数; - name: streamName,非必填(流名称); - value: 参数; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询直播水印配置; - 水印模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的水印模板配置,并非各级的模板绑定情况; ''', + help=''' 查询直播直播录制配置; - 录制模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的录制模板配置,并非各级的模板绑定情况; ''', description=''' - 查询直播水印配置; - 水印模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的水印模板配置,并非各级的模板绑定情况; 。 + 查询直播直播录制配置; - 录制模板配置按照 域名,应用,流 3级配置添加,以最小的粒度配置生效; - 域名、应用、流 依次粒度递减 即: 域名>应用>流; - 该查询旨在查询域名、应用、流最终生效的录制模板配置,并非各级的模板绑定情况; 。 - 示例: jdc live describe-custom-live-stream-watermark-config + 示例: jdc live describe-custom-live-stream-record-config ''', ) - def describe_custom_live_stream_watermark_config(self): + def describe_custom_live_stream_record_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamWatermarkConfigRequest import DescribeCustomLiveStreamWatermarkConfigRequest + from jdcloud_sdk.services.live.apis.DescribeCustomLiveStreamRecordConfigRequest import DescribeCustomLiveStreamRecordConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeCustomLiveStreamWatermarkConfigRequest(params_dict, headers) + req = DescribeCustomLiveStreamRecordConfigRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3847,29 +3925,64 @@ def describe_custom_live_stream_watermark_config(self): @expose( arguments=[ - (['--template'], dict(help="""(string) 水印模板; """, dest='template', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--notify-url'], dict(help="""(string) 录制回调通知的URL地址; - 以 http:// 开头,外网可访问的地址; """, dest='notifyUrl', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除用户自定义水印模板; - 删除用户自定义水印模板之前必须先删除此模板在各域名、应用、流级别的水印设置; ''', + help=''' 设置直播录制回调通知; ''', description=''' - 删除用户自定义水印模板; - 删除用户自定义水印模板之前必须先删除此模板在各域名、应用、流级别的水印设置; 。 + 设置直播录制回调通知; 。 - 示例: jdc live delete-custom-live-stream-watermark-template --template xxx + 示例: jdc live set-live-stream-record-notify-config --publish-domain xxx --notify-url xxx ''', ) - def delete_custom_live_stream_watermark_template(self): + def set_live_stream_record_notify_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteCustomLiveStreamWatermarkTemplateRequest import DeleteCustomLiveStreamWatermarkTemplateRequest + from jdcloud_sdk.services.live.apis.SetLiveStreamRecordNotifyConfigRequest import SetLiveStreamRecordNotifyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteCustomLiveStreamWatermarkTemplateRequest(params_dict, headers) + req = SetLiveStreamRecordNotifyConfigRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--template'], dict(help="""(string) 录制模板 """, dest='template', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除用户自定义录制模板; - 删除用户自定义录制模板之前必须先删除此模板在各域名、应用、流级别的录制设置; ''', + description=''' + 删除用户自定义录制模板; - 删除用户自定义录制模板之前必须先删除此模板在各域名、应用、流级别的录制设置; 。 + + 示例: jdc live delete-custom-live-stream-record-template --template xxx + ''', + ) + def delete_custom_live_stream_record_template(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DeleteCustomLiveStreamRecordTemplateRequest import DeleteCustomLiveStreamRecordTemplateRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteCustomLiveStreamRecordTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3881,29 +3994,30 @@ def delete_custom_live_stream_watermark_template(self): arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--template'], dict(help="""(string) 水印模板; """, dest='template', required=True)), + (['--template'], dict(help="""(string) 录制模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除应用级别水印模板配置; - 删除应用级别的水印模板配置,重新推流后生效; ''', + help=''' 删除应用级别录制模板配置; - 删除应用级别的录制模板配置,重新推流后生效; ''', description=''' - 删除应用级别水印模板配置; - 删除应用级别的水印模板配置,重新推流后生效; 。 + 删除应用级别录制模板配置; - 删除应用级别的录制模板配置,重新推流后生效; 。 - 示例: jdc live delete-live-stream-app-watermark --publish-domain xxx --app-name xxx --template xxx + 示例: jdc live delete-live-stream-app-record --publish-domain xxx --app-name xxx --template xxx ''', ) - def delete_live_stream_app_watermark(self): + def delete_live_stream_app_record(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamAppWatermarkRequest import DeleteLiveStreamAppWatermarkRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamAppRecordRequest import DeleteLiveStreamAppRecordRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamAppWatermarkRequest(params_dict, headers) + req = DeleteLiveStreamAppRecordRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3914,29 +4028,30 @@ def delete_live_stream_app_watermark(self): @expose( arguments=[ (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--template'], dict(help="""(string) 水印模板; """, dest='template', required=True)), + (['--template'], dict(help="""(string) 录制模板; """, dest='template', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除域名级别水印模板配置; - 删除域名级别水印模板配置,重新推流后生效; ''', + help=''' 删除域名级别录制模板配置; - 删除域名级别录制模板配置,重新推流后生效; ''', description=''' - 删除域名级别水印模板配置; - 删除域名级别水印模板配置,重新推流后生效; 。 + 删除域名级别录制模板配置; - 删除域名级别录制模板配置,重新推流后生效; 。 - 示例: jdc live delete-live-stream-domain-watermark --publish-domain xxx --template xxx + 示例: jdc live delete-live-stream-domain-record --publish-domain xxx --template xxx ''', ) - def delete_live_stream_domain_watermark(self): + def delete_live_stream_domain_record(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DeleteLiveStreamDomainWatermarkRequest import DeleteLiveStreamDomainWatermarkRequest + from jdcloud_sdk.services.live.apis.DeleteLiveStreamDomainRecordRequest import DeleteLiveStreamDomainRecordRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLiveStreamDomainWatermarkRequest(params_dict, headers) + req = DeleteLiveStreamDomainRecordRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3946,29 +4061,813 @@ def delete_live_stream_domain_watermark(self): @expose( arguments=[ - (['--template'], dict(help="""(string) 水印模板 """, dest='template', required=True)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询水印模板绑定; ''', + help=''' 查询录制回调配置; ''', description=''' - 查询水印模板绑定; 。 + 查询录制回调配置; 。 - 示例: jdc live describe-watermark-binding --template xxx + 示例: jdc live describe-live-stream-record-notify-config --publish-domain xxx ''', ) - def describe_watermark_binding(self): + def describe_live_stream_record_notify_config(self): client_factory = ClientFactory('live') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.live.apis.DescribeWatermarkBindingRequest import DescribeWatermarkBindingRequest + from jdcloud_sdk.services.live.apis.DescribeLiveStreamRecordNotifyConfigRequest import DescribeLiveStreamRecordNotifyConfigRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeWatermarkBindingRequest(params_dict, headers) + req = DescribeLiveStreamRecordNotifyConfigRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除录制回调配置; ''', + description=''' + 删除录制回调配置; 。 + + 示例: jdc live delete-live-stream-record-notify-config --publish-domain xxx + ''', + ) + def delete_live_stream_record_notify_config(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DeleteLiveStreamRecordNotifyConfigRequest import DeleteLiveStreamRecordNotifyConfigRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteLiveStreamRecordNotifyConfigRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), + (['--record-times'], dict(help="""(array: recordTime) 录制时间集合; - 最大支持10段,多段合并成一个文件; - 多段时间跨度最小不能小于10s; - 多段时间跨度最大不能超过8小时; """, dest='recordTimes', required=True)), + (['--save-bucket'], dict(help="""(string) 存储桶 """, dest='saveBucket', required=True)), + (['--save-endpoint'], dict(help="""(string) 存储地址 """, dest='saveEndpoint', required=True)), + (['--record-file-type'], dict(help="""(string) 录制文件类型:; - 取值: ts,flv,mp4 (多种类型之间用;隔开); - 不区分大小写; """, dest='recordFileType', required=True)), + (['--save-object'], dict(help="""(string) 录制文件存储Object:; - 默认: /record/{Date}/{ServerId}/{AppName}/{StreamName}/{StartTime}_{EndTime}; """, dest='saveObject', required=False)), + (['--task-external-id'], dict(help="""(string) 打点录制任务外部id(可传入您的id,在回调时会在该字段返回); """, dest='taskExternalId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 添加打点录制任务; - 您可以调用此接口精确提取已录制的文件中所需要的部分; ''', + description=''' + 添加打点录制任务; - 您可以调用此接口精确提取已录制的文件中所需要的部分; 。 + + 示例: jdc live add-live-record-task --publish-domain xxx --app-name xxx --stream-name xxx --record-times ['{"":""}'] --save-bucket xxx --save-endpoint xxx --record-file-type xxx + ''', + ) + def add_live_record_task(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.AddLiveRecordTaskRequest import AddLiveRecordTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = AddLiveRecordTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--template'], dict(help="""(string) 录制模板 """, dest='template', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询录制模板绑定; ''', + description=''' + 查询录制模板绑定; 。 + + 示例: jdc live describe-record-binding --template xxx + ''', + ) + def describe_record_binding(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeRecordBindingRequest import DescribeRecordBindingRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeRecordBindingRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--page-num'], dict(help="""(int) 页码; - 取值范围: [1, 100000]; """, dest='pageNum', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围: [10, 100]; """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 域名下的app列表过滤条件:; - name: publishDomain 直播的推流域名; - values: 如果参数为空,则查询全部; - 过滤条件为空,则表示查询用户下的所有应用名; """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询域名下的APP列表 ''', + description=''' + 查询域名下的APP列表。 + + 示例: jdc live describe-live-app + ''', + ) + def describe_live_app(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLiveAppRequest import DescribeLiveAppRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLiveAppRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--publish-domain'], dict(help="""(string) 直播的推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称; - 取值: 数字字母中划线("-")下划线("_") 50个字符以内; """, dest='appName', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 添加直播应用名; - 需要提前在应用(app)级别绑定功能模板时才需要提前新建应用名; - 新的应用名可以推流时自动创建; ''', + description=''' + 添加直播应用名; - 需要提前在应用(app)级别绑定功能模板时才需要提前新建应用名; - 新的应用名可以推流时自动创建; 。 + + 示例: jdc live add-live-app --publish-domain xxx --app-name xxx + ''', + ) + def add_live_app(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.AddLiveAppRequest import AddLiveAppRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = AddLiveAppRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--publish-domain'], dict(help="""(string) 直播的推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 停用 运行中 状态的应用; - 停用应用之后,不能再用此应用名推流; ''', + description=''' + 停用 运行中 状态的应用; - 停用应用之后,不能再用此应用名推流; 。 + + 示例: jdc live stop-live-app --publish-domain xxx --app-name xxx + ''', + ) + def stop_live_app(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.StopLiveAppRequest import StopLiveAppRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = StopLiveAppRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=False)), + (['--grade'], dict(help="""(string) 码率档次,可以查询指定档次的转码时长,取值:; - video_h264_4k_1; - video_h264_2k_1; - video_h264_shd_1; - video_h264_hd_1; - video_h264_sd_1; - video_h265_4k_1; - video_h265_2k_1; - video_h265_shd_1; - video_h265_hd_1; - video_h265_sd_1; """, dest='grade', required=False)), + (['--period'], dict(help="""(string) 查询周期,取值范围:“day,month,year,followTime”,分别表示1天,1月,1年,跟随时间。默认为空,表示day。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询转码时长数据 ''', + description=''' + 查询转码时长数据。 + + 示例: jdc live describe-live-transcoding-duration-data --start-time xxx + ''', + ) + def describe_live_transcoding_duration_data(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLiveTranscodingDurationDataRequest import DescribeLiveTranscodingDurationDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLiveTranscodingDurationDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--period'], dict(help="""(string) 查询周期,取值范围:“day,month,year,followTime”,分别表示1天,1月,1年,跟随时间。默认为空,表示day。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询存储空间数据 ''', + description=''' + 查询存储空间数据。 + + 示例: jdc live describe-live-file-storage-data --start-time xxx + ''', + ) + def describe_live_file_storage_data(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLiveFileStorageDataRequest import DescribeLiveFileStorageDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLiveFileStorageDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain-name'], dict(help="""(string) 播放域名,可以通过指定域名查询该域名下产生的带宽数据。; """, dest='domainName', required=False)), + (['--app-name'], dict(help="""(string) 推流AppName,将AppName作为查询条件时须指定域名。; """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称,将流名称作为查询条件时须指定域名和AppName。; """, dest='streamName', required=False)), + (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), + (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), + (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询带宽数据; - 查询某个时间段内的带宽数据(平均带宽); - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; ''', + description=''' + 查询带宽数据; - 查询某个时间段内的带宽数据(平均带宽); - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; 。 + + 示例: jdc live describe-live-stream-bandwidth-data --start-time xxx + ''', + ) + def describe_live_stream_bandwidth_data(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLiveStreamBandwidthDataRequest import DescribeLiveStreamBandwidthDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLiveStreamBandwidthDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain-name'], dict(help="""(string) 推流域名,可以通过指定域名查询该域名下产生的带宽数据。; """, dest='domainName', required=False)), + (['--app-name'], dict(help="""(string) 推流AppName,将AppName作为查询条件时须指定域名。; """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称,将流名称作为查询条件时须指定域名和AppName。; """, dest='streamName', required=False)), + (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), + (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), + (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询推流带宽; - 查询某个时间段内的推流上行带宽数据; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; ''', + description=''' + 查询推流带宽; - 查询某个时间段内的推流上行带宽数据; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; 。 + + 示例: jdc live describe-live-stream-publish-bandwidth-data --start-time xxx + ''', + ) + def describe_live_stream_publish_bandwidth_data(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLiveStreamPublishBandwidthDataRequest import DescribeLiveStreamPublishBandwidthDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLiveStreamPublishBandwidthDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain-name'], dict(help="""(string) 播放域名,可以通过指定域名查询该域名下产生的带宽数据。; """, dest='domainName', required=False)), + (['--app-name'], dict(help="""(string) 推流AppName,将AppName作为查询条件时须指定域名。; """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称; """, dest='streamName', required=False)), + (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), + (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), + (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询流量数据; - 查询某个时间段内的流量数据。; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; ''', + description=''' + 查询流量数据; - 查询某个时间段内的流量数据。; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; 。 + + 示例: jdc live describe-live-stream-traffic-data --start-time xxx + ''', + ) + def describe_live_stream_traffic_data(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLiveStreamTrafficDataRequest import DescribeLiveStreamTrafficDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLiveStreamTrafficDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain-name'], dict(help="""(string) 推流域名,可以通过指定域名查询该域名下产生的带宽数据。; """, dest='domainName', required=False)), + (['--app-name'], dict(help="""(string) 推流AppName,将AppName作为查询条件时须指定域名。; """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称; """, dest='streamName', required=False)), + (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), + (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), + (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 查询起始时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z'; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询截至时间,UTC时间,格式:yyyy-MM-dd'T'HH:mm:ss'Z',为空时默认为当前时间; """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询推流上行流量数据; - 查询某个时间段内的流量数据。; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; ''', + description=''' + 查询推流上行流量数据; - 查询某个时间段内的流量数据。; - 查询1分钟粒度的数据时,时间跨度不超过7天,其他粒度时时间跨度不超过30天; 。 + + 示例: jdc live describe-live-stream-publish-traffic-data --start-time xxx + ''', + ) + def describe_live_stream_publish_traffic_data(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLiveStreamPublishTrafficDataRequest import DescribeLiveStreamPublishTrafficDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLiveStreamPublishTrafficDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=False)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), + (['--shot-mode'], dict(help="""(int) 截图模式:1表示采样截图;2表示关键帧截图(默认为2) """, dest='shotMode', type=int, required=False)), + (['--start-time'], dict(help="""(string) 起始时间:; - UTC时间; 格式: yyyy-MM-dd'T'HH:mm:ss'Z'; 示例: 2018-10-21T10:00:00Z; - 支持最大查询90天以内的数据; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式: yyyy-MM-dd'T'HH:mm:ss'Z'; 示例: 2018-10-21T10:00:00Z; - 为空,默认当前时间; """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询直播截图张数数据 ''', + description=''' + 查询直播截图张数数据。 + + 示例: jdc live describe-live-snapshot-data --start-time xxx + ''', + ) + def describe_live_snapshot_data(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLiveSnapshotDataRequest import DescribeLiveSnapshotDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLiveSnapshotDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=False)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 支持最大查询90天以内的数据; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间; """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询直播鉴黄张数数据 ''', + description=''' + 查询直播鉴黄张数数据。 + + 示例: jdc live describe-live-porn-data --start-time xxx + ''', + ) + def describe_live_porn_data(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLivePornDataRequest import DescribeLivePornDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLivePornDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=False)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), + (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), + (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,查询时间跨度不超过1天; """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询流分组统计数据 ''', + description=''' + 查询流分组统计数据。 + + 示例: jdc live describe-live-statistic-group-by-stream --start-time xxx + ''', + ) + def describe_live_statistic_group_by_stream(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLiveStatisticGroupByStreamRequest import DescribeLiveStatisticGroupByStreamRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLiveStatisticGroupByStreamRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), + (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), + (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,查询时间跨度不超过1天; """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询地域分组统计数据 ''', + description=''' + 查询地域分组统计数据。 + + 示例: jdc live describe-live-statistic-group-by-area --domain-name xxx --app-name xxx --stream-name xxx --start-time xxx + ''', + ) + def describe_live_statistic_group_by_area(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLiveStatisticGroupByAreaRequest import DescribeLiveStatisticGroupByAreaRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLiveStatisticGroupByAreaRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), + (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), + (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), + (['--protocol-type'], dict(help="""(string) 查询的流协议类型,取值范围:"rtmp,hdl,hls",多个时以逗号分隔; """, dest='protocolType', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,查询时间跨度不超过1天; """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询地域/运营商分组统计数据 ''', + description=''' + 查询地域/运营商分组统计数据。 + + 示例: jdc live describe-live-statistic-group-by-area-isp --domain-name xxx --start-time xxx + ''', + ) + def describe_live_statistic_group_by_area_isp(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLiveStatisticGroupByAreaIspRequest import DescribeLiveStatisticGroupByAreaIspRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLiveStatisticGroupByAreaIspRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--domain-name'], dict(help="""(string) 播放域名 """, dest='domainName', required=False)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=False)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=False)), + (['--isp-name'], dict(help="""(string) 运营商; """, dest='ispName', required=False)), + (['--location-name'], dict(help="""(string) 查询的区域,如beijing,shanghai。多个用逗号分隔; """, dest='locationName', required=False)), + (['--period'], dict(help="""(string) 查询周期,当前取值范围:“oneMin,fiveMin,halfHour,hour,twoHour,sixHour,day,followTime”,分别表示1min,5min,半小时,1小时,2小时,6小时,1天,跟随时间。默认为空,表示fiveMin。当传入followTime时,表示按Endtime-StartTime的周期,只返回一个点; """, dest='period', required=False)), + (['--start-time'], dict(help="""(string) 起始时间; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 结束时间:; - UTC时间; 格式:yyyy-MM-dd'T'HH:mm:ss'Z'; 示例:2018-10-21T10:00:00Z; - 为空,默认为当前时间,查询时间跨度不超过1天; """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询流分组统计数据(上行) ''', + description=''' + 查询流分组统计数据(上行)。 + + 示例: jdc live describe-live-publish-statistic-group-by-stream --start-time xxx + ''', + ) + def describe_live_publish_statistic_group_by_stream(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLivePublishStatisticGroupByStreamRequest import DescribeLivePublishStatisticGroupByStreamRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLivePublishStatisticGroupByStreamRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--play-domain'], dict(help="""(string) 直播的播放域名 """, dest='playDomain', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 开启时移; 直播支持最大4小时的HLS时移,使用方式为在播放域名后增加时移参数来实现,参数类型支持指定开始时间和时间偏移量2种方式进行时移。 开启直播时移后,重新推流生效,使用播放域名带相应参数访问即可播放; - 域名格式:; 1、http://{playDomain}/{appName}/{streamName}/index.m3u8?timeshift=400(秒,指从当前时间往前时移的偏移量); 2、http://{playDomain}/{appName}/{streamName}/index.m3u8?starttime=1529223702 (unix时间戳); ''', + description=''' + 开启时移; 直播支持最大4小时的HLS时移,使用方式为在播放域名后增加时移参数来实现,参数类型支持指定开始时间和时间偏移量2种方式进行时移。 开启直播时移后,重新推流生效,使用播放域名带相应参数访问即可播放; - 域名格式:; 1、http://{playDomain}/{appName}/{streamName}/index.m3u8?timeshift=400(秒,指从当前时间往前时移的偏移量); 2、http://{playDomain}/{appName}/{streamName}/index.m3u8?starttime=1529223702 (unix时间戳); 。 + + 示例: jdc live open-live-timeshift --play-domain xxx + ''', + ) + def open_live_timeshift(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.OpenLiveTimeshiftRequest import OpenLiveTimeshiftRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = OpenLiveTimeshiftRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--play-domain'], dict(help="""(string) 直播的播放域名 """, dest='playDomain', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 关闭时移 ''', + description=''' + 关闭时移。 + + 示例: jdc live close-live-timeshift --play-domain xxx + ''', + ) + def close_live_timeshift(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.CloseLiveTimeshiftRequest import CloseLiveTimeshiftRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CloseLiveTimeshiftRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--page-number'], dict(help="""(int) 页码; - 取值范围[1, 100000]; """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小; - 取值范围[10, 100]; """, dest='pageSize', type=int, required=False)), + (['--play-domain'], dict(help="""(string) 直播的播放域名; - 目前仅支持精确匹配; """, dest='playDomain', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询时移配置 ''', + description=''' + 查询时移配置。 + + 示例: jdc live describe-live-timeshift-configs --play-domain xxx + ''', + ) + def describe_live_timeshift_configs(self): + client_factory = ClientFactory('live') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.live.apis.DescribeLiveTimeshiftConfigsRequest import DescribeLiveTimeshiftConfigsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLiveTimeshiftConfigsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3978,7 +4877,7 @@ def describe_watermark_binding(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-live-app','add-live-app','stop-live-app','describe-live-play-auth-key','set-live-play-auth-key','describe-live-restart-auth-key','set-live-restart-auth-key','describe-live-bill-data','describe-live-domain-certificate','set-live-domain-certificate','describe-live-restart-domain-certificate','set-live-restart-domain-certificate','describe-live-domains','add-live-domain','start-live-domain','stop-live-domain','describe-live-domain-detail','delete-live-domain','add-live-restart-domain','add-custom-live-stream-quality-detection-template','describe-custom-live-stream-quality-detection-templates','add-live-stream-app-quality-detection','add-live-stream-domain-quality-detection','set-live-stream-quality-detection-notify-config','delete-custom-live-stream-quality-detection-template','delete-live-stream-app-quality-detection','delete-live-stream-domain-quality-detection','describe-live-stream-quality-detection-notify-config','delete-live-stream-quality-detection-notify-config','describe-quality-detection-binding','open-live-p2p','close-live-p2p','describe-live-p2p-configs','describe-custom-live-stream-record-templates','add-custom-live-stream-record-template','add-live-stream-app-record','add-live-stream-domain-record','describe-custom-live-stream-record-config','set-live-stream-record-notify-config','delete-custom-live-stream-record-template','delete-live-stream-app-record','delete-live-stream-domain-record','describe-live-stream-record-notify-config','delete-live-stream-record-notify-config','add-live-record-task','describe-record-binding','describe-live-statistic-group-by-stream','describe-live-statistic-group-by-area','describe-live-statistic-group-by-area-isp','describe-publish-stream-info-data','describe-live-stream-history-user-num','describe-live-publish-stream-num','describe-live-stream-player-ranking-data','describe-live-transcode-stream-list','describe-live-transcode-stream-num','describe-live-transcode-stream-player-user-num','describe-live-transcode-stream-bandwidth','describe-domain-online-stream','describe-domains-log','describe-url-ranking','describe-live-transcoding-duration-data','describe-live-file-storage-data','describe-live-stream-bandwidth-data','describe-live-stream-publish-bandwidth-data','describe-live-stream-traffic-data','describe-live-stream-publish-traffic-data','describe-live-snapshot-data','describe-live-porn-data','add-custom-live-stream-snapshot-template','describe-custom-live-stream-snapshot-config','describe-custom-live-stream-snapshot-templates','add-live-stream-app-snapshot','add-live-stream-domain-snapshot','set-live-stream-snapshot-notify-config','delete-custom-live-stream-snapshot-template','delete-live-stream-app-snapshot','delete-live-stream-domain-snapshot','describe-live-stream-snapshot-notify-config','delete-live-stream-snapshot-notify-config','describe-snapshot-binding','forbid-live-stream','resume-live-stream','interrupt-live-stream','describe-live-stream-info','set-live-stream-notify-config','describe-live-stream-notify-config','delete-live-stream-notify-config','describe-live-stream-online-list','describe-live-stream-publish-list','open-live-restart','close-live-restart','describe-live-restart-configs','open-live-timeshift','close-live-timeshift','describe-live-timeshift-configs','add-live-stream-domain-transcode','add-live-stream-app-transcode','add-custom-live-stream-transcode-template','describe-custom-live-stream-transcode-templates','describe-system-live-stream-transcode-templates','describe-live-stream-transcode-config','delete-live-stream-domain-transcode','delete-live-stream-app-transcode','describe-custom-live-stream-transcode-template','delete-custom-live-stream-transcode-template','describe-transcode-binding','add-custom-live-stream-watermark-template','describe-custom-live-stream-watermark-templates','add-live-stream-app-watermark','add-live-stream-domain-watermark','describe-custom-live-stream-watermark-config','delete-custom-live-stream-watermark-template','delete-live-stream-app-watermark','delete-live-stream-domain-watermark','describe-watermark-binding',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-publish-stream-info-data','describe-live-stream-history-user-num','describe-live-publish-stream-num','describe-live-stream-player-ranking-data','describe-live-transcode-stream-list','describe-live-transcode-stream-num','describe-live-transcode-stream-player-user-num','describe-live-transcode-stream-bandwidth','describe-domain-online-stream','describe-domains-log','describe-url-ranking','describe-live-stream-publish-info-by-page','describe-live-stream-play-info-by-page','describe-live-domain-certificate','set-live-domain-certificate','describe-live-restart-domain-certificate','set-live-restart-domain-certificate','add-live-stream-domain-transcode','add-live-stream-app-transcode','add-custom-live-stream-transcode-template','describe-custom-live-stream-transcode-templates','describe-system-live-stream-transcode-templates','describe-live-stream-transcode-config','delete-live-stream-domain-transcode','delete-live-stream-app-transcode','describe-custom-live-stream-transcode-template','delete-custom-live-stream-transcode-template','describe-transcode-binding','add-custom-live-stream-quality-detection-template','describe-custom-live-stream-quality-detection-templates','add-live-stream-app-quality-detection','add-live-stream-domain-quality-detection','set-live-stream-quality-detection-notify-config','delete-custom-live-stream-quality-detection-template','delete-live-stream-app-quality-detection','delete-live-stream-domain-quality-detection','describe-live-stream-quality-detection-notify-config','delete-live-stream-quality-detection-notify-config','describe-quality-detection-binding','describe-live-play-auth-key','set-live-play-auth-key','describe-live-restart-auth-key','set-live-restart-auth-key','add-custom-live-stream-watermark-template','describe-custom-live-stream-watermark-templates','add-live-stream-app-watermark','add-live-stream-domain-watermark','describe-custom-live-stream-watermark-config','delete-custom-live-stream-watermark-template','delete-live-stream-app-watermark','delete-live-stream-domain-watermark','describe-watermark-binding','create-live-forward-task','update-live-forward-task','query-live-forward-task','start-live-forward-task','stop-live-forward-task','delete-live-forward-task','delete-live-recordings','add-live-stream-domain-translate','add-live-stream-app-translate','add-live-stream-translate','describe-system-live-stream-translate-templates','describe-live-stream-translate-config','describe-live-domain-translate-config','delete-live-stream-domain-translate','delete-live-stream-app-translate','delete-live-stream-translate','describe-translate-binding','pause-live-stream-translate','resume-live-stream-translate','forbid-live-stream','resume-live-stream','interrupt-live-stream','describe-live-stream-info','set-live-stream-notify-config','describe-live-stream-notify-config','delete-live-stream-notify-config','describe-live-stream-online-list','describe-live-stream-publish-list','describe-live-bill-data','open-live-restart','close-live-restart','describe-live-restart-configs','open-live-p2p','close-live-p2p','describe-live-p2p-configs','add-custom-live-stream-snapshot-template','describe-custom-live-stream-snapshot-config','describe-custom-live-stream-snapshot-templates','add-live-stream-app-snapshot','add-live-stream-domain-snapshot','set-live-stream-snapshot-notify-config','delete-custom-live-stream-snapshot-template','delete-live-stream-app-snapshot','delete-live-stream-domain-snapshot','describe-live-stream-snapshot-notify-config','delete-live-stream-snapshot-notify-config','describe-snapshot-binding','describe-live-domains','add-live-domain','start-live-domain','stop-live-domain','describe-live-domain-detail','delete-live-domain','add-live-restart-domain','describe-custom-live-stream-record-templates','add-custom-live-stream-record-template','add-live-stream-app-record','add-live-stream-domain-record','describe-custom-live-stream-record-config','set-live-stream-record-notify-config','delete-custom-live-stream-record-template','delete-live-stream-app-record','delete-live-stream-domain-record','describe-live-stream-record-notify-config','delete-live-stream-record-notify-config','add-live-record-task','describe-record-binding','describe-live-app','add-live-app','stop-live-app','describe-live-transcoding-duration-data','describe-live-file-storage-data','describe-live-stream-bandwidth-data','describe-live-stream-publish-bandwidth-data','describe-live-stream-traffic-data','describe-live-stream-publish-traffic-data','describe-live-snapshot-data','describe-live-porn-data','describe-live-statistic-group-by-stream','describe-live-statistic-group-by-area','describe-live-statistic-group-by-area-isp','describe-live-publish-statistic-group-by-stream','open-live-timeshift','close-live-timeshift','describe-live-timeshift-configs',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/logs.py b/jdcloud_cli/controllers/services/logs.py index 15549dd..02baa2b 100644 --- a/jdcloud_cli/controllers/services/logs.py +++ b/jdcloud_cli/controllers/services/logs.py @@ -41,6 +41,7 @@ class Meta: (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), (['--collect-info-uid'], dict(help="""(string) 采集配置 UID """, dest='collectInfoUID', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -73,14 +74,22 @@ def describe_collect_info(self): arguments=[ (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), (['--collect-info-uid'], dict(help="""(string) 采集配置 UID """, dest='collectInfoUID', required=True)), - (['--enabled'], dict(help="""(bool) 采集状态,0-禁用,1-启用 """, dest='enabled', required=True)), - (['--resource-type'], dict(help="""(string) 采集实例类型, 只能是 all/part 当选择all时,传入的实例列表无效 """, dest='resourceType', required=True)), - (['--resources'], dict(help="""(array: resource) 采集实例列表(存在上限限制20) """, dest='resources', required=False)), - (['--log-path'], dict(help="""(string) 日志路径。当appcode为custom时为必填。目前仅支持对 Linux 云主机上的日志进行采集,路径支持通配符“*”和“?”,文件路径应符合 Linux 的文件路径规则 """, dest='logPath', required=False)), + (['--ag-resource'], dict(help="""(array: agResource) 高可用组资源 """, dest='agResource', required=False)), + (['--enabled'], dict(help="""(bool) 采集状态,0-禁用,1-启用 """, dest='enabled', type=bool, required=True)), + (['--filter-enabled'], dict(help="""(bool) 过滤器是否启用。当appcode为custom时必填 """, dest='filterEnabled', type=bool, required=False)), + (['--log-custom-target'], dict(help="""(string) 自定义日志转发目的地, 只支持业务应用日志。支持类型:"kafka","es" """, dest='logCustomTarget', required=False)), + (['--log-custom-target-conf'], dict(help="""(object) 自定义日志转发目的地配置,KV 结构,具体配置参考 LogCustomTargetKafkaConf 和 LogCustomTargetEsConf """, dest='logCustomTargetConf', required=False)), (['--log-file'], dict(help="""(string) 日志文件名。当appcode为custom时为必填。日志文件名支持正则表达式。 """, dest='logFile', required=False)), (['--log-filters'], dict(help="""(array: string) 过滤器。设置过滤器后可根据用户设定的关键词采集部分日志,如仅采集 Error 的日志。目前最大允许5个。 """, dest='logFilters', required=False)), - (['--filter-enabled'], dict(help="""(bool) 过滤器是否启用。当appcode为custom时必填 """, dest='filterEnabled', required=False)), + (['--log-path'], dict(help="""(string) 日志路径。当appcode为custom时为必填。目前仅支持对 Linux 云主机上的日志进行采集,路径支持通配符“*”和“?”,文件路径应符合 Linux 的文件路径规则 """, dest='logPath', required=False)), + (['--logtopic-enabled'], dict(help="""(bool) 目的地是否是日志服务logtopic,只支持业务应用日志 """, dest='logtopicEnabled', type=bool, required=False)), + (['--regexp-str'], dict(help="""(string) 首行正则 """, dest='regexpStr', required=False)), + (['--resource-mode'], dict(help="""(int) 采集资源时选择的模式,1.正常的选择实例模式(默认模式);2.选择标签tag模式 3.选择高可用组ag模式 """, dest='resourceMode', type=int, required=False)), + (['--resource-type'], dict(help="""(string) 采集实例类型, 只能是 all/part 当选择all时,传入的实例列表无效 """, dest='resourceType', required=True)), + (['--resources'], dict(help="""(array: resource) 采集实例列表(存在上限限制) """, dest='resources', required=False)), + (['--tag-resource'], dict(help="""(tagResource) NA """, dest='tagResource', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -116,6 +125,7 @@ def update_collect_info(self): (['--page-number'], dict(help="""(int) 当前所在页,默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 页面大小,默认为20;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -149,8 +159,9 @@ def describe_collect_resources(self): (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), (['--collect-info-uid'], dict(help="""(string) 采集配置 UID """, dest='collectInfoUID', required=True)), (['--action'], dict(help="""(string) action """, dest='action', required=True)), - (['--resources'], dict(help="""(array: resource) 采集实例列表(系统日志存在上限限制20) """, dest='resources', required=False)), + (['--resources'], dict(help="""(array: resource) 采集实例列表(系统日志存在上限限制) """, dest='resources', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -183,17 +194,25 @@ def update_collect_resources(self): arguments=[ (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), - (['--enabled'], dict(help="""(bool) 采集状态,0-禁用,1-启用 """, dest='enabled', required=True)), + (['--ag-resource'], dict(help="""(array: agResource) 高可用组资源 """, dest='agResource', required=False)), (['--app-code'], dict(help="""(string) 日志来源,只能是 custom/jdcloud """, dest='appCode', required=True)), - (['--service-code'], dict(help="""(string) 产品线,当日志来源为jdcloud时,必填 """, dest='serviceCode', required=True)), + (['--enabled'], dict(help="""(bool) 采集状态,0-禁用,1-启用 """, dest='enabled', type=bool, required=True)), + (['--filter-enabled'], dict(help="""(bool) 过滤器是否启用。当appcode为custom时必填 """, dest='filterEnabled', type=bool, required=False)), + (['--log-custom-target'], dict(help="""(string) 自定义日志转发目的地, 只支持业务应用日志。支持类型:"kafka","es",默认为空:不进行自定义目的上报 """, dest='logCustomTarget', required=False)), + (['--log-custom-target-conf'], dict(help="""(object) 自定义日志转发目的地配置,KV 结构,具体配置参考 LogCustomTargetKafkaConf 和 LogCustomTargetEsConf """, dest='logCustomTargetConf', required=False)), + (['--log-file'], dict(help="""(string) 日志文件名。当appcode为custom时为必填。日志文件名支持正则表达式。 """, dest='logFile', required=False)), + (['--log-filters'], dict(help="""(array: string) 过滤器。设置过滤器后可根据用户设定的关键词采集部分日志,如仅采集 Error 的日志。目前最大允许5个。 """, dest='logFilters', required=False)), + (['--log-path'], dict(help="""(string) 日志路径。当appcode为custom时为必填。目前仅支持对 Linux 云主机上的日志进行采集,路径支持通配符“*”和“?”,文件路径应符合 Linux 的文件路径规则 """, dest='logPath', required=False)), + (['--logtopic-enabled'], dict(help="""(bool) 目的地是否是日志服务logtopic,只支持业务应用日志 """, dest='logtopicEnabled', type=bool, required=False)), + (['--regexp-str'], dict(help="""(string) 首行正则 """, dest='regexpStr', required=False)), + (['--resource-mode'], dict(help="""(int) 采集资源时选择的模式,1.正常的选择实例模式(默认模式);2.选择标签tag模式 3.选择高可用组ag模式 """, dest='resourceMode', type=int, required=False)), (['--resource-type'], dict(help="""(string) 采集实例类型, 只能是 all/part 当选择all时,传入的实例列表无效;custom类型的采集配置目前仅支持part方式,即用户指定实例列表; """, dest='resourceType', required=True)), (['--resources'], dict(help="""(array: resource) 采集实例列表:jdcloud类型最多添加20个资源;custom类型支持的资源数量不限; """, dest='resources', required=False)), + (['--service-code'], dict(help="""(string) 产品线,当日志来源为jdcloud时,必填 """, dest='serviceCode', required=True)), + (['--tag-resource'], dict(help="""(tagResource) NA """, dest='tagResource', required=False)), (['--template-uid'], dict(help="""(string) 日志类型。当appcode为jdcloud时为必填 """, dest='templateUID', required=False)), - (['--log-path'], dict(help="""(string) 日志路径。当appcode为custom时为必填。目前仅支持对 Linux 云主机上的日志进行采集,路径支持通配符“*”和“?”,文件路径应符合 Linux 的文件路径规则 """, dest='logPath', required=False)), - (['--log-file'], dict(help="""(string) 日志文件名。当appcode为custom时为必填。日志文件名支持正则表达式。 """, dest='logFile', required=False)), - (['--log-filters'], dict(help="""(array: string) 过滤器。设置过滤器后可根据用户设定的关键词采集部分日志,如仅采集 Error 的日志。目前最大允许5个。 """, dest='logFilters', required=False)), - (['--filter-enabled'], dict(help="""(bool) 过滤器是否启用。当appcode为custom时必填 """, dest='filterEnabled', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -201,7 +220,7 @@ def update_collect_resources(self): description=''' 创建采集配置,支持基于云产品模板生成采集模板;支持用于自定义采集配置。。 - 示例: jdc logs create-collect-info --logtopic-uid xxx --enabled true --app-code xxx --service-code xxx --resource-type xxx + 示例: jdc logs create-collect-info --logtopic-uid xxx --app-code xxx --enabled true --resource-type xxx --service-code xxx ''', ) def create_collect_info(self): @@ -224,30 +243,36 @@ def create_collect_info(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) region """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) instanceId """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), + (['--parser-fields'], dict(help="""(array: parserField) NA """, dest='parserFields', required=True)), + (['--parser-mode'], dict(help="""(string) 解析类型。oneline - 单行,split - 分割, json - json, regexp - regexp """, dest='parserMode', required=True)), + (['--parser-pattern'], dict(help="""(string) 解析语法 """, dest='parserPattern', required=False)), + (['--parser-sample'], dict(help="""(string) 日志样例 """, dest='parserSample', required=False)), + (['--pipelines'], dict(help="""(array: pipelineSpec) 预处理任务列表。按照数组的顺序执行。 """, dest='pipelines', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 返回特定有效期的证书 ''', + help=''' 创建日志的解析配置。 ''', description=''' - 返回特定有效期的证书。 + 创建日志的解析配置。。 - 示例: jdc logs describe-logd-ca --instance-id xxx + 示例: jdc logs create-parser --logtopic-uid xxx --parser-fields ['{"":""}'] --parser-mode xxx ''', ) - def describe_logd_ca(self): + def create_parser(self): client_factory = ClientFactory('logs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.logs.apis.DescribeLogdCARequest import DescribeLogdCARequest + from jdcloud_sdk.services.logs.apis.CreateParserRequest import CreateParserRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLogdCARequest(params_dict, headers) + req = CreateParserRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -257,30 +282,31 @@ def describe_logd_ca(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) region """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) instanceId """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询当前实例的采集配置列表:此接口会生成agent心跳监控数据,用以表征agent的可用性。请求中若添加了X-Jdcloud-Logs-md5的header,将按照md5的方式处理返回值。 ''', + help=''' 获取解析配置 ''', description=''' - 查询当前实例的采集配置列表:此接口会生成agent心跳监控数据,用以表征agent的可用性。请求中若添加了X-Jdcloud-Logs-md5的header,将按照md5的方式处理返回值。。 + 获取解析配置。 - 示例: jdc logs describe-instance-collect-confs --instance-id xxx + 示例: jdc logs describe-parser --logtopic-uid xxx ''', ) - def describe_instance_collect_confs(self): + def describe_parser(self): client_factory = ClientFactory('logs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.logs.apis.DescribeInstanceCollectConfsRequest import DescribeInstanceCollectConfsRequest + from jdcloud_sdk.services.logs.apis.DescribeParserRequest import DescribeParserRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceCollectConfsRequest(params_dict, headers) + req = DescribeParserRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -291,31 +317,35 @@ def describe_instance_collect_confs(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 当前所在页,默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 页面大小,默认为20;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), - (['--name'], dict(help="""(string) 日志集名称 """, dest='name', required=False)), + (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), + (['--parser-fields'], dict(help="""(array: parserField) NA """, dest='parserFields', required=True)), + (['--parser-mode'], dict(help="""(string) 解析类型。oneline - 单行,split - 分割, json - json, regexp - regexp """, dest='parserMode', required=True)), + (['--parser-pattern'], dict(help="""(string) 解析语法 """, dest='parserPattern', required=False)), + (['--parser-sample'], dict(help="""(string) 日志样例 """, dest='parserSample', required=False)), + (['--pipelines'], dict(help="""(array: pipelineSpec) 预处理任务列表。按照数组的顺序执行。 """, dest='pipelines', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询日志集列表。支持按照名称进行模糊查询。结果中包含了该日志集是否存在日志主题的信息。存在日志主题的日志集不允许删除。 ''', + help=''' 更新解析配置 ''', description=''' - 查询日志集列表。支持按照名称进行模糊查询。结果中包含了该日志集是否存在日志主题的信息。存在日志主题的日志集不允许删除。。 + 更新解析配置。 - 示例: jdc logs describe-logsets + 示例: jdc logs update-parser --logtopic-uid xxx --parser-fields ['{"":""}'] --parser-mode xxx ''', ) - def describe_logsets(self): + def update_parser(self): client_factory = ClientFactory('logs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.logs.apis.DescribeLogsetsRequest import DescribeLogsetsRequest + from jdcloud_sdk.services.logs.apis.UpdateParserRequest import UpdateParserRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLogsetsRequest(params_dict, headers) + req = UpdateParserRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -325,32 +355,33 @@ def describe_logsets(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) 日志集名称 """, dest='name', required=True)), - (['--description'], dict(help="""(string) 日志集描述 """, dest='description', required=False)), - (['--life-cycle'], dict(help="""(int) 保存周期,只能是 7, 15, 30 """, dest='lifeCycle', type=int, required=True)), + (['--parser-mode'], dict(help="""(string) 解析类型。oneline - 单行,split - 分割, json - json, regexp - regexp """, dest='parserMode', required=True)), + (['--parser-pattern'], dict(help="""(string) 解析语法 """, dest='parserPattern', required=False)), + (['--parser-sample'], dict(help="""(string) 日志样例 """, dest='parserSample', required=False)), + (['--pipelines'], dict(help="""(array: pipelineSpec) 预处理任务列表。按照数组的顺序执行。 """, dest='pipelines', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建日志集。名称不可重复。 ''', + help=''' 验证日志解析语法 ''', description=''' - 创建日志集。名称不可重复。。 + 验证日志解析语法。 - 示例: jdc logs create-logset --name xxx --life-cycle 0 + 示例: jdc logs validate-parser --parser-mode xxx ''', ) - def create_logset(self): + def validate_parser(self): client_factory = ClientFactory('logs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.logs.apis.CreateLogsetRequest import CreateLogsetRequest + from jdcloud_sdk.services.logs.apis.ValidateParserRequest import ValidateParserRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateLogsetRequest(params_dict, headers) + req = ValidateParserRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -361,29 +392,36 @@ def create_logset(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), - (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), + (['--logset-uid'], dict(help="""(string) 日志集ID """, dest='logsetUID', required=True)), + (['--logtopic-uid'], dict(help="""(string) 日志主题ID """, dest='logtopicUID', required=True)), + (['--action'], dict(help="""(string) "preview"表示预览, "fulltext"表示全文检索, "advance"表示按照搜索语句检索 """, dest='action', required=True)), + (['--expr'], dict(help="""(string) Base64编码的搜索表达式, """, dest='expr', required=False)), + (['--case-sensitive'], dict(help="""(bool) 搜索关键字大小写敏感, 默认false """, dest='caseSensitive', type=bool, required=False)), + (['--start-time'], dict(help="""(string) 开始时间。格式 “YYYY-MM-DDThh:mm:ssTZD”, 比如 “2018-11-09T15:34:46+0800”.当action != preview时,必填 """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 结束时间。格式 “YYYY-MM-DDThh:mm:ssTZD”, 比如 “2018-11-09T15:34:46+0800”.当action != preview时,必填 """, dest='endTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询日志集详情。 ''', + help=''' 日志检索结果直方图 ''', description=''' - 查询日志集详情。。 + 日志检索结果直方图。 - 示例: jdc logs describe-logset --logset-uid xxx + 示例: jdc logs histograms --logset-uid xxx --logtopic-uid xxx --action xxx ''', ) - def describe_logset(self): + def histograms(self): client_factory = ClientFactory('logs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.logs.apis.DescribeLogsetRequest import DescribeLogsetRequest + from jdcloud_sdk.services.logs.apis.HistogramsRequest import HistogramsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLogsetRequest(params_dict, headers) + req = HistogramsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -394,31 +432,37 @@ def describe_logset(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), - (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), - (['--description'], dict(help="""(string) 日志集描述 """, dest='description', required=False)), - (['--life-cycle'], dict(help="""(int) 保存周期,只能是 7, 15, 30 """, dest='lifeCycle', type=int, required=False)), + (['--logset-uid'], dict(help="""(string) 日志集ID """, dest='logsetUID', required=True)), + (['--logtopic-uid'], dict(help="""(string) 日志主题ID """, dest='logtopicUID', required=True)), + (['--task-id'], dict(help="""(string) 扫描任务ID。 第一次调用传入空值即可。后续调用需传入该任务ID,以连续读取剩余日志。 """, dest='taskID', required=False)), + (['--expr'], dict(help="""(string) Base64编码的搜索表达式, """, dest='expr', required=False)), + (['--start-time'], dict(help="""(string) 开始时间。格式 “YYYY-MM-DDThh:mm:ssTZD”, 比如 “2018-11-09T15:34:46+0800”.必填 """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 结束时间。格式 “YYYY-MM-DDThh:mm:ssTZD”, 比如 “2018-11-09T15:34:46+0800”.必填 """, dest='endTime', required=False)), + (['--sort'], dict(help="""(string) 返回排序,不填或者为空,默认为desc,"asc":按照时间正序返回结果,"desc":按照时间倒序返回结果 """, dest='sort', required=False)), + (['--filters'], dict(help="""(array: filter) 指定返回字段,只对系统日志生效,不填默认按照产品线配置返回字段,Name支持:key,Values填入返回字段 """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新日志集。日志集名称不可更新。 ''', + help=''' 扫描日志 ''', description=''' - 更新日志集。日志集名称不可更新。。 + 扫描日志。 - 示例: jdc logs update-logset --logset-uid xxx + 示例: jdc logs get-logs --logset-uid xxx --logtopic-uid xxx ''', ) - def update_logset(self): + def get_logs(self): client_factory = ClientFactory('logs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.logs.apis.UpdateLogsetRequest import UpdateLogsetRequest + from jdcloud_sdk.services.logs.apis.GetLogsRequest import GetLogsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateLogsetRequest(params_dict, headers) + req = GetLogsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -429,29 +473,40 @@ def update_logset(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), - (['--logset-uids'], dict(help="""(string) 日志集ID,多个日志集ID以逗号分割 """, dest='logsetUIDs', required=True)), + (['--logset-uid'], dict(help="""(string) 日志集ID """, dest='logsetUID', required=True)), + (['--logtopic-uid'], dict(help="""(string) 日志主题ID """, dest='logtopicUID', required=True)), + (['--action'], dict(help="""(string) "preview"表示预览, "fulltext"表示全文检索, "advance"表示按照搜索语句检索 """, dest='action', required=True)), + (['--expr'], dict(help="""(string) Base64编码的搜索表达式, """, dest='expr', required=False)), + (['--case-sensitive'], dict(help="""(bool) 搜索关键字大小写敏感, 默认false """, dest='caseSensitive', type=bool, required=False)), + (['--start-time'], dict(help="""(string) 开始时间。格式 “YYYY-MM-DDThh:mm:ssTZD”, 比如 “2018-11-09T15:34:46+0800”.当action != preview时,必填 """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 结束时间。格式 “YYYY-MM-DDThh:mm:ssTZD”, 比如 “2018-11-09T15:34:46+0800”.当action != preview时,必填 """, dest='endTime', required=False)), + (['--page-number'], dict(help="""(int) 页数。 最小为1,最大为99 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页个数。默认为10,最大100 """, dest='pageSize', type=int, required=False)), + (['--sort'], dict(help="""(string) 返回排序,不填或者为空,默认为desc,"asc":按照时间正序返回结果,"desc":按照时间倒序返回结果 """, dest='sort', required=False)), + (['--filters'], dict(help="""(array: filter) 指定返回字段,只对系统日志生效,不填默认按照产品线配置返回字段,Name支持:key,Values填入返回字段 """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除日志集,删除多个日志集时,任意的日志集包含了日志主题的,将导致全部删除失败。 ''', + help=''' 搜索日志 ''', description=''' - 删除日志集,删除多个日志集时,任意的日志集包含了日志主题的,将导致全部删除失败。。 + 搜索日志。 - 示例: jdc logs delete-logset --logset-uids xxx + 示例: jdc logs search --logset-uid xxx --logtopic-uid xxx --action xxx ''', ) - def delete_logset(self): + def search(self): client_factory = ClientFactory('logs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.logs.apis.DeleteLogsetRequest import DeleteLogsetRequest + from jdcloud_sdk.services.logs.apis.SearchRequest import SearchRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteLogsetRequest(params_dict, headers) + req = SearchRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -466,7 +521,9 @@ def delete_logset(self): (['--page-number'], dict(help="""(int) 当前所在页,默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 页面大小,默认为20;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), (['--name'], dict(help="""(string) 日志主题名称 """, dest='name', required=False)), + (['--app-name'], dict(help="""(string) 日志主题采集的日志类型 """, dest='appName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -502,6 +559,7 @@ def describe_logtopics(self): (['--name'], dict(help="""(string) 日志主题名称 """, dest='name', required=True)), (['--description'], dict(help="""(string) 日志集描述 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -536,6 +594,7 @@ def create_logtopic(self): (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), (['--logtopic-uids'], dict(help="""(string) 日志主题ID,多个日志主题ID以逗号分割 """, dest='logtopicUIDs', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -569,6 +628,7 @@ def delete_logtopic(self): (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -603,6 +663,7 @@ def describe_logtopic(self): (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), (['--description'], dict(help="""(string) 日志主题描述 """, dest='description', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -633,33 +694,41 @@ def update_logtopic(self): @expose( arguments=[ - (['--logtopic-uid'], dict(help="""(string) 日志主题uid """, dest='logtopicUID', required=True)), - (['--stream'], dict(help="""(string) 全局 strean 日志流标识符(建议起能唯一界定一个文件的名字,如 /i-iqnvqpinkjiq/app.log),不传则写入default日志流中(会导致很多文件混合在一起,不推荐) """, dest='stream', required=False)), - (['--timestamp'], dict(help="""(string) 全局时间戳,UTC格式,最多支持到纳秒级别,不传入则取服务器时间。如 2019-04-08T03:08:04.437670934Z、2019-04-08T03:08:04Z、2019-04-08T03:08:04.123Z """, dest='timestamp', required=False)), - (['--tags'], dict(help="""(object) 全局标签 map[string]string """, dest='tags', required=False)), - (['--entries'], dict(help="""(array: entry) 日志数据 """, dest='entries', required=True)), + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), + (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), + (['--aggregate'], dict(help="""(string) 聚合函数,支持 count sum max min avg; 配置方式(SettingType) 为 空或visual 时,必填; """, dest='aggregate', required=False)), + (['--content'], dict(help="""(array: string) 测试内容 """, dest='content', required=False)), + (['--data-field'], dict(help="""(string) 查询字段,支持 英文字母 数字 下划线 中划线 点(中文日志原文和各产品线的key); 配置方式(SettingType) 为 空或visual 时,必填; """, dest='dataField', required=False)), + (['--filter-content'], dict(help="""(string) 过滤语法,可以为空 """, dest='filterContent', required=False)), + (['--filter-open'], dict(help="""(string) 是否打开过滤; 配置方式(SettingType) 为 空或visual 时,必填; """, dest='filterOpen', required=False)), + (['--filter-type'], dict(help="""(string) 过滤类型,只能是fulltext和 advance; 配置方式(SettingType) 为 空或visual 时,必填; """, dest='filterType', required=False)), + (['--metric'], dict(help="""(string) 监控项 , 支持大小写英文字母 下划线 数字 点,且不超过255byte(不支持中划线); 配置方式(SettingType) 为 空或visual 时,必填; """, dest='metric', required=False)), + (['--setting-type'], dict(help="""(string) 配置方式: 可选参数;枚举值 visual,sql;分别代表可视化配置及sql配置方式,传空表示可视化配置; """, dest='settingType', required=False)), + (['--sql-spec'], dict(help="""(metricTaskSqlSpec) NA """, dest='sqlSpec', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 自定义日志上报。 ''', + help=''' 日志测试,根据用户输入的日志筛选条件以及监控指标设置进行模拟监控统计 ''', description=''' - 自定义日志上报。。 + 日志测试,根据用户输入的日志筛选条件以及监控指标设置进行模拟监控统计。 - 示例: jdc logs put --logtopic-uid xxx --entries ['{"":""}'] + 示例: jdc logs test-metric-task --logset-uid xxx --logtopic-uid xxx ''', ) - def put(self): + def test_metric_task(self): client_factory = ClientFactory('logs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.logs.apis.PutRequest import PutRequest + from jdcloud_sdk.services.logs.apis.TestMetricTaskRequest import TestMetricTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = PutRequest(params_dict, headers) + req = TestMetricTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -672,34 +741,31 @@ def put(self): (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), - (['--anchor'], dict(help="""(array: object) 查询anchor,基于该值偏移进行上下文检索 """, dest='anchor', required=True)), - (['--direction'], dict(help="""(string) 搜索方向,默认both,可取值:up,down,both """, dest='direction', required=False)), - (['--filters'], dict(help="""(array: filter) 指定返回字段,只对系统日志生效,不填默认按照产品线配置返回字段,Name支持:key,Values填入返回字段 """, dest='filters', required=False)), - (['--id'], dict(help="""(string) 日志记录ID """, dest='id', required=True)), - (['--line-size'], dict(help="""(int) 查看上下文行数大小,最大支持200 """, dest='lineSize', type=int, required=True)), - (['--time'], dict(help="""(int) 查询日志时返回的时间戳 """, dest='time', type=int, required=True)), + (['--page-number'], dict(help="""(int) 当前所在页,默认为1; in: query """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 页面大小,默认为20;取值范围[1, 100]; in: query """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 搜索日志上下文 ''', + help=''' 查询监控任务列表,返回该主题下的所有监控任务信息。 ''', description=''' - 搜索日志上下文。 + 查询监控任务列表,返回该主题下的所有监控任务信息。。 - 示例: jdc logs search-log-context --logset-uid xxx --logtopic-uid xxx --anchor ['{"":""}'] --id xxx --line-size 0 --time 0 + 示例: jdc logs describe-metric-tasks --logset-uid xxx --logtopic-uid xxx ''', ) - def search_log_context(self): + def describe_metric_tasks(self): client_factory = ClientFactory('logs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.logs.apis.SearchLogContextRequest import SearchLogContextRequest + from jdcloud_sdk.services.logs.apis.DescribeMetricTasksRequest import DescribeMetricTasksRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SearchLogContextRequest(params_dict, headers) + req = DescribeMetricTasksRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -710,39 +776,483 @@ def search_log_context(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), - (['--logset-uid'], dict(help="""(string) 日志集ID """, dest='logsetUID', required=True)), - (['--logtopic-uid'], dict(help="""(string) 日志主题ID """, dest='logtopicUID', required=True)), - (['--action'], dict(help="""(string) "preview"表示预览, "fulltext"表示全文检索, "advance"表示按照搜索语句检索 """, dest='action', required=True)), - (['--expr'], dict(help="""(string) Base64编码的搜索表达式, """, dest='expr', required=False)), - (['--case-sensitive'], dict(help="""(bool) 搜索关键字大小写敏感, 默认false """, dest='caseSensitive', required=False)), - (['--start-time'], dict(help="""(string) 开始时间。格式 “YYYY-MM-DDThh:mm:ssTZD”, 比如 “2018-11-09T15:34:46+0800” 当action != preview时,必填 """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 结束时间。格式 “YYYY-MM-DDThh:mm:ssTZD”, 比如 “2018-11-09T15:34:46+0800” 当action != preview时,必填 """, dest='endTime', required=False)), - (['--page-number'], dict(help="""(int) 页数。 最小为1,最大为99 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页个数。默认为10,最大100 """, dest='pageSize', type=int, required=False)), - (['--sort'], dict(help="""(string) 返回排序,不填或者为空,默认为desc,"asc":按照时间正序返回结果,"desc":按照时间倒序返回结果 """, dest='sort', required=False)), - (['--filters'], dict(help="""(array: filter) 指定返回字段,只对系统日志生效,不填默认按照产品线配置返回字段,Name支持:key,Values填入返回字段 """, dest='filters', required=False)), + (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), + (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), + (['--aggregate'], dict(help="""(string) 聚合函数,支持 count sum max min avg; 配置方式(SettingType) 为 空或visual 时,必填; """, dest='aggregate', required=False)), + (['--custom-unit'], dict(help="""(string) 自定义单位 """, dest='customUnit', required=True)), + (['--data-field'], dict(help="""(string) 查询字段,支持 英文字母 数字 下划线 中划线 点(中文日志原文和各产品线的key); 配置方式(SettingType) 为 空或visual 时,必填; """, dest='dataField', required=False)), + (['--filter-content'], dict(help="""(string) 过滤语法,可以为空 """, dest='filterContent', required=False)), + (['--filter-open'], dict(help="""(string) 是否打开过滤; 配置方式(SettingType) 为 空或visual 时,必填; """, dest='filterOpen', required=False)), + (['--filter-type'], dict(help="""(string) 过滤类型,只能是fulltext和 advance; 配置方式(SettingType) 为 空或visual 时,必填; """, dest='filterType', required=False)), + (['--interval'], dict(help="""(int) 时间周期,固定60s """, dest='interval', type=int, required=True)), + (['--metric'], dict(help="""(string) 监控项 , 支持大小写英文字母 下划线 数字 点,且不超过255byte(不支持中划线); 配置方式(SettingType) 为 空或visual 时,必填; """, dest='metric', required=False)), + (['--name'], dict(help="""(string) 监控任务名称,同一个日志主题下唯一,支持中文 大小写英文字母 下划线 中划线 数字,且不超过32字符 """, dest='name', required=True)), + (['--setting-type'], dict(help="""(string) 配置方式: 可选参数;枚举值 visual,sql;分别代表可视化配置及sql配置方式,传空表示可视化配置; """, dest='settingType', required=False)), + (['--sql-spec'], dict(help="""(metricTaskSqlSpec) NA """, dest='sqlSpec', required=False)), + (['--unit'], dict(help="""(string) 单位 """, dest='unit', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 搜索日志 ''', + help=''' 创建监控任务,不可与当前日志主题下现有日志监控任务重名。 ''', description=''' - 搜索日志。 + 创建监控任务,不可与当前日志主题下现有日志监控任务重名。。 - 示例: jdc logs search --logset-uid xxx --logtopic-uid xxx --action xxx + 示例: jdc logs create-metric-task --logset-uid xxx --logtopic-uid xxx --custom-unit xxx --interval 5 --name xxx --unit xxx ''', ) - def search(self): + def create_metric_task(self): client_factory = ClientFactory('logs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.logs.apis.SearchRequest import SearchRequest + from jdcloud_sdk.services.logs.apis.CreateMetricTaskRequest import CreateMetricTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SearchRequest(params_dict, headers) + req = CreateMetricTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), + (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), + (['--logmetrictask-uid'], dict(help="""(string) NA """, dest='logmetrictaskUID', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询指定监控任务的详情信息 ''', + description=''' + 查询指定监控任务的详情信息。 + + 示例: jdc logs describe-metric-task --logset-uid xxx --logtopic-uid xxx --logmetrictask-uid xxx + ''', + ) + def describe_metric_task(self): + client_factory = ClientFactory('logs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.logs.apis.DescribeMetricTaskRequest import DescribeMetricTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeMetricTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), + (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), + (['--logmetrictask-uid'], dict(help="""(string) NA """, dest='logmetrictaskUID', required=True)), + (['--aggregate'], dict(help="""(string) 聚合函数,支持 count sum max min avg; 配置方式(SettingType) 为 空或visual 时,必填; """, dest='aggregate', required=False)), + (['--custom-unit'], dict(help="""(string) 自定义单位 """, dest='customUnit', required=True)), + (['--data-field'], dict(help="""(string) 查询字段,支持 英文字母 数字 下划线 中划线 点(中文日志原文和各产品线的key); 配置方式(SettingType) 为 空或visual 时,必填; """, dest='dataField', required=False)), + (['--filter-content'], dict(help="""(string) 过滤语法,可以为空 """, dest='filterContent', required=False)), + (['--filter-open'], dict(help="""(string) 是否打开过滤; 配置方式(SettingType) 为 空或visual 时,必填; """, dest='filterOpen', required=False)), + (['--filter-type'], dict(help="""(string) 过滤类型,只能是fulltext和 advance; 配置方式(SettingType) 为 空或visual 时,必填; """, dest='filterType', required=False)), + (['--metric'], dict(help="""(string) 监控项 , 支持大小写英文字母 下划线 数字 点,且不超过255byte(不支持中划线); 配置方式(SettingType) 为 空或visual 时,必填; """, dest='metric', required=False)), + (['--name'], dict(help="""(string) 监控任务名称,同一日志主题下唯一,支持中文 大小写英文字母 下划线 中划线 数字,且不超过32 """, dest='name', required=True)), + (['--setting-type'], dict(help="""(string) 配置方式: 可选参数;枚举值 visual,sql;分别代表可视化配置及sql配置方式,传空表示可视化配置; """, dest='settingType', required=False)), + (['--sql-spec'], dict(help="""(metricTaskSqlSpec) NA """, dest='sqlSpec', required=False)), + (['--unit'], dict(help="""(string) 单位 """, dest='unit', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 更新监控任务,日志监控任务不许重名。 ''', + description=''' + 更新监控任务,日志监控任务不许重名。。 + + 示例: jdc logs update-metric-task --logset-uid xxx --logtopic-uid xxx --logmetrictask-uid xxx --custom-unit xxx --name xxx --unit xxx + ''', + ) + def update_metric_task(self): + client_factory = ClientFactory('logs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.logs.apis.UpdateMetricTaskRequest import UpdateMetricTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateMetricTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), + (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), + (['--logmetrictask-uid'], dict(help="""(string) NA """, dest='logmetrictaskUID', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除指定监控任务。 ''', + description=''' + 删除指定监控任务。。 + + 示例: jdc logs delete-metric-task --logset-uid xxx --logtopic-uid xxx --logmetrictask-uid xxx + ''', + ) + def delete_metric_task(self): + client_factory = ClientFactory('logs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.logs.apis.DeleteMetricTaskRequest import DeleteMetricTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteMetricTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), + (['--parser-fields'], dict(help="""(array: parserField) NA """, dest='parserFields', required=True)), + (['--parser-mode'], dict(help="""(string) 解析类型。oneline - 单行,split - 分割, json - json, regexp - regexp """, dest='parserMode', required=True)), + (['--parser-pattern'], dict(help="""(string) 解析语法 """, dest='parserPattern', required=False)), + (['--parser-sample'], dict(help="""(string) 日志样例 """, dest='parserSample', required=False)), + (['--pipelines'], dict(help="""(array: pipelineSpec) 预处理任务列表。按照数组的顺序执行。 """, dest='pipelines', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建日志的解析配置。 ''', + description=''' + 创建日志的解析配置。。 + + 示例: jdc logs create-parser --logtopic-uid xxx --parser-fields ['{"":""}'] --parser-mode xxx + ''', + ) + def create_parser(self): + client_factory = ClientFactory('logs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.logs.apis.CreateParserRequest import CreateParserRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateParserRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), + (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 日志消费信息 ''', + description=''' + 日志消费信息。 + + 示例: jdc logs describe-subscribe --logset-uid xxx --logtopic-uid xxx + ''', + ) + def describe_subscribe(self): + client_factory = ClientFactory('logs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.logs.apis.DescribeSubscribeRequest import DescribeSubscribeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeSubscribeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), + (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建日志消费 ''', + description=''' + 创建日志消费。 + + 示例: jdc logs create-subscribe --logset-uid xxx --logtopic-uid xxx + ''', + ) + def create_subscribe(self): + client_factory = ClientFactory('logs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.logs.apis.CreateSubscribeRequest import CreateSubscribeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateSubscribeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), + (['--logtopic-uid'], dict(help="""(string) 日志主题 UID """, dest='logtopicUID', required=True)), + (['--status'], dict(help="""(int) 日志订阅状态,0表示未创建,1表示刚创建,2表示开启,3表示关闭 """, dest='status', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 更新日志消费 ''', + description=''' + 更新日志消费。 + + 示例: jdc logs update-subscribe --logset-uid xxx --logtopic-uid xxx + ''', + ) + def update_subscribe(self): + client_factory = ClientFactory('logs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.logs.apis.UpdateSubscribeRequest import UpdateSubscribeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateSubscribeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 当前所在页,默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 页面大小,默认为20;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), + (['--name'], dict(help="""(string) 日志集名称 """, dest='name', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询日志集列表。支持按照名称进行模糊查询。结果中包含了该日志集是否存在日志主题的信息。存在日志主题的日志集不允许删除。 ''', + description=''' + 查询日志集列表。支持按照名称进行模糊查询。结果中包含了该日志集是否存在日志主题的信息。存在日志主题的日志集不允许删除。。 + + 示例: jdc logs describe-logsets + ''', + ) + def describe_logsets(self): + client_factory = ClientFactory('logs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.logs.apis.DescribeLogsetsRequest import DescribeLogsetsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLogsetsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--name'], dict(help="""(string) 日志集名称 """, dest='name', required=True)), + (['--description'], dict(help="""(string) 日志集描述 """, dest='description', required=False)), + (['--life-cycle'], dict(help="""(int) 保存周期,只能是 7, 15, 30 """, dest='lifeCycle', type=int, required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建日志集。名称不可重复。 ''', + description=''' + 创建日志集。名称不可重复。。 + + 示例: jdc logs create-logset --name xxx --life-cycle 5 + ''', + ) + def create_logset(self): + client_factory = ClientFactory('logs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.logs.apis.CreateLogsetRequest import CreateLogsetRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateLogsetRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询日志集详情。 ''', + description=''' + 查询日志集详情。。 + + 示例: jdc logs describe-logset --logset-uid xxx + ''', + ) + def describe_logset(self): + client_factory = ClientFactory('logs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.logs.apis.DescribeLogsetRequest import DescribeLogsetRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeLogsetRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logset-uid'], dict(help="""(string) 日志集 UID """, dest='logsetUID', required=True)), + (['--description'], dict(help="""(string) 日志集描述 """, dest='description', required=False)), + (['--life-cycle'], dict(help="""(int) 保存周期,只能是 7, 15, 30 """, dest='lifeCycle', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 更新日志集。日志集名称不可更新。 ''', + description=''' + 更新日志集。日志集名称不可更新。。 + + 示例: jdc logs update-logset --logset-uid xxx + ''', + ) + def update_logset(self): + client_factory = ClientFactory('logs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.logs.apis.UpdateLogsetRequest import UpdateLogsetRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateLogsetRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域 Id """, dest='regionId', required=False)), + (['--logset-uids'], dict(help="""(string) 日志集ID,多个日志集ID以逗号分割 """, dest='logsetUIDs', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除日志集,删除多个日志集时,任意的日志集包含了日志主题的,将导致全部删除失败。 ''', + description=''' + 删除日志集,删除多个日志集时,任意的日志集包含了日志主题的,将导致全部删除失败。。 + + 示例: jdc logs delete-logset --logset-uids xxx + ''', + ) + def delete_logset(self): + client_factory = ClientFactory('logs') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.logs.apis.DeleteLogsetRequest import DeleteLogsetRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteLogsetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -752,7 +1262,7 @@ def search(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-collect-info','update-collect-info','describe-collect-resources','update-collect-resources','create-collect-info','describe-logd-ca','describe-instance-collect-confs','describe-logsets','create-logset','describe-logset','update-logset','delete-logset','describe-logtopics','create-logtopic','delete-logtopic','describe-logtopic','update-logtopic','put','search-log-context','search',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-collect-info','update-collect-info','describe-collect-resources','update-collect-resources','create-collect-info','create-parser','describe-parser','update-parser','validate-parser','histograms','get-logs','search','describe-logtopics','create-logtopic','delete-logtopic','describe-logtopic','update-logtopic','test-metric-task','describe-metric-tasks','create-metric-task','describe-metric-task','update-metric-task','delete-metric-task','create-parser','describe-subscribe','create-subscribe','update-subscribe','describe-logsets','create-logset','describe-logset','update-logset','delete-logset',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/mongodb.py b/jdcloud_cli/controllers/services/mongodb.py index 47c3977..14122d5 100644 --- a/jdcloud_cli/controllers/services/mongodb.py +++ b/jdcloud_cli/controllers/services/mongodb.py @@ -39,33 +39,30 @@ class Meta: @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1,取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) instanceId - 实例ID, 精确匹配; instanceName - 实例名称, 模糊匹配; instanceStatus - mongodb状态,精确匹配,支持多个.RUNNING:运行, ERROR:错误 ,BUILDING:创建中, DELETING:删除中, RESTORING:恢复中, RESIZING:变配中; chargeMode - 计费类型,精确匹配; """, dest='filters', required=False)), - (['--tag-filters'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tagFilters', required=False)), - (['--sorts'], dict(help="""(array: sort) createTime - 创建时间,asc(正序),desc(倒序); """, dest='sorts', required=False)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询实例信息 ''', + help=''' 查询实例访问白名单 ''', description=''' - 查询实例信息。 + 查询实例访问白名单。 - 示例: jdc mongodb describe-instances + 示例: jdc mongodb describe-security-ips --instance-id xxx ''', ) - def describe_instances(self): + def describe_security_ips(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.DescribeInstancesRequest import DescribeInstancesRequest + from jdcloud_sdk.services.mongodb.apis.DescribeSecurityIpsRequest import DescribeSecurityIpsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstancesRequest(params_dict, headers) + req = DescribeSecurityIpsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -76,30 +73,32 @@ def describe_instances(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-spec'], dict(help="""(dBInstanceSpec) 实例规格 """, dest='instanceSpec', required=True)), - (['--charge-spec'], dict(help="""(chargeSpec) 付费方式 """, dest='chargeSpec', required=False)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--modify-mode'], dict(help="""(string) 修改方式,Add 增加白名单,Delete 删除白名单. """, dest='modifyMode', required=True)), + (['--security-ips'], dict(help="""(string) IP白名单分组下的IP列表,最多45个以逗号隔开,格式如下:0.0.0.0/0,10.23.12.24(IP),或者10.23.12.24/24(CIDR模式,无类域间路由,/24表示了地址中前缀的长度,范围[1,32])。 """, dest='securityIps', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建实例 ''', + help=''' 修改实例访问白名单 ''', description=''' - 创建实例。 + 修改实例访问白名单。 - 示例: jdc mongodb create-instance --instance-spec '{"":""}' + 示例: jdc mongodb modify-security-ips --instance-id xxx --modify-mode xxx --security-ips xxx ''', ) - def create_instance(self): + def modify_security_ips(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.CreateInstanceRequest import CreateInstanceRequest + from jdcloud_sdk.services.mongodb.apis.ModifySecurityIpsRequest import ModifySecurityIpsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateInstanceRequest(params_dict, headers) + req = ModifySecurityIpsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -110,29 +109,32 @@ def create_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--page-number'], dict(help="""(int) 页码;默认为1,取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) instanceId - 实例ID, 精确匹配; backupId - 备份ID, 精确匹配; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除实例 ''', + help=''' 查看备份 ''', description=''' - 删除实例。 + 查看备份。 - 示例: jdc mongodb delete-instance --instance-id xxx + 示例: jdc mongodb describe-backups ''', ) - def delete_instance(self): + def describe_backups(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.DeleteInstanceRequest import DeleteInstanceRequest + from jdcloud_sdk.services.mongodb.apis.DescribeBackupsRequest import DescribeBackupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteInstanceRequest(params_dict, headers) + req = DescribeBackupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -143,30 +145,32 @@ def delete_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), - (['--account-password'], dict(help="""(string) 新密码,必须包含且只支持字母及数字,不少于8字符不超过16字符。 """, dest='accountPassword', required=True)), + (['--instance-id'], dict(help="""(string) 实例ID """, dest='instanceId', required=True)), + (['--backup-name'], dict(help="""(string) 备份名称 """, dest='backupName', required=False)), + (['--backup-method'], dict(help="""(string) 备份方式,Logical - 逻辑备份、Physical - 物理备份 """, dest='backupMethod', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 重置密码 ''', + help=''' 创建备份 ''', description=''' - 重置密码。 + 创建备份。 - 示例: jdc mongodb reset-password --instance-id xxx --account-password xxx + 示例: jdc mongodb create-backup --instance-id xxx ''', ) - def reset_password(self): + def create_backup(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.ResetPasswordRequest import ResetPasswordRequest + from jdcloud_sdk.services.mongodb.apis.CreateBackupRequest import CreateBackupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ResetPasswordRequest(params_dict, headers) + req = CreateBackupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -177,31 +181,30 @@ def reset_password(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), - (['--instance-class'], dict(help="""(string) 实例规格,包年包月不允许小于当前规格。 """, dest='instanceClass', required=True)), - (['--instance-storage-gb'], dict(help="""(int) 存储空间,包年包月不允许小于当前规格。 """, dest='instanceStorageGB', type=int, required=True)), + (['--backup-id'], dict(help="""(string) backup ID """, dest='backupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 变更实例规格 ''', + help=''' 删除备份 ''', description=''' - 变更实例规格。 + 删除备份。 - 示例: jdc mongodb modify-instance-spec --instance-id xxx --instance-class xxx --instance-storage-gb 0 + 示例: jdc mongodb delete-backup --backup-id xxx ''', ) - def modify_instance_spec(self): + def delete_backup(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.ModifyInstanceSpecRequest import ModifyInstanceSpecRequest + from jdcloud_sdk.services.mongodb.apis.DeleteBackupRequest import DeleteBackupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyInstanceSpecRequest(params_dict, headers) + req = DeleteBackupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -212,30 +215,30 @@ def modify_instance_spec(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), - (['--instance-name'], dict(help="""(string) 新的实例名称,只支持数字、字母、英文下划线、中文,且不少于2字符不超过32字符。 """, dest='instanceName', required=True)), + (['--backup-id'], dict(help="""(string) backup ID """, dest='backupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改实例名称 ''', + help=''' 获取备份下载链接 ''', description=''' - 修改实例名称。 + 获取备份下载链接。 - 示例: jdc mongodb modify-instance-name --instance-id xxx --instance-name xxx + 示例: jdc mongodb backup-download-url --backup-id xxx ''', ) - def modify_instance_name(self): + def backup_download_url(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.ModifyInstanceNameRequest import ModifyInstanceNameRequest + from jdcloud_sdk.services.mongodb.apis.BackupDownloadURLRequest import BackupDownloadURLRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyInstanceNameRequest(params_dict, headers) + req = BackupDownloadURLRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -246,29 +249,34 @@ def modify_instance_name(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--page-number'], dict(help="""(int) 页码;默认为1,取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) instanceId - 实例ID, 精确匹配; instanceName - 实例名称, 模糊匹配; instanceStatus - mongodb状态,精确匹配,支持多个.RUNNING:运行, ERROR:错误 ,BUILDING:创建中, DELETING:删除中, RESTORING:恢复中, RESIZING:变配中; chargeMode - 计费类型,精确匹配; """, dest='filters', required=False)), + (['--tag-filters'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tagFilters', required=False)), + (['--sorts'], dict(help="""(array: sort) createTime - 创建时间,asc(正序),desc(倒序); """, dest='sorts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取备份策略 ''', + help=''' 查询实例信息 ''', description=''' - 获取备份策略。 + 查询实例信息。 - 示例: jdc mongodb describe-backup-policy --instance-id xxx + 示例: jdc mongodb describe-instances ''', ) - def describe_backup_policy(self): + def describe_instances(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.DescribeBackupPolicyRequest import DescribeBackupPolicyRequest + from jdcloud_sdk.services.mongodb.apis.DescribeInstancesRequest import DescribeInstancesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBackupPolicyRequest(params_dict, headers) + req = DescribeInstancesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -279,30 +287,31 @@ def describe_backup_policy(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), - (['--preferred-backup-time'], dict(help="""(string) 备份时间,格式:HH:mmZ- HH:mmZ,只允许间隔时间为1小时的整点. """, dest='preferredBackupTime', required=True)), + (['--instance-spec'], dict(help="""(dBInstanceSpec) 实例规格 """, dest='instanceSpec', required=True)), + (['--charge-spec'], dict(help="""(chargeSpec) 付费方式 """, dest='chargeSpec', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改备份策略 ''', + help=''' 创建实例 ''', description=''' - 修改备份策略。 + 创建实例。 - 示例: jdc mongodb modify-backup-policy --instance-id xxx --preferred-backup-time xxx + 示例: jdc mongodb create-instance --instance-spec '{"":""}' ''', ) - def modify_backup_policy(self): + def create_instance(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.ModifyBackupPolicyRequest import ModifyBackupPolicyRequest + from jdcloud_sdk.services.mongodb.apis.CreateInstanceRequest import CreateInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyBackupPolicyRequest(params_dict, headers) + req = CreateInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -314,29 +323,29 @@ def modify_backup_policy(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), - (['--backup-id'], dict(help="""(string) 备份ID """, dest='backupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 数据恢复 ''', + help=''' 删除实例 ''', description=''' - 数据恢复。 + 删除实例。 - 示例: jdc mongodb restore-instance --instance-id xxx --backup-id xxx + 示例: jdc mongodb delete-instance --instance-id xxx ''', ) - def restore_instance(self): + def delete_instance(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.RestoreInstanceRequest import RestoreInstanceRequest + from jdcloud_sdk.services.mongodb.apis.DeleteInstanceRequest import DeleteInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RestoreInstanceRequest(params_dict, headers) + req = DeleteInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -347,28 +356,31 @@ def restore_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--account-password'], dict(help="""(string) 新密码,必须包含且只支持字母及数字,不少于8字符不超过16字符。 """, dest='accountPassword', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取规格 ''', + help=''' 重置密码 ''', description=''' - 获取规格。 + 重置密码。 - 示例: jdc mongodb describe-flavors + 示例: jdc mongodb reset-password --instance-id xxx --account-password xxx ''', ) - def describe_flavors(self): + def reset_password(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.DescribeFlavorsRequest import DescribeFlavorsRequest + from jdcloud_sdk.services.mongodb.apis.ResetPasswordRequest import ResetPasswordRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeFlavorsRequest(params_dict, headers) + req = ResetPasswordRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -379,28 +391,32 @@ def describe_flavors(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--instance-class'], dict(help="""(string) 实例规格,包年包月不允许小于当前规格。 """, dest='instanceClass', required=True)), + (['--instance-storage-gb'], dict(help="""(int) 存储空间,包年包月不允许小于当前规格。 """, dest='instanceStorageGB', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取可用区 ''', + help=''' 变更实例规格 ''', description=''' - 获取可用区。 + 变更实例规格。 - 示例: jdc mongodb describe-available-zones + 示例: jdc mongodb modify-instance-spec --instance-id xxx --instance-class xxx --instance-storage-gb 5 ''', ) - def describe_available_zones(self): + def modify_instance_spec(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.DescribeAvailableZonesRequest import DescribeAvailableZonesRequest + from jdcloud_sdk.services.mongodb.apis.ModifyInstanceSpecRequest import ModifyInstanceSpecRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAvailableZonesRequest(params_dict, headers) + req = ModifyInstanceSpecRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -412,28 +428,30 @@ def describe_available_zones(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--instance-name'], dict(help="""(string) 新的实例名称,只支持数字、字母、英文下划线、中文,且不少于2字符不超过32字符。 """, dest='instanceName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 重启实例 ''', + help=''' 修改实例名称 ''', description=''' - 重启实例。 + 修改实例名称。 - 示例: jdc mongodb restart-instance --instance-id xxx + 示例: jdc mongodb modify-instance-name --instance-id xxx --instance-name xxx ''', ) - def restart_instance(self): + def modify_instance_name(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.RestartInstanceRequest import RestartInstanceRequest + from jdcloud_sdk.services.mongodb.apis.ModifyInstanceNameRequest import ModifyInstanceNameRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RestartInstanceRequest(params_dict, headers) + req = ModifyInstanceNameRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -444,30 +462,30 @@ def restart_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--sharding-instance-spec'], dict(help="""(shardingDBInstanceSpec) 实例规格 """, dest='shardingInstanceSpec', required=True)), - (['--charge-spec'], dict(help="""(chargeSpec) 付费方式 """, dest='chargeSpec', required=False)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建分片集群 ''', + help=''' 获取备份策略 ''', description=''' - 创建分片集群。 + 获取备份策略。 - 示例: jdc mongodb create-sharding-instance --sharding-instance-spec '{"":""}' + 示例: jdc mongodb describe-backup-policy --instance-id xxx ''', ) - def create_sharding_instance(self): + def describe_backup_policy(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.CreateShardingInstanceRequest import CreateShardingInstanceRequest + from jdcloud_sdk.services.mongodb.apis.DescribeBackupPolicyRequest import DescribeBackupPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateShardingInstanceRequest(params_dict, headers) + req = DescribeBackupPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -479,31 +497,30 @@ def create_sharding_instance(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), - (['--node-id'], dict(help="""(string) Node ID """, dest='nodeId', required=True)), - (['--node-type'], dict(help="""(string) Shard节点或Mongos节点的规格,不允许小于当前规格。 """, dest='nodeType', required=True)), - (['--node-storage-gb'], dict(help="""(int) Shard存储空间,当前节点为Shard时可用,不允许小于当前规格。 """, dest='nodeStorageGB', type=int, required=False)), + (['--preferred-backup-time'], dict(help="""(string) 备份时间,格式:HH:mmZ- HH:mmZ,只允许间隔时间为1小时的整点. """, dest='preferredBackupTime', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 变更分片集群的节点规格,支持Mognos、Shard节点。 ''', + help=''' 修改备份策略 ''', description=''' - 变更分片集群的节点规格,支持Mognos、Shard节点。。 + 修改备份策略。 - 示例: jdc mongodb modify-node-spec --instance-id xxx --node-id xxx --node-type xxx + 示例: jdc mongodb modify-backup-policy --instance-id xxx --preferred-backup-time xxx ''', ) - def modify_node_spec(self): + def modify_backup_policy(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.ModifyNodeSpecRequest import ModifyNodeSpecRequest + from jdcloud_sdk.services.mongodb.apis.ModifyBackupPolicyRequest import ModifyBackupPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyNodeSpecRequest(params_dict, headers) + req = ModifyBackupPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -515,29 +532,30 @@ def modify_node_spec(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), - (['--node-id'], dict(help="""(string) Node ID """, dest='nodeId', required=True)), + (['--backup-id'], dict(help="""(string) 备份ID """, dest='backupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 重启MongoDB分片集群节点,支持重启Mongos、Shard。 ''', + help=''' 数据恢复 ''', description=''' - 重启MongoDB分片集群节点,支持重启Mongos、Shard。。 + 数据恢复。 - 示例: jdc mongodb restart-node --instance-id xxx --node-id xxx + 示例: jdc mongodb restore-instance --instance-id xxx --backup-id xxx ''', ) - def restart_node(self): + def restore_instance(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.RestartNodeRequest import RestartNodeRequest + from jdcloud_sdk.services.mongodb.apis.RestoreInstanceRequest import RestoreInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RestartNodeRequest(params_dict, headers) + req = RestoreInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -548,31 +566,29 @@ def restart_node(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1,取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) instanceId - 实例ID, 精确匹配; backupId - 备份ID, 精确匹配; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看备份 ''', + help=''' 获取规格 ''', description=''' - 查看备份。 + 获取规格。 - 示例: jdc mongodb describe-backups + 示例: jdc mongodb describe-flavors ''', ) - def describe_backups(self): + def describe_flavors(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.DescribeBackupsRequest import DescribeBackupsRequest + from jdcloud_sdk.services.mongodb.apis.DescribeFlavorsRequest import DescribeFlavorsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBackupsRequest(params_dict, headers) + req = DescribeFlavorsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -583,31 +599,29 @@ def describe_backups(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 实例ID """, dest='instanceId', required=True)), - (['--backup-name'], dict(help="""(string) 备份名称 """, dest='backupName', required=False)), - (['--backup-method'], dict(help="""(string) 备份方式,Logical - 逻辑备份、Physical - 物理备份 """, dest='backupMethod', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建备份 ''', + help=''' 获取可用区 ''', description=''' - 创建备份。 + 获取可用区。 - 示例: jdc mongodb create-backup --instance-id xxx + 示例: jdc mongodb describe-available-zones ''', ) - def create_backup(self): + def describe_available_zones(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.CreateBackupRequest import CreateBackupRequest + from jdcloud_sdk.services.mongodb.apis.DescribeAvailableZonesRequest import DescribeAvailableZonesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateBackupRequest(params_dict, headers) + req = DescribeAvailableZonesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -618,29 +632,30 @@ def create_backup(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--backup-id'], dict(help="""(string) backup ID """, dest='backupId', required=True)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除备份 ''', + help=''' 重启实例 ''', description=''' - 删除备份。 + 重启实例。 - 示例: jdc mongodb delete-backup --backup-id xxx + 示例: jdc mongodb restart-instance --instance-id xxx ''', ) - def delete_backup(self): + def restart_instance(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.DeleteBackupRequest import DeleteBackupRequest + from jdcloud_sdk.services.mongodb.apis.RestartInstanceRequest import RestartInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteBackupRequest(params_dict, headers) + req = RestartInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -651,29 +666,31 @@ def delete_backup(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--backup-id'], dict(help="""(string) backup ID """, dest='backupId', required=True)), + (['--sharding-instance-spec'], dict(help="""(shardingDBInstanceSpec) 实例规格 """, dest='shardingInstanceSpec', required=True)), + (['--charge-spec'], dict(help="""(chargeSpec) 付费方式 """, dest='chargeSpec', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取备份下载链接 ''', + help=''' 创建分片集群 ''', description=''' - 获取备份下载链接。 + 创建分片集群。 - 示例: jdc mongodb backup-download-url --backup-id xxx + 示例: jdc mongodb create-sharding-instance --sharding-instance-spec '{"":""}' ''', ) - def backup_download_url(self): + def create_sharding_instance(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.BackupDownloadURLRequest import BackupDownloadURLRequest + from jdcloud_sdk.services.mongodb.apis.CreateShardingInstanceRequest import CreateShardingInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BackupDownloadURLRequest(params_dict, headers) + req = CreateShardingInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -684,31 +701,33 @@ def backup_download_url(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1,取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) null """, dest='filters', required=False)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--node-id'], dict(help="""(string) Node ID """, dest='nodeId', required=True)), + (['--node-type'], dict(help="""(string) Shard节点或Mongos节点的规格,不允许小于当前规格。 """, dest='nodeType', required=True)), + (['--node-storage-gb'], dict(help="""(int) Shard存储空间,当前节点为Shard时可用,不允许小于当前规格。 """, dest='nodeStorageGB', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询跨区域备份同步服务 ''', + help=''' 变更分片集群的节点规格,支持Mognos、Shard节点。 ''', description=''' - 查询跨区域备份同步服务。 + 变更分片集群的节点规格,支持Mognos、Shard节点。。 - 示例: jdc mongodb describe-backup-synchronicities + 示例: jdc mongodb modify-node-spec --instance-id xxx --node-id xxx --node-type xxx ''', ) - def describe_backup_synchronicities(self): + def modify_node_spec(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.DescribeBackupSynchronicitiesRequest import DescribeBackupSynchronicitiesRequest + from jdcloud_sdk.services.mongodb.apis.ModifyNodeSpecRequest import ModifyNodeSpecRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBackupSynchronicitiesRequest(params_dict, headers) + req = ModifyNodeSpecRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -719,31 +738,31 @@ def describe_backup_synchronicities(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 源实例ID """, dest='instanceId', required=True)), - (['--src-region'], dict(help="""(string) 源实例所在地域 """, dest='srcRegion', required=True)), - (['--dst-region'], dict(help="""(string) 备份同步的目标地域 """, dest='dstRegion', required=True)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--node-id'], dict(help="""(string) Node ID """, dest='nodeId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建跨区域备份同步服务 ''', + help=''' 重启MongoDB分片集群节点,支持重启Mongos、Shard。 ''', description=''' - 创建跨区域备份同步服务。 + 重启MongoDB分片集群节点,支持重启Mongos、Shard。。 - 示例: jdc mongodb create-backup-synchronicity --instance-id xxx --src-region xxx --dst-region xxx + 示例: jdc mongodb restart-node --instance-id xxx --node-id xxx ''', ) - def create_backup_synchronicity(self): + def restart_node(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.CreateBackupSynchronicityRequest import CreateBackupSynchronicityRequest + from jdcloud_sdk.services.mongodb.apis.RestartNodeRequest import RestartNodeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateBackupSynchronicityRequest(params_dict, headers) + req = RestartNodeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -754,29 +773,32 @@ def create_backup_synchronicity(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--service-id'], dict(help="""(string) service ID """, dest='serviceId', required=True)), + (['--page-number'], dict(help="""(int) 页码;默认为1,取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) null """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除跨地域备份同步服务 ''', + help=''' 查询跨区域备份同步服务 ''', description=''' - 删除跨地域备份同步服务。 + 查询跨区域备份同步服务。 - 示例: jdc mongodb delete-backup-synchronicities --service-id xxx + 示例: jdc mongodb describe-backup-synchronicities ''', ) - def delete_backup_synchronicities(self): + def describe_backup_synchronicities(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.DeleteBackupSynchronicitiesRequest import DeleteBackupSynchronicitiesRequest + from jdcloud_sdk.services.mongodb.apis.DescribeBackupSynchronicitiesRequest import DescribeBackupSynchronicitiesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteBackupSynchronicitiesRequest(params_dict, headers) + req = DescribeBackupSynchronicitiesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -787,29 +809,32 @@ def delete_backup_synchronicities(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--instance-id'], dict(help="""(string) 源实例ID """, dest='instanceId', required=True)), + (['--src-region'], dict(help="""(string) 源实例所在地域 """, dest='srcRegion', required=True)), + (['--dst-region'], dict(help="""(string) 备份同步的目标地域 """, dest='dstRegion', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询实例访问白名单 ''', + help=''' 创建跨区域备份同步服务 ''', description=''' - 查询实例访问白名单。 + 创建跨区域备份同步服务。 - 示例: jdc mongodb describe-security-ips --instance-id xxx + 示例: jdc mongodb create-backup-synchronicity --instance-id xxx --src-region xxx --dst-region xxx ''', ) - def describe_security_ips(self): + def create_backup_synchronicity(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.DescribeSecurityIpsRequest import DescribeSecurityIpsRequest + from jdcloud_sdk.services.mongodb.apis.CreateBackupSynchronicityRequest import CreateBackupSynchronicityRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSecurityIpsRequest(params_dict, headers) + req = CreateBackupSynchronicityRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -820,31 +845,30 @@ def describe_security_ips(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), - (['--modify-mode'], dict(help="""(string) 修改方式,Add 增加白名单,Delete 删除白名单. """, dest='modifyMode', required=True)), - (['--security-ips'], dict(help="""(string) IP白名单分组下的IP列表,最多45个以逗号隔开,格式如下:0.0.0.0/0,10.23.12.24(IP),或者10.23.12.24/24(CIDR模式,无类域间路由,/24表示了地址中前缀的长度,范围[1,32])。 """, dest='securityIps', required=True)), + (['--service-id'], dict(help="""(string) service ID """, dest='serviceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改实例访问白名单 ''', + help=''' 删除跨地域备份同步服务 ''', description=''' - 修改实例访问白名单。 + 删除跨地域备份同步服务。 - 示例: jdc mongodb modify-security-ips --instance-id xxx --modify-mode xxx --security-ips xxx + 示例: jdc mongodb delete-backup-synchronicities --service-id xxx ''', ) - def modify_security_ips(self): + def delete_backup_synchronicities(self): client_factory = ClientFactory('mongodb') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.mongodb.apis.ModifySecurityIpsRequest import ModifySecurityIpsRequest + from jdcloud_sdk.services.mongodb.apis.DeleteBackupSynchronicitiesRequest import DeleteBackupSynchronicitiesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifySecurityIpsRequest(params_dict, headers) + req = DeleteBackupSynchronicitiesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -854,7 +878,7 @@ def modify_security_ips(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-instances','create-instance','delete-instance','reset-password','modify-instance-spec','modify-instance-name','describe-backup-policy','modify-backup-policy','restore-instance','describe-flavors','describe-available-zones','restart-instance','create-sharding-instance','modify-node-spec','restart-node','describe-backups','create-backup','delete-backup','backup-download-url','describe-backup-synchronicities','create-backup-synchronicity','delete-backup-synchronicities','describe-security-ips','modify-security-ips',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-security-ips','modify-security-ips','describe-backups','create-backup','delete-backup','backup-download-url','describe-instances','create-instance','delete-instance','reset-password','modify-instance-spec','modify-instance-name','describe-backup-policy','modify-backup-policy','restore-instance','describe-flavors','describe-available-zones','restart-instance','create-sharding-instance','modify-node-spec','restart-node','describe-backup-synchronicities','create-backup-synchronicity','delete-backup-synchronicities',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/monitor.py b/jdcloud_cli/controllers/services/monitor.py index c1fe3b2..6c38370 100644 --- a/jdcloud_cli/controllers/services/monitor.py +++ b/jdcloud_cli/controllers/services/monitor.py @@ -40,6 +40,7 @@ class Meta: arguments=[ (['--page-number'], dict(help="""(int) 当前所在页,默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 页面大小,默认为20;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), + (['--data-owner'], dict(help="""(int) 数据所有者,1云监控控制台; 2云鼎。默认为1 """, dest='dataOwner', type=int, required=False)), (['--service-code'], dict(help="""(string) 产品线标识,同一个产品线下可能存在多个product,如(redis下有redis2.8cluster、redis4.0) """, dest='serviceCode', required=False)), (['--product'], dict(help="""(string) 产品标识,如redis下分多个产品(redis2.8cluster、redis4.0)。同时指定serviceCode与product时,product优先生效 """, dest='product', required=False)), (['--dimension'], dict(help="""(string) 产品下的维度标识,指定dimension时必须指定product """, dest='dimension', required=False)), @@ -49,6 +50,7 @@ class Meta: (['--rule-status'], dict(help="""(int) 资源的规则状态 2:报警、4:数据不足 """, dest='ruleStatus', type=int, required=False)), (['--filters'], dict(help="""(array: filter) 服务码或资源Id列表; products - 产品product,精确匹配,支持多个; resourceIds - 资源Id,精确匹配,支持多个(必须指定serviceCode、product或dimension,否则该参数不生效); alarmIds - 规则id,精确匹配,支持多个 """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -82,8 +84,10 @@ def describe_alarms(self): (['--auto-scaling-policy-id'], dict(help="""(string) 弹性伸缩组Id。注:仅ag\asg产品线内部使用 """, dest='autoScalingPolicyId', required=False)), (['--base-contact'], dict(help="""(array: baseContact) 告警通知联系人 """, dest='baseContact', required=False)), (['--client-token'], dict(help="""(string) 幂等性校验参数,最长36位,若两个请求clientToken相等,则返回第一次创建的规则id,只创建一次规则 """, dest='clientToken', required=True)), + (['--data-owner'], dict(help="""(int) 数据所有者,1云监控控制台; 2云鼎。默认为1 """, dest='dataOwner', type=int, required=False)), (['--dimension'], dict(help="""(string) 资源维度,可用的维度请使用 describeProductsForAlarm接口查询 """, dest='dimension', required=False)), (['--enabled'], dict(help="""(int) 是否启用, 1表示启用规则,0表示禁用规则,默认为1 """, dest='enabled', type=int, required=False)), + (['--multi-web-hook'], dict(help="""(array: webHookOption) url回调设置数组 """, dest='multiWebHook', required=False)), (['--notice-option'], dict(help="""(array: noticeOption) 通知策略 """, dest='noticeOption', required=False)), (['--product'], dict(help="""(string) 资源类型, 可用的资源类型列表请使用 describeProductsForAlarm接口查询。 """, dest='product', required=True)), (['--resource-option'], dict(help="""(resourceOption) NA """, dest='resourceOption', required=True)), @@ -93,6 +97,7 @@ def describe_alarms(self): (['--tags'], dict(help="""(object) 资源维度,指定监控数据实例的维度标签,如resourceId=id。(请确认资源的监控数据带有该标签,否则规则会报数据不足) """, dest='tags', required=False)), (['--web-hook-option'], dict(help="""(webHookOption) NA """, dest='webHookOption', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -125,6 +130,7 @@ def create_alarm(self): arguments=[ (['--alarm-id'], dict(help="""(string) 规则id """, dest='alarmId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -158,8 +164,10 @@ def describe_alarm(self): (['--alarm-id'], dict(help="""(string) 规则id """, dest='alarmId', required=True)), (['--auto-scaling-policy-id'], dict(help="""(string) 弹性伸缩组Id。注:仅ag\asg产品线内部使用 """, dest='autoScalingPolicyId', required=False)), (['--base-contact'], dict(help="""(array: baseContact) 告警通知联系人 """, dest='baseContact', required=False)), + (['--data-owner'], dict(help="""(int) 数据所有者,1云监控控制台; 2云鼎。默认为1 """, dest='dataOwner', type=int, required=False)), (['--dimension'], dict(help="""(string) 资源维度,可用的维度请使用 describeProductsForAlarm接口查询 """, dest='dimension', required=False)), (['--enabled'], dict(help="""(int) 是否启用, 1表示启用规则,0表示禁用规则,默认为1 """, dest='enabled', type=int, required=False)), + (['--multi-web-hook'], dict(help="""(array: webHookOption) url回调设置数组 """, dest='multiWebHook', required=False)), (['--notice-option'], dict(help="""(array: noticeOption) 通知策略 """, dest='noticeOption', required=False)), (['--product'], dict(help="""(string) 资源类型, 可用的资源类型列表请使用 describeProductsForAlarm接口查询。 """, dest='product', required=True)), (['--resource-option'], dict(help="""(resourceOption) NA """, dest='resourceOption', required=True)), @@ -169,6 +177,7 @@ def describe_alarm(self): (['--tags'], dict(help="""(object) 资源维度,指定监控数据实例的维度标签,如resourceId=id。(请确认资源的监控数据带有该标签,否则规则会报数据不足) """, dest='tags', required=False)), (['--web-hook-option'], dict(help="""(webHookOption) NA """, dest='webHookOption', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -201,6 +210,7 @@ def update_alarm(self): arguments=[ (['--alarm-id'], dict(help="""(string) 规则id """, dest='alarmId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -236,6 +246,7 @@ def delete_alarms(self): (['--page-size'], dict(help="""(int) 页面大小,默认为20;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), (['--reference-type'], dict(help="""(int) 联系人类型。0,联系人分组; 1,联系人 """, dest='referenceType', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -271,6 +282,7 @@ def describe_alarm_contacts(self): (['--dimension'], dict(help="""(string) 产品维度,必须指定serviceCode或product才生效。 """, dest='dimension', required=False)), (['--metric-type'], dict(help="""(int) metric类型,取值0、1;默认值:0(常规指标,用于控制台创建报警规则)、1(其它) """, dest='metricType', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -304,6 +316,7 @@ def describe_metrics_for_alarm(self): (['--service-code'], dict(help="""(string) 产品线,从产品线维度筛选 """, dest='serviceCode', required=False)), (['--product'], dict(help="""(string) 产品类型,从产品维度筛选、如redis2.8cluster\redis2.8instance。当serviceCode与product同时指定时,product优先级更高 """, dest='product', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -337,6 +350,7 @@ def describe_products_for_alarm(self): (['--alarm-ids'], dict(help="""(array: string) 告警规则的ID列表 """, dest='alarmIds', required=False)), (['--state'], dict(help="""(int) 启用:1,禁用0, """, dest='state', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -369,6 +383,7 @@ def enable_alarms(self): arguments=[ (['--page-number'], dict(help="""(int) 当前所在页,默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 页面大小,默认为20;取值范围[1, 100] """, dest='pageSize', type=int, required=False)), + (['--data-owner'], dict(help="""(int) 数据所有者,1云监控控制台; 2云鼎。默认为1 """, dest='dataOwner', type=int, required=False)), (['--service-code'], dict(help="""(string) 产品线标识,同一个产品线下可能存在多个product,如(redis下有redis2.8cluster、redis4.0) """, dest='serviceCode', required=False)), (['--product'], dict(help="""(string) 产品标识,默认返回该product下所有dimension的数据。eg:product=redis2.8cluster(redis2.8cluster产品下包含redis2.8-shard与redis2.8-proxy、redis2.8-instance多个维度)。 """, dest='product', required=False)), (['--dimension'], dict(help="""(string) 维度标识、指定该参数时,查询只返回该维度的数据。如redis2.8cluster下存在实例、分片等多个维度 """, dest='dimension', required=False)), @@ -381,6 +396,7 @@ def enable_alarms(self): (['--rule-name'], dict(help="""(string) 规则名称模糊搜索 """, dest='ruleName', required=False)), (['--filters'], dict(help="""(array: filter) serviceCodes - 产品线servicecode,精确匹配,支持多个; resourceIds - 资源Id,精确匹配,支持多个(必须指定serviceCode才会在该serviceCode下根据resourceIds过滤,否则该参数不生效); alarmIds - 规则Id,精确匹配,支持多个 """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -415,6 +431,7 @@ def describe_alarm_history(self): (['--dimension'], dict(help="""(string) NA """, dest='dimension', required=False)), (['--type'], dict(help="""(int) metric的类型,取值0(控制台展示)、1(内部使用,控制台不展示)、2(所有).默认取0 """, dest='type', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -456,7 +473,9 @@ def describe_metrics(self): (['--time-interval'], dict(help="""(string) 查询的时间间隔,最大不超过30天,支持分钟级别,小时级别,天级别,例如:1m、1h、1d """, dest='timeInterval', required=False)), (['--aggr-type'], dict(help="""(string) 聚合方式:max avg min等,用于不同维度之间聚合 """, dest='aggrType', required=False)), (['--down-aggr-type'], dict(help="""(string) 聚合方式:max avg min等,用于将维度内一个周期数据聚合为一个点的聚合方式,默认last """, dest='downAggrType', required=False)), + (['--time-offset'], dict(help="""(string) 时间偏移,可传入30s、1m、1h、1d等数字+单位的形式(其中s秒,m分,h时,d天),当业务侧数据上报存在延迟时,可以传入该参数,该参数会使查询的时间段整体向前偏移.偏移后的开始时间若早于30天前,则开始时间自动设置为30天前;若偏移后结束时间早于30天前,则无效 """, dest='timeOffset', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -464,20 +483,20 @@ def describe_metrics(self): description=''' 根据不同的聚合方式将metric的数据聚合为一个点。downAggrType:last(最后一个点)、max(最大值)、min(最小值)、avg(平均值)。该接口返回值为上报metric的原始值,没有做单位转换。metric介绍:Metrics。 - 示例: jdc monitor describe-one-data-point --metric xxx --service-code xxx --resource-id xxx + 示例: jdc monitor last-downsample --metric xxx --service-code xxx --resource-id xxx ''', ) - def describe_one_data_point(self): + def last_downsample(self): client_factory = ClientFactory('monitor') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.monitor.apis.DescribeOneDataPointRequest import DescribeOneDataPointRequest + from jdcloud_sdk.services.monitor.apis.LastDownsampleRequest import LastDownsampleRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeOneDataPointRequest(params_dict, headers) + req = LastDownsampleRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -491,22 +510,23 @@ def describe_one_data_point(self): (['--metric'], dict(help="""(string) 监控项英文标识(id) """, dest='metric', required=True)), (['--aggr-type'], dict(help="""(string) 聚合方式,用于不同时间轴上的聚合。如balance产品同一个resourceId下存在port=80和port=8080等多种维度。可选值参考:sum、avg、min、max """, dest='aggrType', required=False)), (['--down-sample-type'], dict(help="""(string) 采样方式,用于在时间轴维度上将聚合周期内的数据聚合为一个点。可选值参考:sum(聚合周期内的数据求和)、avg(求平均)、last(最新值)、min(最小值)、max(最大值) """, dest='downSampleType', required=False)), - (['--start-time'], dict(help="""(string) 查询时间范围的开始时间, UTC时间,格式:2016-12-11T00:00:00+0800(注意在url中+要转译为%2B故url中为2016-12-11T00:00:00%2B0800) """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询时间范围的结束时间, UTC时间,格式:2016-12-11T00:00:00+0800(为空时,将由startTime与timeInterval计算得出)(注意在url中+要转译为%2B故url中为2016-12-11T00:00:00%2B0800) """, dest='endTime', required=False)), - (['--time-interval'], dict(help="""(string) 时间间隔:1h,6h,12h,1d,3d,7d,14d,固定时间间隔,timeInterval默认为1h,当前时间往 前1h """, dest='timeInterval', required=False)), + (['--start-time'], dict(help="""(string) 查询时间范围的开始时间, UTC时间,格式:2016-12-11T00:00:00+0800(注意在url中+要转译为%2B故url中为2016-12-11T00:00:00%2B0800); 开始时间不得晚于当前时间,开始时间不得早于 30 天前; """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询时间范围的结束时间, UTC时间,格式:2016-12-11T00:00:00+0800(为空时,将由startTime与timeInterval计算得出)(注意在url中+要转译为%2B故url中为2016-12-11T00:00:00%2B0800); 默认为当前时间,结束时间不得晚于当前时间. 如果晚于, 会被默认设成当前时间, 结束时间不得早于 30 天前.; """, dest='endTime', required=False)), + (['--time-interval'], dict(help="""(string) 时间间隔:1h,6h,12h,1d,3d,7d,14d,固定时间间隔,timeInterval默认为1h,当前时间往 前1h; 如果指定了 startTime 和 endTime,可以不用设置. 默认的,三个参数都不设置查询 1h 内数据.; timeInterval 默认值 1h; endTime 默认值, 当前时间; startTime 默认值, endTime - timeInterval; """, dest='timeInterval', required=False)), (['--tags'], dict(help="""(array: tagFilter) 监控指标数据的维度信息,根据tags来筛选指标数据不同的维度 """, dest='tags', required=False)), - (['--group-by'], dict(help="""(bool) 是否对查询的tags分组 """, dest='groupBy', required=False)), - (['--rate'], dict(help="""(bool) 是否求速率 """, dest='rate', required=False)), + (['--group-by'], dict(help="""(bool) 是否对查询的tags分组 """, dest='groupBy', type=bool, required=False)), + (['--rate'], dict(help="""(bool) 是否求速率。仅对累积类型指标有意义, 默认 false """, dest='rate', type=bool, required=False)), (['--service-code'], dict(help="""(string) 资源的类型,取值vm, lb, ip, database 等,describeServices:查询己接入云监控的产品线列表 """, dest='serviceCode', required=False)), (['--dimension'], dict(help="""(string) 资源的维度。查询serviceCode下可用的维度请使用describeServices接口 """, dest='dimension', required=False)), (['--resource-id'], dict(help="""(string) 资源的uuid """, dest='resourceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看某资源单个监控项数据,metric介绍:Metrics,可以使用接口describeMetrics:查询产品线可用的metric列表。 ''', + help=''' 查看某资源单个监控项数据.; metric介绍: Metrics; 可以使用接口:describeMetrics:查询产品线可用的metric列表。; 查询起止时间统一向下对齐10s, 举例:开始时间为 08:45:45 会对齐到08:45:40; ''', description=''' - 查看某资源单个监控项数据,metric介绍:Metrics,可以使用接口describeMetrics:查询产品线可用的metric列表。。 + 查看某资源单个监控项数据.; metric介绍: Metrics; 可以使用接口:describeMetrics:查询产品线可用的metric列表。; 查询起止时间统一向下对齐10s, 举例:开始时间为 08:45:45 会对齐到08:45:40; 。 示例: jdc monitor describe-metric-data --metric xxx --resource-id xxx ''', @@ -529,11 +549,53 @@ def describe_metric_data(self): except Exception as e: print(e) + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) region """, dest='regionId', required=False)), + (['--tag-key'], dict(help="""(string) region """, dest='tagKey', required=True)), + (['--service-code'], dict(help="""(string) serviceCode """, dest='serviceCode', required=True)), + (['--resource-id'], dict(help="""(string) 资源标识 """, dest='resourceId', required=True)), + (['--metric'], dict(help="""(string) metric """, dest='metric', required=False)), + (['--start-time'], dict(help="""(string) 查询时间范围的开始时间(如不传,则默认为1时前), UTC时间,格式:2016-12-11T00:00:00+0800(注意在url中+,:要转译,如2019-10-23T10%3A33%3A31%2B0800)。对于非连续的时序数据,开始时间无法保证准确性 """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询时间范围的结束时间(如不传,则默认为当前), UTC时间,格式:2016-12-11T00:00:00+0800(注意在url中+,:要转译,如2019-10-23T10%3A33%3A31%2B0800).对于非连续的时序数据,结束时间无法保证准确性 """, dest='endTime', required=False)), + (['--time-interval'], dict(help="""(string) 时间间隔:1h,6h,12h,1d,3d,7d,14d,固定时间间隔,timeInterval默认为1h,当前时间往 前1h """, dest='timeInterval', required=False)), + (['--tags'], dict(help="""(array: tagFilter) 根据tags进行筛选(传入*和不传的效果一致) """, dest='tags', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询某资源下指定tag key的tag value ''', + description=''' + 查询某资源下指定tag key的tag value。 + + 示例: jdc monitor describe-tag-values --tag-key xxx --service-code xxx --resource-id xxx + ''', + ) + def describe_tag_values(self): + client_factory = ClientFactory('monitor') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.monitor.apis.DescribeTagValuesRequest import DescribeTagValuesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeTagValuesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--filters'], dict(help="""(array: filter) 服务码列表; filter name 为serviceCodes表示查询多个产品线的规则 """, dest='filters', required=False)), (['--product-type'], dict(help="""(int) 要查询的产品线类型 0:all 1:资源监控 2:其它 默认:1。若指定了查询的serviceCode,则忽略该参数 """, dest='productType', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -562,10 +624,85 @@ def describe_services(self): except Exception as e: print(e) + @expose( + arguments=[ + (['--app-code'], dict(help="""(string) 目前统一用jcloud """, dest='appCode', required=True)), + (['--service-code'], dict(help="""(string) 资源的类型,取值vm,ip,database,storage,disk,cdn,redis,balance,nat_gw,db_ro,vpn,ddos等,新接入的产品要求与opentapi命名的产品线名称一致 """, dest='serviceCode', required=True)), + (['--region'], dict(help="""(string) 地域信息,如 cn-north-1 等 """, dest='region', required=True)), + (['--resource-id'], dict(help="""(string) 资源的唯一表示,一般为uuid """, dest='resourceId', required=True)), + (['--data-points'], dict(help="""(array: dataPointX) 监控数据点 """, dest='dataPoints', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 监控数据上报。 ''', + description=''' + 监控数据上报。。 + + 示例: jdc monitor put-product-metric-data --app-code xxx --service-code xxx --region xxx --resource-id xxx --data-points ['{"":""}'] + ''', + ) + def put_product_metric_data(self): + client_factory = ClientFactory('monitor') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.monitor.apis.PutRequest import PutRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = PutRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--app-code'], dict(help="""(string) 目前统一用jcloud """, dest='appCode', required=True)), + (['--service-code'], dict(help="""(string) 资源的类型,取值vm,ip,database,storage,disk,cdn,redis,balance,nat_gw,db_ro,vpn,ddos等,新接入的产品要求与opentapi命名的产品线名称一致 """, dest='serviceCode', required=True)), + (['--region'], dict(help="""(string) 地域信息,如 cn-north-1 等 """, dest='region', required=True)), + (['--resource-id'], dict(help="""(string) 资源的唯一表示,一般为uuid """, dest='resourceId', required=True)), + (['--data-points'], dict(help="""(array: dataPointX) 监控数据点 """, dest='dataPoints', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 监控数据上报。 ''', + description=''' + 监控数据上报。。 + + 示例: jdc monitor put-product-metric-data --app-code xxx --service-code xxx --region xxx --resource-id xxx --data-points ['{"":""}'] + ''', + ) + def put_product_metric_data(self): + client_factory = ClientFactory('monitor') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.monitor.apis.PutProductMetricDataRequest import PutProductMetricDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = PutProductMetricDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--metric-data-list'], dict(help="""(array: metricDataCm) 数据参数 """, dest='metricDataList', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -598,6 +735,7 @@ def put_custom_metric_data(self): arguments=[ (['--metric-data-list'], dict(help="""(array: metricDataCm) 数据参数 """, dest='metricDataList', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -628,7 +766,45 @@ def put_custom_metric_data(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-alarms','create-alarm','describe-alarm','update-alarm','delete-alarms','describe-alarm-contacts','describe-metrics-for-alarm','describe-products-for-alarm','enable-alarms','describe-alarm-history','describe-metrics','describe-one-data-point','describe-metric-data','describe-services','put-custom-metric-data','put-custom-metric-data',], required=True)), + (['--region-id'], dict(help="""(string) region """, dest='regionId', required=False)), + (['--namespace-uid'], dict(help="""(string) namespace """, dest='namespaceUID', required=True)), + (['--end-time'], dict(help="""(string) 查询时间范围的结束时间, UTC时间,格式:2016-12-11T00:00:00+0800(为空时,将由startTime与timeInterval计算得出) """, dest='endTime', required=False)), + (['--query'], dict(help="""(queryOption) NA """, dest='query', required=True)), + (['--start-time'], dict(help="""(string) 查询时间范围的开始时间, UTC时间,格式:2016-12-11T00:00:00+0800 """, dest='startTime', required=False)), + (['--time-interval'], dict(help="""(string) 时间间隔:1h,6h,12h,1d,3d,7d,14d,固定时间间隔,timeInterval默认为1h,当前时间往 前1h """, dest='timeInterval', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 通过指定维度查询自定义监控的数据 ''', + description=''' + 通过指定维度查询自定义监控的数据。 + + 示例: jdc monitor describe-custom-metric-data --namespace-uid xxx --query '{"":""}' + ''', + ) + def describe_custom_metric_data(self): + client_factory = ClientFactory('monitor') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.monitor.apis.DescribeCustomMetricDataRequest import DescribeCustomMetricDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeCustomMetricDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--api'], dict(help="""(string) api name """, choices=['describe-alarms','create-alarm','describe-alarm','update-alarm','delete-alarms','describe-alarm-contacts','describe-metrics-for-alarm','describe-products-for-alarm','enable-alarms','describe-alarm-history','describe-metrics','last-downsample','describe-metric-data','describe-tag-values','describe-services','put-product-metric-data','put-product-metric-data','put-custom-metric-data','put-custom-metric-data','describe-custom-metric-data',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/mps.py b/jdcloud_cli/controllers/services/mps.py deleted file mode 100644 index 0475054..0000000 --- a/jdcloud_cli/controllers/services/mps.py +++ /dev/null @@ -1,331 +0,0 @@ -# coding=utf8 - -# Copyright 2018 JDCLOUD.COM -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# NOTE: This class is auto generated by the jdcloud code generator program. - -from argparse import RawTextHelpFormatter -from jdcloud_cli.cement.ext.ext_argparse import expose -from jdcloud_cli.controllers.base_controller import BaseController -from jdcloud_cli.client_factory import ClientFactory -from jdcloud_cli.parameter_builder import collect_user_args, collect_user_headers -from jdcloud_cli.printer import Printer -from jdcloud_cli.skeleton import Skeleton - - -class MpsController(BaseController): - class Meta: - label = 'mps' - help = '媒体处理 API' - description = ''' - mps cli 子命令,媒体处理相关接口。 - OpenAPI文档地址为:https://docs.jdcloud.com/cn/media-processing-service/api/overview - ''' - stacked_on = 'base' - stacked_type = 'nested' - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) 区域ID """, dest='regionId', required=False)), - (['--bucket-name'], dict(help="""(string) Bucket名称 """, dest='bucketName', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 获取bucket的图片样式分隔符配置 ''', - description=''' - 获取bucket的图片样式分隔符配置。 - - 示例: jdc mps get-style-delimiter --bucket-name xxx - ''', - ) - def get_style_delimiter(self): - client_factory = ClientFactory('mps') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.mps.apis.GetStyleDelimiterRequest import GetStyleDelimiterRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = GetStyleDelimiterRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) 区域ID """, dest='regionId', required=False)), - (['--bucket-name'], dict(help="""(string) Bucket名称 """, dest='bucketName', required=True)), - (['--delimiters'], dict(help="""(array: string) 图片样式分隔符配置(JSON数组);支持的分隔符包含:["-", "_", "/", "!"] """, dest='delimiters', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 设置图片样式分隔符 ''', - description=''' - 设置图片样式分隔符。 - - 示例: jdc mps set-style-delimiter --bucket-name xxx - ''', - ) - def set_style_delimiter(self): - client_factory = ClientFactory('mps') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.mps.apis.SetStyleDelimiterRequest import SetStyleDelimiterRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = SetStyleDelimiterRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) 区域ID """, dest='regionId', required=False)), - (['--bucket-name'], dict(help="""(string) Bucket名称 """, dest='bucketName', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 删除bucket的图片样式分隔符配置 ''', - description=''' - 删除bucket的图片样式分隔符配置。 - - 示例: jdc mps delete-style-delimiter --bucket-name xxx - ''', - ) - def delete_style_delimiter(self): - client_factory = ClientFactory('mps') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.mps.apis.DeleteStyleDelimiterRequest import DeleteStyleDelimiterRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DeleteStyleDelimiterRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) region id """, dest='regionId', required=False)), - (['--status'], dict(help="""(string) task 状态 (PENDING, RUNNING, SUCCESS, FAILED) """, dest='status', required=False)), - (['--begin'], dict(help="""(string) 开始时间 时间格式(GMT): yyyy-MM-dd'T'HH:mm:ss.SSS'Z' """, dest='begin', required=False)), - (['--end'], dict(help="""(string) 结束时间 时间格式(GMT): yyyy-MM-dd'T'HH:mm:ss.SSS'Z' """, dest='end', required=False)), - (['--marker'], dict(help="""(string) 查询标记 """, dest='marker', required=False)), - (['--limit'], dict(help="""(int) 查询记录数 [1, 1000] """, dest='limit', type=int, required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查询截图任务,返回满足查询条件的任务列表。 ''', - description=''' - 查询截图任务,返回满足查询条件的任务列表。。 - - 示例: jdc mps list-thumbnail-task - ''', - ) - def list_thumbnail_task(self): - client_factory = ClientFactory('mps') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.mps.apis.ListThumbnailTaskRequest import ListThumbnailTaskRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = ListThumbnailTaskRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) region id """, dest='regionId', required=False)), - (['--task-id'], dict(help="""(string) 任务ID (readonly) """, dest='taskID', required=False)), - (['--status'], dict(help="""(string) 状态 (SUCCESS, ERROR, PENDDING, RUNNING) (readonly) """, dest='status', required=False)), - (['--error-code'], dict(help="""(int) 错误码 (readonly) """, dest='errorCode', type=int, required=False)), - (['--created-time'], dict(help="""(string) 任务创建时间 时间格式(GMT): yyyy-MM-dd’T’HH:mm:ss.SSS’Z’ (readonly) """, dest='createdTime', required=False)), - (['--last-updated-time'], dict(help="""(string) 任务创建时间 时间格式(GMT): yyyy-MM-dd’T’HH:mm:ss.SSS’Z’ (readonly) """, dest='lastUpdatedTime', required=False)), - (['--source'], dict(help="""(thumbnailTaskSource) NA """, dest='source', required=True)), - (['--target'], dict(help="""(thumbnailTaskTarget) NA """, dest='target', required=True)), - (['--rule'], dict(help="""(thumbnailTaskRule) NA """, dest='rule', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 创建截图任务,创建成功时返回任务ID。本接口用于截取指定时间点的画面。 ''', - description=''' - 创建截图任务,创建成功时返回任务ID。本接口用于截取指定时间点的画面。。 - - 示例: jdc mps create-thumbnail-task --source '{"":""}' --target '{"":""}' - ''', - ) - def create_thumbnail_task(self): - client_factory = ClientFactory('mps') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.mps.apis.CreateThumbnailTaskRequest import CreateThumbnailTaskRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = CreateThumbnailTaskRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) region id """, dest='regionId', required=False)), - (['--task-id'], dict(help="""(string) task id """, dest='taskId', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 根据任务ID获取截图任务。 ''', - description=''' - 根据任务ID获取截图任务。。 - - 示例: jdc mps get-thumbnail-task --task-id xxx - ''', - ) - def get_thumbnail_task(self): - client_factory = ClientFactory('mps') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.mps.apis.GetThumbnailTaskRequest import GetThumbnailTaskRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = GetThumbnailTaskRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) region id """, dest='regionId', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 获取媒体处理通知 ''', - description=''' - 获取媒体处理通知。 - - 示例: jdc mps get-notification - ''', - ) - def get_notification(self): - client_factory = ClientFactory('mps') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.mps.apis.GetNotificationRequest import GetNotificationRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = GetNotificationRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) region id """, dest='regionId', required=False)), - (['--enabled'], dict(help="""(bool) 是否启用通知 """, dest='enabled', required=True)), - (['--endpoint'], dict(help="""(string) 通知endpoint, 当前支持http://和https:// """, dest='endpoint', required=False)), - (['--events'], dict(help="""(array: string) 触发通知的事件集合 (mpsTranscodeComplete, mpsThumbnailComplete) """, dest='events', required=False)), - (['--notify-strategy'], dict(help="""(string) 重试策略, BACKOFF_RETRY: 退避重试策略, 重试 3 次, 每次重试的间隔时间是 10秒 到 20秒 之间的随机值; EXPONENTIAL_DECAY_RETRY: 指数衰减重试, 重试 176 次, 每次重试的间隔时间指数递增至 512秒, 总计重试时间为1天; 每次重试的具体间隔为: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512 ... 512 秒(共167个512) """, dest='notifyStrategy', required=False)), - (['--notify-content-format'], dict(help="""(string) 描述了向 Endpoint 推送的消息格式, JSON: 包含消息正文和消息属性, SIMPLIFIED: 消息体即用户发布的消息, 不包含任何属性信息 """, dest='notifyContentFormat', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 设置媒体处理通知, 在设置Notification时会对endpoint进行校验, 设置时会对endpoint发一条SubscriptionConfirmation(x-jdcloud-message-type头)的通知, 要求把Message内容进行base64编码返回给系统(body)进行校验 ''', - description=''' - 设置媒体处理通知, 在设置Notification时会对endpoint进行校验, 设置时会对endpoint发一条SubscriptionConfirmation(x-jdcloud-message-type头)的通知, 要求把Message内容进行base64编码返回给系统(body)进行校验。 - - 示例: jdc mps set-notification --enabled true - ''', - ) - def set_notification(self): - client_factory = ClientFactory('mps') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.mps.apis.SetNotificationRequest import SetNotificationRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = SetNotificationRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['get-style-delimiter','set-style-delimiter','delete-style-delimiter','list-thumbnail-task','create-thumbnail-task','get-thumbnail-task','get-notification','set-notification',], required=True)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 生成单个API接口的json骨架空字符串 ''', - description=''' - 生成单个API接口的json骨架空字符串。 - - 示例: jdc nc generate-skeleton --api describeContainer ''', - ) - def generate_skeleton(self): - skeleton = Skeleton('mps', self.app.pargs.api) - skeleton.show() diff --git a/jdcloud_cli/controllers/services/nativecontainer.py b/jdcloud_cli/controllers/services/nativecontainer.py index d63192b..35876b8 100644 --- a/jdcloud_cli/controllers/services/nativecontainer.py +++ b/jdcloud_cli/controllers/services/nativecontainer.py @@ -44,30 +44,29 @@ class Meta: (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) containerId - 实例ID,精确匹配,支持多个; privateIpAddress - 主网卡IP地址,精确匹配,支持单个; az - 可用区,精确匹配,支持多个; vpcId - 私有网络ID,精确匹配,支持多个; status - 容器状态,精确匹配,支持多个; name - 容器名称,模糊匹配,支持单个; subnetId - 子网ID,精确匹配,支持多个; securityGroups - 安全组 id,精确匹配,支持多个; """, dest='filters', required=False)), - (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), + (['--filters'], dict(help="""(array: filter) name - secret名称,支持模糊搜索; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量查询原生容器的详细信息
; 此接口支持分页查询,默认每页20条。; ''', + help=''' 查询 secret 列表。
; 此接口支持分页查询,默认每页20条。; ''', description=''' - 批量查询原生容器的详细信息
; 此接口支持分页查询,默认每页20条。; + 查询 secret 列表。
; 此接口支持分页查询,默认每页20条。; - 示例: jdc nativecontainer describe-containers + 示例: jdc nativecontainer describe-secrets ''', ) - def describe_containers(self): + def describe_secrets(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.DescribeContainersRequest import DescribeContainersRequest + from jdcloud_sdk.services.nativecontainer.apis.DescribeSecretsRequest import DescribeSecretsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeContainersRequest(params_dict, headers) + req = DescribeSecretsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -78,31 +77,31 @@ def describe_containers(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--container-spec'], dict(help="""(containerSpec) 创建容器规格 """, dest='containerSpec', required=True)), - (['--max-count'], dict(help="""(int) 购买实例数量;取值范围:[1,100] """, dest='maxCount', type=int, required=True)), - (['--client-token'], dict(help="""(string) 保证请求幂等性 """, dest='clientToken', required=False)), + (['--name'], dict(help="""(string) 镜像仓库认证信息名称,不能重复; """, dest='name', required=True)), + (['--secret-type'], dict(help="""(string) 镜像仓库认证信息类型,目前仅支持:docker-registry 类型,用来和docker registry认证的类型。; """, dest='secretType', required=True)), + (['--data'], dict(help="""(dockerRegistryData) 镜像仓库认证信息数据。
; 必须包含server、username、password 字段,email 字段是可选的。
; """, dest='data', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一台或多台指定配置容器; - 创建容器需要通过实名认证; - 镜像; - 容器的镜像通过镜像名称来确定; - nginx:tag, mysql/mysql-server:tag这样命名的镜像表示docker hub官方镜像; - container-registry/image:tag这样命名的镜像表示私有仓储的镜像; - 私有仓储必须兼容docker registry认证机制,并通过secret来保存机密信息; - hostname规范; - 支持两种方式:以标签方式书写或以完整主机名方式书写; - 标签规范; - 0-9,a-z(不分大小写)和-(减号),其他的都是无效的字符串; - 不能以减号开始,也不能以减号结尾; - 最小1个字符,最大63个字符; - 完整的主机名由一系列标签与点连接组成; - 标签与标签之间使用“.”(点)进行连接; - 不能以“.”(点)开始,也不能以“.”(点)结尾; - 整个主机名(包括标签以及分隔点“.”)最多有63个ASCII字符; - 网络配置; - 指定主网卡配置信息; - 必须指定vpcId、subnetId、securityGroupIds; - 可以指定elasticIp规格来约束创建的弹性IP,带宽取值范围[1-200]Mbps,步进1Mbps; - 可以指定网卡的主IP(primaryIpAddress)和辅助IP(secondaryIpAddresses),此时maxCount只能为1; - 可以指定希望的辅助IP个数(secondaryIpAddressCount)让系统自动创建内网IP; - 可以设置网卡的自动删除autoDelete属性,指明是否删除实例时自动删除网卡; - 安全组securityGroup需与子网Subnet在同一个私有网络VPC内; - 每个容器至多指定5个安全组; - 主网卡deviceIndex设置为0; - 存储; - volume分为root volume和data volume,root volume的挂载目录是/,data volume的挂载目录可以随意指定; - volume的底层存储介质当前只支持cloud类别,也就是云硬盘; - 云盘类型为 ssd.io1 时,用户可以指定 iops,其他类型云盘无效,对已经存在的云盘无效,具体规则如下; - 步长 10; - 范围 [200,min(32000,size*50)]; - 默认值 size*30; - root volume; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[10,100]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - data volume; - data volume当前只能选择cloud类别; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[20,2000]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - 可以从快照创建磁盘; - 单个容器可以挂载7个data volume; - 容器日志; - default:默认在本地分配10MB的存储空间,自动rotate; - 其他; - 创建完成后,容器状态为running; - maxCount为最大努力,不保证一定能达到maxCount; ''', + help=''' 创建一个 secret,用于存放镜像仓库认证信息。; ''', description=''' - 创建一台或多台指定配置容器; - 创建容器需要通过实名认证; - 镜像; - 容器的镜像通过镜像名称来确定; - nginx:tag, mysql/mysql-server:tag这样命名的镜像表示docker hub官方镜像; - container-registry/image:tag这样命名的镜像表示私有仓储的镜像; - 私有仓储必须兼容docker registry认证机制,并通过secret来保存机密信息; - hostname规范; - 支持两种方式:以标签方式书写或以完整主机名方式书写; - 标签规范; - 0-9,a-z(不分大小写)和-(减号),其他的都是无效的字符串; - 不能以减号开始,也不能以减号结尾; - 最小1个字符,最大63个字符; - 完整的主机名由一系列标签与点连接组成; - 标签与标签之间使用“.”(点)进行连接; - 不能以“.”(点)开始,也不能以“.”(点)结尾; - 整个主机名(包括标签以及分隔点“.”)最多有63个ASCII字符; - 网络配置; - 指定主网卡配置信息; - 必须指定vpcId、subnetId、securityGroupIds; - 可以指定elasticIp规格来约束创建的弹性IP,带宽取值范围[1-200]Mbps,步进1Mbps; - 可以指定网卡的主IP(primaryIpAddress)和辅助IP(secondaryIpAddresses),此时maxCount只能为1; - 可以指定希望的辅助IP个数(secondaryIpAddressCount)让系统自动创建内网IP; - 可以设置网卡的自动删除autoDelete属性,指明是否删除实例时自动删除网卡; - 安全组securityGroup需与子网Subnet在同一个私有网络VPC内; - 每个容器至多指定5个安全组; - 主网卡deviceIndex设置为0; - 存储; - volume分为root volume和data volume,root volume的挂载目录是/,data volume的挂载目录可以随意指定; - volume的底层存储介质当前只支持cloud类别,也就是云硬盘; - 云盘类型为 ssd.io1 时,用户可以指定 iops,其他类型云盘无效,对已经存在的云盘无效,具体规则如下; - 步长 10; - 范围 [200,min(32000,size*50)]; - 默认值 size*30; - root volume; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[10,100]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - data volume; - data volume当前只能选择cloud类别; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[20,2000]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - 可以从快照创建磁盘; - 单个容器可以挂载7个data volume; - 容器日志; - default:默认在本地分配10MB的存储空间,自动rotate; - 其他; - 创建完成后,容器状态为running; - maxCount为最大努力,不保证一定能达到maxCount; + 创建一个 secret,用于存放镜像仓库认证信息。; - 示例: jdc nativecontainer create-containers --container-spec {"":""} --max-count 0 + 示例: jdc nativecontainer create-secret --name xxx --secret-type xxx --data {"":""} ''', ) - def create_containers(self): + def create_secret(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.CreateContainersRequest import CreateContainersRequest + from jdcloud_sdk.services.nativecontainer.apis.CreateSecretRequest import CreateSecretRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateContainersRequest(params_dict, headers) + req = CreateSecretRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -113,29 +112,29 @@ def create_containers(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--name'], dict(help="""(string) Secret Name """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询一台原生容器的详细信息; ''', + help=''' 查询单个 secret 详情; ''', description=''' - 查询一台原生容器的详细信息; + 查询单个 secret 详情; - 示例: jdc nativecontainer describe-container --container-id xxx + 示例: jdc nativecontainer describe-secret --name xxx ''', ) - def describe_container(self): + def describe_secret(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.DescribeContainerRequest import DescribeContainerRequest + from jdcloud_sdk.services.nativecontainer.apis.DescribeSecretRequest import DescribeSecretRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeContainerRequest(params_dict, headers) + req = DescribeSecretRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -146,29 +145,29 @@ def describe_container(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--name'], dict(help="""(string) Secret Name """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 容器状态必须为 stopped、running 或 error状态。
; 按量付费的实例,如不主动删除将一直运行,不再使用的实例,可通过本接口主动停用。
; 只能支持主动删除按配置计费类型的实例。包年包月过期的容器也可以删除,其它的情况还请发工单系统。计费状态异常的容器无法删除。; ''', + help=''' 删除单个 secret; ''', description=''' - 容器状态必须为 stopped、running 或 error状态。
; 按量付费的实例,如不主动删除将一直运行,不再使用的实例,可通过本接口主动停用。
; 只能支持主动删除按配置计费类型的实例。包年包月过期的容器也可以删除,其它的情况还请发工单系统。计费状态异常的容器无法删除。; + 删除单个 secret; - 示例: jdc nativecontainer delete-container --container-id xxx + 示例: jdc nativecontainer delete-secret --name xxx ''', ) - def delete_container(self): + def delete_secret(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.DeleteContainerRequest import DeleteContainerRequest + from jdcloud_sdk.services.nativecontainer.apis.DeleteSecretRequest import DeleteSecretRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteContainerRequest(params_dict, headers) + req = DeleteSecretRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -179,29 +178,29 @@ def delete_container(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--resource-type'], dict(help="""(string) resourceType - 资源类型,支持 [container, pod, secret]; """, dest='resourceType', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启动处于关闭状态的单个容器,处在任务执行中的容器无法启动。
; 容器实例或其绑定的云盘已欠费时,容器将无法正常启动。
; ''', + help=''' 查询资源的配额,支持:原生容器 pod 和 secret.; ''', description=''' - 启动处于关闭状态的单个容器,处在任务执行中的容器无法启动。
; 容器实例或其绑定的云盘已欠费时,容器将无法正常启动。
; + 查询资源的配额,支持:原生容器 pod 和 secret.; - 示例: jdc nativecontainer start-container --container-id xxx + 示例: jdc nativecontainer describe-quota --resource-type xxx ''', ) - def start_container(self): + def describe_quota(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.StartContainerRequest import StartContainerRequest + from jdcloud_sdk.services.nativecontainer.apis.DescribeQuotaRequest import DescribeQuotaRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartContainerRequest(params_dict, headers) + req = DescribeQuotaRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -212,29 +211,32 @@ def start_container(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) containerId - 实例ID,精确匹配,支持多个; privateIpAddress - 主网卡IP地址,模糊匹配,支持单个; az - 可用区,精确匹配,支持多个; vpcId - 私有网络ID,精确匹配,支持多个; status - 容器状态,精确匹配,支持多个; name - 容器名称,模糊匹配,支持单个; subnetId - 子网ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 停止处于运行状态的单个实例,处于任务执行中的容器无法启动。; ''', + help=''' 批量查询原生容器的详细信息
; 此接口支持分页查询,默认每页20条。; ''', description=''' - 停止处于运行状态的单个实例,处于任务执行中的容器无法启动。; + 批量查询原生容器的详细信息
; 此接口支持分页查询,默认每页20条。; - 示例: jdc nativecontainer stop-container --container-id xxx + 示例: jdc nativecontainer describe-containers ''', ) - def stop_container(self): + def describe_containers(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.StopContainerRequest import StopContainerRequest + from jdcloud_sdk.services.nativecontainer.apis.DescribeContainersRequest import DescribeContainersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopContainerRequest(params_dict, headers) + req = DescribeContainersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -245,31 +247,31 @@ def stop_container(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--name'], dict(help="""(string) 容器名称 """, dest='name', required=False)), - (['--description'], dict(help="""(string) 容器描述 """, dest='description', required=False)), + (['--container-spec'], dict(help="""(containerSpec) 创建容器规格 """, dest='containerSpec', required=True)), + (['--max-count'], dict(help="""(int) 购买实例数量;取值范围:[1,100] """, dest='maxCount', type=int, required=True)), + (['--client-token'], dict(help="""(string) 保证请求幂等性 """, dest='clientToken', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改容器的 名称 和 描述。
; name 和 description 必须要指定一个; ''', + help=''' 创建一台或多台指定配置容器; - 创建容器需要通过实名认证; - 镜像; - 容器的镜像通过镜像名称来确定; - nginx:tag, mysql/mysql-server:tag这样命名的镜像表示docker hub官方镜像; - container-registry/image:tag这样命名的镜像表示私有仓储的镜像; - 私有仓储必须兼容docker registry认证机制,并通过secret来保存机密信息; - hostname规范; - 支持两种方式:以标签方式书写或以完整主机名方式书写; - 标签规范; - 0-9,a-z(不分大小写)和-(减号),其他的都是无效的字符串; - 不能以减号开始,也不能以减号结尾; - 最小1个字符,最大63个字符; - 完整的主机名由一系列标签与点连接组成; - 标签与标签之间使用“.”(点)进行连接; - 不能以“.”(点)开始,也不能以“.”(点)结尾; - 整个主机名(包括标签以及分隔点“.”)最多有63个ASCII字符; - 网络配置; - 指定主网卡配置信息; - 必须指定vpcId、subnetId、securityGroupIds; - 可以指定elasticIp规格来约束创建的弹性IP,带宽取值范围[1-200]Mbps,步进1Mbps; - 可以指定网卡的主IP(primaryIpAddress)和辅助IP(secondaryIpAddresses),此时maxCount只能为1; - 可以指定希望的辅助IP个数(secondaryIpAddressCount)让系统自动创建内网IP; - 可以设置网卡的自动删除autoDelete属性,指明是否删除实例时自动删除网卡; - 安全组securityGroup需与子网Subnet在同一个私有网络VPC内; - 每个容器至多指定5个安全组; - 主网卡deviceIndex设置为0; - 存储; - volume分为root volume和data volume,root volume的挂载目录是/,data volume的挂载目录可以随意指定; - volume的底层存储介质当前只支持cloud类别,也就是云硬盘; - 云盘类型为 ssd.io1 时,用户可以指定 iops,其他类型云盘无效,对已经存在的云盘无效,具体规则如下; - 步长 10; - 范围 [200,min(32000,size*50)]; - 默认值 size*30; - root volume; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[10,100]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - data volume; - data volume当前只能选择cloud类别; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[20,2000]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - 可以从快照创建磁盘; - 单个容器可以挂载7个data volume; - 容器日志; - default:默认在本地分配10MB的存储空间,自动rotate; - 其他; - 创建完成后,容器状态为running; - maxCount为最大努力,不保证一定能达到maxCount; ''', description=''' - 修改容器的 名称 和 描述。
; name 和 description 必须要指定一个; + 创建一台或多台指定配置容器; - 创建容器需要通过实名认证; - 镜像; - 容器的镜像通过镜像名称来确定; - nginx:tag, mysql/mysql-server:tag这样命名的镜像表示docker hub官方镜像; - container-registry/image:tag这样命名的镜像表示私有仓储的镜像; - 私有仓储必须兼容docker registry认证机制,并通过secret来保存机密信息; - hostname规范; - 支持两种方式:以标签方式书写或以完整主机名方式书写; - 标签规范; - 0-9,a-z(不分大小写)和-(减号),其他的都是无效的字符串; - 不能以减号开始,也不能以减号结尾; - 最小1个字符,最大63个字符; - 完整的主机名由一系列标签与点连接组成; - 标签与标签之间使用“.”(点)进行连接; - 不能以“.”(点)开始,也不能以“.”(点)结尾; - 整个主机名(包括标签以及分隔点“.”)最多有63个ASCII字符; - 网络配置; - 指定主网卡配置信息; - 必须指定vpcId、subnetId、securityGroupIds; - 可以指定elasticIp规格来约束创建的弹性IP,带宽取值范围[1-200]Mbps,步进1Mbps; - 可以指定网卡的主IP(primaryIpAddress)和辅助IP(secondaryIpAddresses),此时maxCount只能为1; - 可以指定希望的辅助IP个数(secondaryIpAddressCount)让系统自动创建内网IP; - 可以设置网卡的自动删除autoDelete属性,指明是否删除实例时自动删除网卡; - 安全组securityGroup需与子网Subnet在同一个私有网络VPC内; - 每个容器至多指定5个安全组; - 主网卡deviceIndex设置为0; - 存储; - volume分为root volume和data volume,root volume的挂载目录是/,data volume的挂载目录可以随意指定; - volume的底层存储介质当前只支持cloud类别,也就是云硬盘; - 云盘类型为 ssd.io1 时,用户可以指定 iops,其他类型云盘无效,对已经存在的云盘无效,具体规则如下; - 步长 10; - 范围 [200,min(32000,size*50)]; - 默认值 size*30; - root volume; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[10,100]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - data volume; - data volume当前只能选择cloud类别; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[20,2000]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - 可以从快照创建磁盘; - 单个容器可以挂载7个data volume; - 容器日志; - default:默认在本地分配10MB的存储空间,自动rotate; - 其他; - 创建完成后,容器状态为running; - maxCount为最大努力,不保证一定能达到maxCount; - 示例: jdc nativecontainer modify-container-attribute --container-id xxx + 示例: jdc nativecontainer create-containers --container-spec {"":""} --max-count 5 ''', ) - def modify_container_attribute(self): + def create_containers(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.ModifyContainerAttributeRequest import ModifyContainerAttributeRequest + from jdcloud_sdk.services.nativecontainer.apis.CreateContainersRequest import CreateContainersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyContainerAttributeRequest(params_dict, headers) + req = CreateContainersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -281,29 +283,28 @@ def modify_container_attribute(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--elastic-ip-id'], dict(help="""(string) 弹性IP ID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 容器绑定弹性公网 IP,绑定的是主网卡、主内网IP对应的弹性IP.
; 一台云主机只能绑定一个弹性公网 IP(主网卡),若主网卡已存在弹性公网IP,会返回错误。
; 如果是黑名单中的用户,会返回错误。; ''', + help=''' 查询一台原生容器的详细信息; ''', description=''' - 容器绑定弹性公网 IP,绑定的是主网卡、主内网IP对应的弹性IP.
; 一台云主机只能绑定一个弹性公网 IP(主网卡),若主网卡已存在弹性公网IP,会返回错误。
; 如果是黑名单中的用户,会返回错误。; + 查询一台原生容器的详细信息; - 示例: jdc nativecontainer associate-elastic-ip --container-id xxx --elastic-ip-id xxx + 示例: jdc nativecontainer describe-container --container-id xxx ''', ) - def associate_elastic_ip(self): + def describe_container(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.AssociateElasticIpRequest import AssociateElasticIpRequest + from jdcloud_sdk.services.nativecontainer.apis.DescribeContainerRequest import DescribeContainerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AssociateElasticIpRequest(params_dict, headers) + req = DescribeContainerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -315,29 +316,28 @@ def associate_elastic_ip(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--elastic-ip-id'], dict(help="""(string) 弹性IP ID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 容器解绑公网 IP,解绑的是主网卡、主内网 IP 对应的弹性 IP.; ''', + help=''' 容器状态必须为 stopped、running 或 error状态。
; 按量付费的实例,如不主动删除将一直运行,不再使用的实例,可通过本接口主动停用。
; 只能支持主动删除按配置计费类型的实例。包年包月过期的容器也可以删除,其它的情况还请发工单系统。计费状态异常的容器无法删除。; ''', description=''' - 容器解绑公网 IP,解绑的是主网卡、主内网 IP 对应的弹性 IP.; + 容器状态必须为 stopped、running 或 error状态。
; 按量付费的实例,如不主动删除将一直运行,不再使用的实例,可通过本接口主动停用。
; 只能支持主动删除按配置计费类型的实例。包年包月过期的容器也可以删除,其它的情况还请发工单系统。计费状态异常的容器无法删除。; - 示例: jdc nativecontainer disassociate-elastic-ip --container-id xxx --elastic-ip-id xxx + 示例: jdc nativecontainer delete-container --container-id xxx ''', ) - def disassociate_elastic_ip(self): + def delete_container(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.DisassociateElasticIpRequest import DisassociateElasticIpRequest + from jdcloud_sdk.services.nativecontainer.apis.DeleteContainerRequest import DeleteContainerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisassociateElasticIpRequest(params_dict, headers) + req = DeleteContainerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -349,31 +349,28 @@ def disassociate_elastic_ip(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--tail-lines'], dict(help="""(int) 返回日志文件中倒数 tailLines 行,如不指定,默认从容器启动时或 sinceSeconds 指定的时间读取。; """, dest='tailLines', type=int, required=False)), - (['--since-seconds'], dict(help="""(int) 返回相对于当前时间之前sinceSeconds之内的日志。; """, dest='sinceSeconds', type=int, required=False)), - (['--limit-bytes'], dict(help="""(int) 限制返回的日志文件内容字节数,取值范围 [1-4]KB,最大 4KB.; """, dest='limitBytes', type=int, required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个容器日志; ''', + help=''' 启动处于关闭状态的单个容器,处在任务执行中的容器无法启动。
; 容器实例或其绑定的云盘已欠费时,容器将无法正常启动。
; ''', description=''' - 查询单个容器日志; + 启动处于关闭状态的单个容器,处在任务执行中的容器无法启动。
; 容器实例或其绑定的云盘已欠费时,容器将无法正常启动。
; - 示例: jdc nativecontainer get-logs --container-id xxx + 示例: jdc nativecontainer start-container --container-id xxx ''', ) - def get_logs(self): + def start_container(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.GetLogsRequest import GetLogsRequest + from jdcloud_sdk.services.nativecontainer.apis.StartContainerRequest import StartContainerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetLogsRequest(params_dict, headers) + req = StartContainerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -385,35 +382,28 @@ def get_logs(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--image'], dict(help="""(string) 镜像名称
1. Docker Hub官方镜像通过类似nginx, mysql/mysql-server的名字指定

repository长度最大256个字符,tag最大128个字符,registry最大255个字符
下载镜像超时时间:10分钟 """, dest='image', required=True)), - (['--secret'], dict(help="""(string) 镜像仓库认证信息;使用Docker Hub和京东云CR的镜像不需要secret """, dest='secret', required=False)), - (['--command'], dict(help="""(array: string) 容器启动执行的命令, 如果不指定默认是镜像的ENTRYPOINT. 数组字符总长度范围:[0-256] """, dest='command', required=False)), - (['--args'], dict(help="""(array: string) 容器启动执行命令的参数, 如果不指定默认是镜像的CMD. 数组字符总长度范围:[0-2048] """, dest='args', required=False)), - (['--tty'], dict(help="""(bool) 容器是否分配tty。默认不分配 """, dest='tty', required=False)), - (['--working-dir'], dict(help="""(string) 容器的工作目录。如果不指定,默认是根目录(/),必须是绝对路径。字符长度范围:[0-1024] """, dest='workingDir', required=False)), - (['--envs'], dict(help="""(array: envVar) 容器执行的环境变量;如果和镜像中的环境变量Key相同,会覆盖镜像中的值;
最大100对 """, dest='envs', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 重置原生容器,对已有原生容器使用新的镜像重置。; 原容器 id 不变,不涉及计费变动,暂不支持修改实例类型,不会改变原生容器所在的物理节点,也不支持修改已经使用的系统盘和数据盘以及网络相关参数。; - 镜像; - 容器的镜像通过镜像名称来确定; - nginx:tag 或 mysql/mysql-server:tag 这样命名的镜像表示 docker hub 官方镜像; - container-registry/image:tag 这样命名的镜像表示私有仓储的镜像; - 私有仓储必须兼容 docker registry 认证机制,并通过 secret 来保存机密信息; - 其他; - rebuild 之前容器必须处于关闭状态; - rebuild 完成后,容器仍为关闭状态; ''', + help=''' 停止处于运行状态的单个实例,处于任务执行中的容器无法启动。; ''', description=''' - 重置原生容器,对已有原生容器使用新的镜像重置。; 原容器 id 不变,不涉及计费变动,暂不支持修改实例类型,不会改变原生容器所在的物理节点,也不支持修改已经使用的系统盘和数据盘以及网络相关参数。; - 镜像; - 容器的镜像通过镜像名称来确定; - nginx:tag 或 mysql/mysql-server:tag 这样命名的镜像表示 docker hub 官方镜像; - container-registry/image:tag 这样命名的镜像表示私有仓储的镜像; - 私有仓储必须兼容 docker registry 认证机制,并通过 secret 来保存机密信息; - 其他; - rebuild 之前容器必须处于关闭状态; - rebuild 完成后,容器仍为关闭状态; + 停止处于运行状态的单个实例,处于任务执行中的容器无法启动。; - 示例: jdc nativecontainer rebuild-container --container-id xxx --image xxx + 示例: jdc nativecontainer stop-container --container-id xxx ''', ) - def rebuild_container(self): + def stop_container(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.RebuildContainerRequest import RebuildContainerRequest + from jdcloud_sdk.services.nativecontainer.apis.StopContainerRequest import StopContainerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RebuildContainerRequest(params_dict, headers) + req = StopContainerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -425,29 +415,30 @@ def rebuild_container(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--instance-type'], dict(help="""(string) 新实例类型,不可与原实例类型相同 """, dest='instanceType', required=True)), + (['--name'], dict(help="""(string) 容器名称 """, dest='name', required=False)), + (['--description'], dict(help="""(string) 容器描述 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 调整原生容器实例类型配置。; - 原生容器状态为停止;; - 支持升配、降配;**不支持原有规格**; - 计费类型不变; - 包年包月:需要计算配置差价,如果所选配置价格高,需要补齐到期前的差价,到期时间不变;如果所选配置价格低,需要延长到期时间; - 按配置:按照所选规格,进行计费; ''', + help=''' 修改容器的 名称 和 描述。
; name 和 description 必须要指定一个; ''', description=''' - 调整原生容器实例类型配置。; - 原生容器状态为停止;; - 支持升配、降配;**不支持原有规格**; - 计费类型不变; - 包年包月:需要计算配置差价,如果所选配置价格高,需要补齐到期前的差价,到期时间不变;如果所选配置价格低,需要延长到期时间; - 按配置:按照所选规格,进行计费; + 修改容器的 名称 和 描述。
; name 和 description 必须要指定一个; - 示例: jdc nativecontainer resize-container --container-id xxx --instance-type xxx + 示例: jdc nativecontainer modify-container-attribute --container-id xxx ''', ) - def resize_container(self): + def modify_container_attribute(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.ResizeContainerRequest import ResizeContainerRequest + from jdcloud_sdk.services.nativecontainer.apis.ModifyContainerAttributeRequest import ModifyContainerAttributeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ResizeContainerRequest(params_dict, headers) + req = ModifyContainerAttributeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -459,30 +450,29 @@ def resize_container(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--command'], dict(help="""(array: string) 执行命令 """, dest='command', required=False)), - (['--tty'], dict(help="""(bool) 执行命令是否添加tty """, dest='tty', required=False)), + (['--elastic-ip-id'], dict(help="""(string) 弹性IP ID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建exec; ''', + help=''' 容器绑定弹性公网 IP,绑定的是主网卡、主内网IP对应的弹性IP.
; 一台云主机只能绑定一个弹性公网 IP(主网卡),若主网卡已存在弹性公网IP,会返回错误。
; 如果是黑名单中的用户,会返回错误。; ''', description=''' - 创建exec; + 容器绑定弹性公网 IP,绑定的是主网卡、主内网IP对应的弹性IP.
; 一台云主机只能绑定一个弹性公网 IP(主网卡),若主网卡已存在弹性公网IP,会返回错误。
; 如果是黑名单中的用户,会返回错误。; - 示例: jdc nativecontainer exec-create --container-id xxx + 示例: jdc nativecontainer associate-elastic-ip --container-id xxx --elastic-ip-id xxx ''', ) - def exec_create(self): + def associate_elastic_ip(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.ExecCreateRequest import ExecCreateRequest + from jdcloud_sdk.services.nativecontainer.apis.AssociateElasticIpRequest import AssociateElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ExecCreateRequest(params_dict, headers) + req = AssociateElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -494,29 +484,29 @@ def exec_create(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--exec-id'], dict(help="""(string) exec ID """, dest='execId', required=True)), + (['--elastic-ip-id'], dict(help="""(string) 弹性IP ID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取exec退出码; ''', + help=''' 容器解绑公网 IP,解绑的是主网卡、主内网 IP 对应的弹性 IP.; ''', description=''' - 获取exec退出码; + 容器解绑公网 IP,解绑的是主网卡、主内网 IP 对应的弹性 IP.; - 示例: jdc nativecontainer exec-get-exit-code --container-id xxx --exec-id xxx + 示例: jdc nativecontainer disassociate-elastic-ip --container-id xxx --elastic-ip-id xxx ''', ) - def exec_get_exit_code(self): + def disassociate_elastic_ip(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.ExecGetExitCodeRequest import ExecGetExitCodeRequest + from jdcloud_sdk.services.nativecontainer.apis.DisassociateElasticIpRequest import DisassociateElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ExecGetExitCodeRequest(params_dict, headers) + req = DisassociateElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -528,31 +518,31 @@ def exec_get_exit_code(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--height'], dict(help="""(int) tty row """, dest='height', type=int, required=True)), - (['--width'], dict(help="""(int) tty column """, dest='width', type=int, required=True)), - (['--exec-id'], dict(help="""(string) exec ID """, dest='execId', required=False)), + (['--tail-lines'], dict(help="""(int) 返回日志文件中倒数 tailLines 行,如不指定,默认从容器启动时或 sinceSeconds 指定的时间读取。; """, dest='tailLines', type=int, required=False)), + (['--since-seconds'], dict(help="""(int) 返回相对于当前时间之前sinceSeconds之内的日志。; """, dest='sinceSeconds', type=int, required=False)), + (['--limit-bytes'], dict(help="""(int) 限制返回的日志文件内容字节数,取值范围 [1-4]KB,最大 4KB.; """, dest='limitBytes', type=int, required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 调整TTY大小; ''', + help=''' 查询单个容器日志; ''', description=''' - 调整TTY大小; + 查询单个容器日志; - 示例: jdc nativecontainer resize-tty --container-id xxx --height 0 --width 0 + 示例: jdc nativecontainer get-logs --container-id xxx ''', ) - def resize_tty(self): + def get_logs(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.ResizeTTYRequest import ResizeTTYRequest + from jdcloud_sdk.services.nativecontainer.apis.GetLogsRequest import GetLogsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ResizeTTYRequest(params_dict, headers) + req = GetLogsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -562,30 +552,37 @@ def resize_tty(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--filters'], dict(help="""(array: filter) instanceTypes - 实例规格,精确匹配,支持多个; az - 可用区,精确匹配,支持多个; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--image'], dict(help="""(string) 镜像名称
1. Docker Hub官方镜像通过类似nginx, mysql/mysql-server的名字指定

repository长度最大256个字符,tag最大128个字符,registry最大255个字符
下载镜像超时时间:10分钟 """, dest='image', required=True)), + (['--secret'], dict(help="""(string) 镜像仓库认证信息;使用Docker Hub和京东云CR的镜像不需要secret """, dest='secret', required=False)), + (['--command'], dict(help="""(array: string) 容器启动执行的命令, 如果不指定默认是镜像的ENTRYPOINT. 数组字符总长度范围:[0-256] """, dest='command', required=False)), + (['--args'], dict(help="""(array: string) 容器启动执行命令的参数, 如果不指定默认是镜像的CMD. 数组字符总长度范围:[0-2048] """, dest='args', required=False)), + (['--tty'], dict(help="""(bool) 容器是否分配tty。默认不分配 """, dest='tty', required=False)), + (['--working-dir'], dict(help="""(string) 容器的工作目录。如果不指定,默认是根目录(/),必须是绝对路径。字符长度范围:[0-1024] """, dest='workingDir', required=False)), + (['--envs'], dict(help="""(array: envVar) 容器执行的环境变量;如果和镜像中的环境变量Key相同,会覆盖镜像中的值;
最大100对 """, dest='envs', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询实例规格信息列表; ''', + help=''' 重置原生容器,对已有原生容器使用新的镜像重置。; 原容器 id 不变,不涉及计费变动,暂不支持修改实例类型,不会改变原生容器所在的物理节点,也不支持修改已经使用的系统盘和数据盘以及网络相关参数。; - 镜像; - 容器的镜像通过镜像名称来确定; - nginx:tag 或 mysql/mysql-server:tag 这样命名的镜像表示 docker hub 官方镜像; - container-registry/image:tag 这样命名的镜像表示私有仓储的镜像; - 私有仓储必须兼容 docker registry 认证机制,并通过 secret 来保存机密信息; - 其他; - rebuild 之前容器必须处于关闭状态; - rebuild 完成后,容器仍为关闭状态; ''', description=''' - 查询实例规格信息列表; + 重置原生容器,对已有原生容器使用新的镜像重置。; 原容器 id 不变,不涉及计费变动,暂不支持修改实例类型,不会改变原生容器所在的物理节点,也不支持修改已经使用的系统盘和数据盘以及网络相关参数。; - 镜像; - 容器的镜像通过镜像名称来确定; - nginx:tag 或 mysql/mysql-server:tag 这样命名的镜像表示 docker hub 官方镜像; - container-registry/image:tag 这样命名的镜像表示私有仓储的镜像; - 私有仓储必须兼容 docker registry 认证机制,并通过 secret 来保存机密信息; - 其他; - rebuild 之前容器必须处于关闭状态; - rebuild 完成后,容器仍为关闭状态; - 示例: jdc nativecontainer describe-instance-types + 示例: jdc nativecontainer rebuild-container --container-id xxx --image xxx ''', ) - def describe_instance_types(self): + def rebuild_container(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.DescribeInstanceTypesRequest import DescribeInstanceTypesRequest + from jdcloud_sdk.services.nativecontainer.apis.RebuildContainerRequest import RebuildContainerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceTypesRequest(params_dict, headers) + req = RebuildContainerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -596,29 +593,30 @@ def describe_instance_types(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--resource-type'], dict(help="""(string) resourceType - 资源类型,支持 [container, pod, secret]; """, dest='resourceType', required=True)), + (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--instance-type'], dict(help="""(string) 新实例类型,不可与原实例类型相同 """, dest='instanceType', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询资源的配额,支持:原生容器 pod 和 secret.; ''', + help=''' 调整原生容器实例类型配置。; - 原生容器状态为停止;; - 支持升配、降配;**不支持原有规格**; - 计费类型不变; - 包年包月:需要计算配置差价,如果所选配置价格高,需要补齐到期前的差价,到期时间不变;如果所选配置价格低,需要延长到期时间; - 按配置:按照所选规格,进行计费; ''', description=''' - 查询资源的配额,支持:原生容器 pod 和 secret.; + 调整原生容器实例类型配置。; - 原生容器状态为停止;; - 支持升配、降配;**不支持原有规格**; - 计费类型不变; - 包年包月:需要计算配置差价,如果所选配置价格高,需要补齐到期前的差价,到期时间不变;如果所选配置价格低,需要延长到期时间; - 按配置:按照所选规格,进行计费; - 示例: jdc nativecontainer describe-quota --resource-type xxx + 示例: jdc nativecontainer resize-container --container-id xxx --instance-type xxx ''', ) - def describe_quota(self): + def resize_container(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.DescribeQuotaRequest import DescribeQuotaRequest + from jdcloud_sdk.services.nativecontainer.apis.ResizeContainerRequest import ResizeContainerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeQuotaRequest(params_dict, headers) + req = ResizeContainerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -629,31 +627,31 @@ def describe_quota(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) name - secret名称,支持模糊搜索; """, dest='filters', required=False)), + (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--command'], dict(help="""(array: string) 执行命令 """, dest='command', required=False)), + (['--tty'], dict(help="""(bool) 执行命令是否添加tty """, dest='tty', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询 secret 列表。
; 此接口支持分页查询,默认每页20条。; ''', + help=''' 创建exec; ''', description=''' - 查询 secret 列表。
; 此接口支持分页查询,默认每页20条。; + 创建exec; - 示例: jdc nativecontainer describe-secrets + 示例: jdc nativecontainer exec-create --container-id xxx ''', ) - def describe_secrets(self): + def exec_create(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.DescribeSecretsRequest import DescribeSecretsRequest + from jdcloud_sdk.services.nativecontainer.apis.ExecCreateRequest import ExecCreateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSecretsRequest(params_dict, headers) + req = ExecCreateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -664,31 +662,30 @@ def describe_secrets(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) 镜像仓库认证信息名称,不能重复; """, dest='name', required=True)), - (['--secret-type'], dict(help="""(string) 镜像仓库认证信息类型,目前仅支持:docker-registry 类型,用来和docker registry认证的类型。; """, dest='secretType', required=True)), - (['--data'], dict(help="""(dockerRegistryData) 镜像仓库认证信息数据。
; 必须包含server、username、password 字段,email 字段是可选的。
; """, dest='data', required=True)), + (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--exec-id'], dict(help="""(string) exec ID """, dest='execId', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个 secret,用于存放镜像仓库认证信息。; ''', + help=''' 获取exec退出码; ''', description=''' - 创建一个 secret,用于存放镜像仓库认证信息。; + 获取exec退出码; - 示例: jdc nativecontainer create-secret --name xxx --secret-type xxx --data {"":""} + 示例: jdc nativecontainer exec-get-exit-code --container-id xxx --exec-id xxx ''', ) - def create_secret(self): + def exec_get_exit_code(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.CreateSecretRequest import CreateSecretRequest + from jdcloud_sdk.services.nativecontainer.apis.ExecGetExitCodeRequest import ExecGetExitCodeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateSecretRequest(params_dict, headers) + req = ExecGetExitCodeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -699,29 +696,32 @@ def create_secret(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) Secret Name """, dest='name', required=True)), + (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--height'], dict(help="""(int) tty row """, dest='height', type=int, required=True)), + (['--width'], dict(help="""(int) tty column """, dest='width', type=int, required=True)), + (['--exec-id'], dict(help="""(string) exec ID """, dest='execId', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个 secret 详情; ''', + help=''' 调整TTY大小; ''', description=''' - 查询单个 secret 详情; + 调整TTY大小; - 示例: jdc nativecontainer describe-secret --name xxx + 示例: jdc nativecontainer resize-tty --container-id xxx --height 5 --width 5 ''', ) - def describe_secret(self): + def resize_tty(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.DescribeSecretRequest import DescribeSecretRequest + from jdcloud_sdk.services.nativecontainer.apis.ResizeTTYRequest import ResizeTTYRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSecretRequest(params_dict, headers) + req = ResizeTTYRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -731,30 +731,30 @@ def describe_secret(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) Secret Name """, dest='name', required=True)), + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--filters'], dict(help="""(array: filter) instanceTypes - 实例规格,精确匹配,支持多个; az - 可用区,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除单个 secret; ''', + help=''' 查询实例规格信息列表; ''', description=''' - 删除单个 secret; + 查询实例规格信息列表; - 示例: jdc nativecontainer delete-secret --name xxx + 示例: jdc nativecontainer describe-instance-types ''', ) - def delete_secret(self): + def describe_instance_types(self): client_factory = ClientFactory('nativecontainer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nativecontainer.apis.DeleteSecretRequest import DeleteSecretRequest + from jdcloud_sdk.services.nativecontainer.apis.DescribeInstanceTypesRequest import DescribeInstanceTypesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteSecretRequest(params_dict, headers) + req = DescribeInstanceTypesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -809,7 +809,7 @@ def attach(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-containers','create-containers','describe-container','delete-container','start-container','stop-container','modify-container-attribute','associate-elastic-ip','disassociate-elastic-ip','get-logs','rebuild-container','resize-container','exec-create','exec-get-exit-code','resize-tty','describe-instance-types','describe-quota','describe-secrets','create-secret','describe-secret','delete-secret',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-secrets','create-secret','describe-secret','delete-secret','describe-quota','describe-containers','create-containers','describe-container','delete-container','start-container','stop-container','modify-container-attribute','associate-elastic-ip','disassociate-elastic-ip','get-logs','rebuild-container','resize-container','exec-create','exec-get-exit-code','resize-tty','describe-instance-types',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/nc.py b/jdcloud_cli/controllers/services/nc.py index 6f43d66..85a5e15 100644 --- a/jdcloud_cli/controllers/services/nc.py +++ b/jdcloud_cli/controllers/services/nc.py @@ -45,29 +45,29 @@ class Meta: (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) containerId - 实例ID,精确匹配,支持多个; privateIpAddress - 主网卡IP地址,模糊匹配,支持单个; az - 可用区,精确匹配,支持多个; vpcId - 私有网络ID,精确匹配,支持多个; status - 容器状态,精确匹配,支持多个; name - 实例名称,模糊匹配,支持单个; subnetId - 镜像ID,模糊匹配,支持单个; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) name - secret名称,支持模糊搜索; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量查询原生容器的详细信息
; 此接口支持分页查询,默认每页20条。; ''', + help=''' 查询 secret 列表。
; 此接口支持分页查询,默认每页20条。; ''', description=''' - 批量查询原生容器的详细信息
; 此接口支持分页查询,默认每页20条。; + 查询 secret 列表。
; 此接口支持分页查询,默认每页20条。; - 示例: jdc nc describe-containers + 示例: jdc nc describe-secrets ''', ) - def describe_containers(self): + def describe_secrets(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.DescribeContainersRequest import DescribeContainersRequest + from jdcloud_sdk.services.nc.apis.DescribeSecretsRequest import DescribeSecretsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeContainersRequest(params_dict, headers) + req = DescribeSecretsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -78,30 +78,31 @@ def describe_containers(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--container-spec'], dict(help="""(containerSpec) 创建容器规格 """, dest='containerSpec', required=False)), - (['--max-count'], dict(help="""(int) 购买实例数量;取值范围:[1,100] """, dest='maxCount', type=int, required=False)), + (['--name'], dict(help="""(string) 机密数据名称,不能重复; """, dest='name', required=True)), + (['--secret-type'], dict(help="""(string) 机密数据的类型,目前仅支持:docker-registry 类型,用来和docker registry认证的类型。; """, dest='secretType', required=True)), + (['--data'], dict(help="""(dockerRegistryData) 机密的数据。
; key 的有效字符包括字母、数字、-、_和.;
; value 是 Base64 编码的字符串,不能包含换行符(在 linux 下使用 base64 -w 0选项),每个value长度上限为4KB,整个data的长度不能超过256KB;
; 必须包含server、username、password 字段,email 字段是可选的。
; """, dest='data', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一台或多台指定配置容器。; - 创建容器需要通过实名认证; - 镜像; - 容器的镜像通过镜像名称来确定; - nginx:tag 或 mysql/mysql-server:tag 这样命名的镜像表示 docker hub 官方镜像; - container-registry/image:tag 这样命名的镜像表示私有仓储的镜像; - 私有仓储必须兼容 docker registry 认证机制,并通过 secret 来保存机密信息; - hostname 规范; - 支持两种方式:以标签方式书写或以完整主机名方式书写; - 标签规范; - 0-9,a-z(不分大小写)和 -(减号),其他的都是无效的字符串; - 不能以减号开始,也不能以减号结尾; - 最小1个字符,最大63个字符; - 完整的主机名由一系列标签与点连接组成; - 标签与标签之间使用“.”(点)进行连接; - 不能以“.”(点)开始,也不能以“.”(点)结尾; - 整个主机名(包括标签以及分隔点“.”)最多有63个ASCII字符; - 网络配置; - 指定主网卡配置信息; - 必须指定一个子网; - 一台云主机创建时必须指定一个安全组,至多指定 5 个安全组; - 可以指定 elasticIp 规格来约束创建的弹性 IP,带宽取值范围 [1-200]Mbps,步进 1Mbps; - 可以指定网卡的主 IP(primaryIpAddress),该 IP 需要在子网 IP 范围内且未被占用,指定子网 IP 时 maxCount 只能为1; - 安全组 securityGroup 需与子网 Subnet 在同一个私有网络 VPC 内; - 主网卡 deviceIndex 设置为 1; - 存储; - volume 分为 root volume 和 data volume,root volume 的挂载目录是 /,data volume 的挂载目录可以随意指定; - volume 的底层存储介质当前只支持 cloud 类别,也就是云硬盘; - 系统盘; - 云硬盘类型可以选择 ssd、premium-hdd; - 磁盘大小; - ssd:范围 [10, 100]GB,步长为 10G; - premium-hdd:范围 [20, 1000]GB,步长为 10G; - 自动删除; - 云盘默认跟随容器实例自动删除,如果是包年包月的数据盘或共享型数据盘,此参数不生效; - 可以选择已存在的云硬盘; - 数据盘; - 云硬盘类型可以选择 ssd、premium-hdd; - 磁盘大小; - ssd:范围[20,1000]GB,步长为10G; - premium-hdd:范围[20,3000]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - 单个容器最多可以挂载 7 个 data volume; - 计费; - 弹性IP的计费模式,如果选择按用量类型可以单独设置,其它计费模式都以主机为准; - 云硬盘的计费模式以主机为准; - 容器日志; - 默认在本地分配10MB的存储空间,自动 rotate; - 其他; - 创建完成后,容器状态为running; - maxCount 为最大努力,不保证一定能达到 maxCount; ''', + help=''' 创建一个 secret,用于存放镜像仓库机密相关信息。; ''', description=''' - 创建一台或多台指定配置容器。; - 创建容器需要通过实名认证; - 镜像; - 容器的镜像通过镜像名称来确定; - nginx:tag 或 mysql/mysql-server:tag 这样命名的镜像表示 docker hub 官方镜像; - container-registry/image:tag 这样命名的镜像表示私有仓储的镜像; - 私有仓储必须兼容 docker registry 认证机制,并通过 secret 来保存机密信息; - hostname 规范; - 支持两种方式:以标签方式书写或以完整主机名方式书写; - 标签规范; - 0-9,a-z(不分大小写)和 -(减号),其他的都是无效的字符串; - 不能以减号开始,也不能以减号结尾; - 最小1个字符,最大63个字符; - 完整的主机名由一系列标签与点连接组成; - 标签与标签之间使用“.”(点)进行连接; - 不能以“.”(点)开始,也不能以“.”(点)结尾; - 整个主机名(包括标签以及分隔点“.”)最多有63个ASCII字符; - 网络配置; - 指定主网卡配置信息; - 必须指定一个子网; - 一台云主机创建时必须指定一个安全组,至多指定 5 个安全组; - 可以指定 elasticIp 规格来约束创建的弹性 IP,带宽取值范围 [1-200]Mbps,步进 1Mbps; - 可以指定网卡的主 IP(primaryIpAddress),该 IP 需要在子网 IP 范围内且未被占用,指定子网 IP 时 maxCount 只能为1; - 安全组 securityGroup 需与子网 Subnet 在同一个私有网络 VPC 内; - 主网卡 deviceIndex 设置为 1; - 存储; - volume 分为 root volume 和 data volume,root volume 的挂载目录是 /,data volume 的挂载目录可以随意指定; - volume 的底层存储介质当前只支持 cloud 类别,也就是云硬盘; - 系统盘; - 云硬盘类型可以选择 ssd、premium-hdd; - 磁盘大小; - ssd:范围 [10, 100]GB,步长为 10G; - premium-hdd:范围 [20, 1000]GB,步长为 10G; - 自动删除; - 云盘默认跟随容器实例自动删除,如果是包年包月的数据盘或共享型数据盘,此参数不生效; - 可以选择已存在的云硬盘; - 数据盘; - 云硬盘类型可以选择 ssd、premium-hdd; - 磁盘大小; - ssd:范围[20,1000]GB,步长为10G; - premium-hdd:范围[20,3000]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - 单个容器最多可以挂载 7 个 data volume; - 计费; - 弹性IP的计费模式,如果选择按用量类型可以单独设置,其它计费模式都以主机为准; - 云硬盘的计费模式以主机为准; - 容器日志; - 默认在本地分配10MB的存储空间,自动 rotate; - 其他; - 创建完成后,容器状态为running; - maxCount 为最大努力,不保证一定能达到 maxCount; + 创建一个 secret,用于存放镜像仓库机密相关信息。; - 示例: jdc nc create-containers + 示例: jdc nc create-secret --name xxx --secret-type xxx ''', ) - def create_containers(self): + def create_secret(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.CreateContainersRequest import CreateContainersRequest + from jdcloud_sdk.services.nc.apis.CreateSecretRequest import CreateSecretRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateContainersRequest(params_dict, headers) + req = CreateSecretRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -112,29 +113,29 @@ def create_containers(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--name'], dict(help="""(string) Secret Name """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询一台原生容器的详细信息; ''', + help=''' 查询单个 secret 详情; ''', description=''' - 查询一台原生容器的详细信息; + 查询单个 secret 详情; - 示例: jdc nc describe-container --container-id xxx + 示例: jdc nc describe-secret --name xxx ''', ) - def describe_container(self): + def describe_secret(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.DescribeContainerRequest import DescribeContainerRequest + from jdcloud_sdk.services.nc.apis.DescribeSecretRequest import DescribeSecretRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeContainerRequest(params_dict, headers) + req = DescribeSecretRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -145,29 +146,29 @@ def describe_container(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--name'], dict(help="""(string) Secret Name """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 容器状态必须为 stopped、running 或 error状态。
; 按量付费的实例,如不主动删除将一直运行,不再使用的实例,可通过本接口主动停用。
; 只能支持主动删除按量计费类型的实例。包年包月过期的容器也可以删除,其它的情况还请发工单系统。计费状态异常的容器无法删除。; ''', + help=''' 删除单个 secret; ''', description=''' - 容器状态必须为 stopped、running 或 error状态。
; 按量付费的实例,如不主动删除将一直运行,不再使用的实例,可通过本接口主动停用。
; 只能支持主动删除按量计费类型的实例。包年包月过期的容器也可以删除,其它的情况还请发工单系统。计费状态异常的容器无法删除。; + 删除单个 secret; - 示例: jdc nc delete-container --container-id xxx + 示例: jdc nc delete-secret --name xxx ''', ) - def delete_container(self): + def delete_secret(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.DeleteContainerRequest import DeleteContainerRequest + from jdcloud_sdk.services.nc.apis.DeleteSecretRequest import DeleteSecretRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteContainerRequest(params_dict, headers) + req = DeleteSecretRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -178,29 +179,29 @@ def delete_container(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--resource-type'], dict(help="""(string) resourceType - 资源类型,支持 [container, pod, secret]; """, dest='resourceType', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启动处于关闭状态的单个容器,处在任务执行中的容器无法启动。
; 容器实例或其绑定的云盘已欠费时,容器将无法正常启动。
; ''', + help=''' 查询资源的配额,支持:原生容器 pod 和 secret.; ''', description=''' - 启动处于关闭状态的单个容器,处在任务执行中的容器无法启动。
; 容器实例或其绑定的云盘已欠费时,容器将无法正常启动。
; + 查询资源的配额,支持:原生容器 pod 和 secret.; - 示例: jdc nc start-container --container-id xxx + 示例: jdc nc describe-quota --resource-type xxx ''', ) - def start_container(self): + def describe_quota(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.StartContainerRequest import StartContainerRequest + from jdcloud_sdk.services.nc.apis.DescribeQuotaRequest import DescribeQuotaRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartContainerRequest(params_dict, headers) + req = DescribeQuotaRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -211,29 +212,31 @@ def start_container(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) containerId - 实例ID,精确匹配,支持多个; privateIpAddress - 主网卡IP地址,模糊匹配,支持单个; az - 可用区,精确匹配,支持多个; vpcId - 私有网络ID,精确匹配,支持多个; status - 容器状态,精确匹配,支持多个; name - 实例名称,模糊匹配,支持单个; subnetId - 镜像ID,模糊匹配,支持单个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 停止处于运行状态的单个实例,处于任务执行中的容器无法启动。; ''', + help=''' 批量查询原生容器的详细信息
; 此接口支持分页查询,默认每页20条。; ''', description=''' - 停止处于运行状态的单个实例,处于任务执行中的容器无法启动。; + 批量查询原生容器的详细信息
; 此接口支持分页查询,默认每页20条。; - 示例: jdc nc stop-container --container-id xxx + 示例: jdc nc describe-containers ''', ) - def stop_container(self): + def describe_containers(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.StopContainerRequest import StopContainerRequest + from jdcloud_sdk.services.nc.apis.DescribeContainersRequest import DescribeContainersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopContainerRequest(params_dict, headers) + req = DescribeContainersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -244,31 +247,30 @@ def stop_container(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--name'], dict(help="""(string) 容器名称 """, dest='name', required=False)), - (['--description'], dict(help="""(string) 容器描述;和description必须要指定一个 """, dest='description', required=False)), + (['--container-spec'], dict(help="""(containerSpec) 创建容器规格 """, dest='containerSpec', required=False)), + (['--max-count'], dict(help="""(int) 购买实例数量;取值范围:[1,100] """, dest='maxCount', type=int, required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改容器的 名称 和 描述。; ''', + help=''' 创建一台或多台指定配置容器。; - 创建容器需要通过实名认证; - 镜像; - 容器的镜像通过镜像名称来确定; - nginx:tag 或 mysql/mysql-server:tag 这样命名的镜像表示 docker hub 官方镜像; - container-registry/image:tag 这样命名的镜像表示私有仓储的镜像; - 私有仓储必须兼容 docker registry 认证机制,并通过 secret 来保存机密信息; - hostname 规范; - 支持两种方式:以标签方式书写或以完整主机名方式书写; - 标签规范; - 0-9,a-z(不分大小写)和 -(减号),其他的都是无效的字符串; - 不能以减号开始,也不能以减号结尾; - 最小1个字符,最大63个字符; - 完整的主机名由一系列标签与点连接组成; - 标签与标签之间使用“.”(点)进行连接; - 不能以“.”(点)开始,也不能以“.”(点)结尾; - 整个主机名(包括标签以及分隔点“.”)最多有63个ASCII字符; - 网络配置; - 指定主网卡配置信息; - 必须指定一个子网; - 一台云主机创建时必须指定一个安全组,至多指定 5 个安全组; - 可以指定 elasticIp 规格来约束创建的弹性 IP,带宽取值范围 [1-200]Mbps,步进 1Mbps; - 可以指定网卡的主 IP(primaryIpAddress),该 IP 需要在子网 IP 范围内且未被占用,指定子网 IP 时 maxCount 只能为1; - 安全组 securityGroup 需与子网 Subnet 在同一个私有网络 VPC 内; - 主网卡 deviceIndex 设置为 1; - 存储; - volume 分为 root volume 和 data volume,root volume 的挂载目录是 /,data volume 的挂载目录可以随意指定; - volume 的底层存储介质当前只支持 cloud 类别,也就是云硬盘; - 系统盘; - 云硬盘类型可以选择 ssd、premium-hdd; - 磁盘大小; - ssd:范围 [10, 100]GB,步长为 10G; - premium-hdd:范围 [20, 1000]GB,步长为 10G; - 自动删除; - 云盘默认跟随容器实例自动删除,如果是包年包月的数据盘或共享型数据盘,此参数不生效; - 可以选择已存在的云硬盘; - 数据盘; - 云硬盘类型可以选择 ssd、premium-hdd; - 磁盘大小; - ssd:范围[20,1000]GB,步长为10G; - premium-hdd:范围[20,3000]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - 单个容器最多可以挂载 7 个 data volume; - 计费; - 弹性IP的计费模式,如果选择按用量类型可以单独设置,其它计费模式都以主机为准; - 云硬盘的计费模式以主机为准; - 容器日志; - 默认在本地分配10MB的存储空间,自动 rotate; - 其他; - 创建完成后,容器状态为running; - maxCount 为最大努力,不保证一定能达到 maxCount; ''', description=''' - 修改容器的 名称 和 描述。; + 创建一台或多台指定配置容器。; - 创建容器需要通过实名认证; - 镜像; - 容器的镜像通过镜像名称来确定; - nginx:tag 或 mysql/mysql-server:tag 这样命名的镜像表示 docker hub 官方镜像; - container-registry/image:tag 这样命名的镜像表示私有仓储的镜像; - 私有仓储必须兼容 docker registry 认证机制,并通过 secret 来保存机密信息; - hostname 规范; - 支持两种方式:以标签方式书写或以完整主机名方式书写; - 标签规范; - 0-9,a-z(不分大小写)和 -(减号),其他的都是无效的字符串; - 不能以减号开始,也不能以减号结尾; - 最小1个字符,最大63个字符; - 完整的主机名由一系列标签与点连接组成; - 标签与标签之间使用“.”(点)进行连接; - 不能以“.”(点)开始,也不能以“.”(点)结尾; - 整个主机名(包括标签以及分隔点“.”)最多有63个ASCII字符; - 网络配置; - 指定主网卡配置信息; - 必须指定一个子网; - 一台云主机创建时必须指定一个安全组,至多指定 5 个安全组; - 可以指定 elasticIp 规格来约束创建的弹性 IP,带宽取值范围 [1-200]Mbps,步进 1Mbps; - 可以指定网卡的主 IP(primaryIpAddress),该 IP 需要在子网 IP 范围内且未被占用,指定子网 IP 时 maxCount 只能为1; - 安全组 securityGroup 需与子网 Subnet 在同一个私有网络 VPC 内; - 主网卡 deviceIndex 设置为 1; - 存储; - volume 分为 root volume 和 data volume,root volume 的挂载目录是 /,data volume 的挂载目录可以随意指定; - volume 的底层存储介质当前只支持 cloud 类别,也就是云硬盘; - 系统盘; - 云硬盘类型可以选择 ssd、premium-hdd; - 磁盘大小; - ssd:范围 [10, 100]GB,步长为 10G; - premium-hdd:范围 [20, 1000]GB,步长为 10G; - 自动删除; - 云盘默认跟随容器实例自动删除,如果是包年包月的数据盘或共享型数据盘,此参数不生效; - 可以选择已存在的云硬盘; - 数据盘; - 云硬盘类型可以选择 ssd、premium-hdd; - 磁盘大小; - ssd:范围[20,1000]GB,步长为10G; - premium-hdd:范围[20,3000]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - 单个容器最多可以挂载 7 个 data volume; - 计费; - 弹性IP的计费模式,如果选择按用量类型可以单独设置,其它计费模式都以主机为准; - 云硬盘的计费模式以主机为准; - 容器日志; - 默认在本地分配10MB的存储空间,自动 rotate; - 其他; - 创建完成后,容器状态为running; - maxCount 为最大努力,不保证一定能达到 maxCount; - 示例: jdc nc modify-container-attribute --container-id xxx + 示例: jdc nc create-containers ''', ) - def modify_container_attribute(self): + def create_containers(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.ModifyContainerAttributeRequest import ModifyContainerAttributeRequest + from jdcloud_sdk.services.nc.apis.CreateContainersRequest import CreateContainersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyContainerAttributeRequest(params_dict, headers) + req = CreateContainersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -280,29 +282,28 @@ def modify_container_attribute(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--elastic-ip-id'], dict(help="""(string) 弹性IP ID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 容器绑定弹性公网 IP,绑定的是主网卡、主内网IP对应的弹性IP.
; 一台云主机只能绑定一个弹性公网 IP(主网卡),若主网卡已存在弹性公网IP,会返回错误。
; 如果是黑名单中的用户,会返回错误。; ''', + help=''' 查询一台原生容器的详细信息; ''', description=''' - 容器绑定弹性公网 IP,绑定的是主网卡、主内网IP对应的弹性IP.
; 一台云主机只能绑定一个弹性公网 IP(主网卡),若主网卡已存在弹性公网IP,会返回错误。
; 如果是黑名单中的用户,会返回错误。; + 查询一台原生容器的详细信息; - 示例: jdc nc associate-elastic-ip --container-id xxx --elastic-ip-id xxx + 示例: jdc nc describe-container --container-id xxx ''', ) - def associate_elastic_ip(self): + def describe_container(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.AssociateElasticIpRequest import AssociateElasticIpRequest + from jdcloud_sdk.services.nc.apis.DescribeContainerRequest import DescribeContainerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AssociateElasticIpRequest(params_dict, headers) + req = DescribeContainerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -314,29 +315,28 @@ def associate_elastic_ip(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--elastic-ip-id'], dict(help="""(string) 弹性IP ID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 容器解绑公网 IP,解绑的是主网卡、主内网 IP 对应的弹性 IP.; ''', + help=''' 容器状态必须为 stopped、running 或 error状态。
; 按量付费的实例,如不主动删除将一直运行,不再使用的实例,可通过本接口主动停用。
; 只能支持主动删除按量计费类型的实例。包年包月过期的容器也可以删除,其它的情况还请发工单系统。计费状态异常的容器无法删除。; ''', description=''' - 容器解绑公网 IP,解绑的是主网卡、主内网 IP 对应的弹性 IP.; + 容器状态必须为 stopped、running 或 error状态。
; 按量付费的实例,如不主动删除将一直运行,不再使用的实例,可通过本接口主动停用。
; 只能支持主动删除按量计费类型的实例。包年包月过期的容器也可以删除,其它的情况还请发工单系统。计费状态异常的容器无法删除。; - 示例: jdc nc disassociate-elastic-ip --container-id xxx --elastic-ip-id xxx + 示例: jdc nc delete-container --container-id xxx ''', ) - def disassociate_elastic_ip(self): + def delete_container(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.DisassociateElasticIpRequest import DisassociateElasticIpRequest + from jdcloud_sdk.services.nc.apis.DeleteContainerRequest import DeleteContainerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisassociateElasticIpRequest(params_dict, headers) + req = DeleteContainerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -348,31 +348,28 @@ def disassociate_elastic_ip(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), - (['--tail-lines'], dict(help="""(int) 返回日志文件中倒数 tailLines 行,如不指定,默认从容器启动时或 sinceSeconds 指定的时间读取。; """, dest='tailLines', type=int, required=False)), - (['--since-seconds'], dict(help="""(int) 返回相对于当前时间之前sinceSeconds之内的日志。; """, dest='sinceSeconds', type=int, required=False)), - (['--limit-bytes'], dict(help="""(int) 限制返回的日志文件内容字节数,取值范围 [1-4]KB,最大 4KB.; """, dest='limitBytes', type=int, required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个容器日志; ''', + help=''' 启动处于关闭状态的单个容器,处在任务执行中的容器无法启动。
; 容器实例或其绑定的云盘已欠费时,容器将无法正常启动。
; ''', description=''' - 查询单个容器日志; + 启动处于关闭状态的单个容器,处在任务执行中的容器无法启动。
; 容器实例或其绑定的云盘已欠费时,容器将无法正常启动。
; - 示例: jdc nc get-logs --container-id xxx + 示例: jdc nc start-container --container-id xxx ''', ) - def get_logs(self): + def start_container(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.GetLogsRequest import GetLogsRequest + from jdcloud_sdk.services.nc.apis.StartContainerRequest import StartContainerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetLogsRequest(params_dict, headers) + req = StartContainerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -383,29 +380,29 @@ def get_logs(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--resource-type'], dict(help="""(string) resourceType - 资源类型,支持 [container, pod, secret]; """, dest='resourceType', required=True)), + (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询资源的配额,支持:原生容器 pod 和 secret.; ''', + help=''' 停止处于运行状态的单个实例,处于任务执行中的容器无法启动。; ''', description=''' - 查询资源的配额,支持:原生容器 pod 和 secret.; + 停止处于运行状态的单个实例,处于任务执行中的容器无法启动。; - 示例: jdc nc describe-quota --resource-type xxx + 示例: jdc nc stop-container --container-id xxx ''', ) - def describe_quota(self): + def stop_container(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.DescribeQuotaRequest import DescribeQuotaRequest + from jdcloud_sdk.services.nc.apis.StopContainerRequest import StopContainerRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeQuotaRequest(params_dict, headers) + req = StopContainerRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -416,31 +413,31 @@ def describe_quota(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) name - secret名称,支持模糊搜索; """, dest='filters', required=False)), + (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--name'], dict(help="""(string) 容器名称 """, dest='name', required=False)), + (['--description'], dict(help="""(string) 容器描述;和description必须要指定一个 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询 secret 列表。
; 此接口支持分页查询,默认每页20条。; ''', + help=''' 修改容器的 名称 和 描述。; ''', description=''' - 查询 secret 列表。
; 此接口支持分页查询,默认每页20条。; + 修改容器的 名称 和 描述。; - 示例: jdc nc describe-secrets + 示例: jdc nc modify-container-attribute --container-id xxx ''', ) - def describe_secrets(self): + def modify_container_attribute(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.DescribeSecretsRequest import DescribeSecretsRequest + from jdcloud_sdk.services.nc.apis.ModifyContainerAttributeRequest import ModifyContainerAttributeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSecretsRequest(params_dict, headers) + req = ModifyContainerAttributeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -451,31 +448,30 @@ def describe_secrets(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) 机密数据名称,不能重复; """, dest='name', required=True)), - (['--secret-type'], dict(help="""(string) 机密数据的类型,目前仅支持:docker-registry 类型,用来和docker registry认证的类型。; """, dest='secretType', required=True)), - (['--data'], dict(help="""(dockerRegistryData) 机密的数据。
; key 的有效字符包括字母、数字、-、_和.;
; value 是 Base64 编码的字符串,不能包含换行符(在 linux 下使用 base64 -w 0选项),每个value长度上限为4KB,整个data的长度不能超过256KB;
; 必须包含server、username、password 字段,email 字段是可选的。
; """, dest='data', required=False)), + (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--elastic-ip-id'], dict(help="""(string) 弹性IP ID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个 secret,用于存放镜像仓库机密相关信息。; ''', + help=''' 容器绑定弹性公网 IP,绑定的是主网卡、主内网IP对应的弹性IP.
; 一台云主机只能绑定一个弹性公网 IP(主网卡),若主网卡已存在弹性公网IP,会返回错误。
; 如果是黑名单中的用户,会返回错误。; ''', description=''' - 创建一个 secret,用于存放镜像仓库机密相关信息。; + 容器绑定弹性公网 IP,绑定的是主网卡、主内网IP对应的弹性IP.
; 一台云主机只能绑定一个弹性公网 IP(主网卡),若主网卡已存在弹性公网IP,会返回错误。
; 如果是黑名单中的用户,会返回错误。; - 示例: jdc nc create-secret --name xxx --secret-type xxx + 示例: jdc nc associate-elastic-ip --container-id xxx --elastic-ip-id xxx ''', ) - def create_secret(self): + def associate_elastic_ip(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.CreateSecretRequest import CreateSecretRequest + from jdcloud_sdk.services.nc.apis.AssociateElasticIpRequest import AssociateElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateSecretRequest(params_dict, headers) + req = AssociateElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -486,29 +482,30 @@ def create_secret(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) Secret Name """, dest='name', required=True)), + (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--elastic-ip-id'], dict(help="""(string) 弹性IP ID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个 secret 详情; ''', + help=''' 容器解绑公网 IP,解绑的是主网卡、主内网 IP 对应的弹性 IP.; ''', description=''' - 查询单个 secret 详情; + 容器解绑公网 IP,解绑的是主网卡、主内网 IP 对应的弹性 IP.; - 示例: jdc nc describe-secret --name xxx + 示例: jdc nc disassociate-elastic-ip --container-id xxx --elastic-ip-id xxx ''', ) - def describe_secret(self): + def disassociate_elastic_ip(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.DescribeSecretRequest import DescribeSecretRequest + from jdcloud_sdk.services.nc.apis.DisassociateElasticIpRequest import DisassociateElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSecretRequest(params_dict, headers) + req = DisassociateElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -519,29 +516,32 @@ def describe_secret(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) Secret Name """, dest='name', required=True)), + (['--container-id'], dict(help="""(string) Container ID """, dest='containerId', required=True)), + (['--tail-lines'], dict(help="""(int) 返回日志文件中倒数 tailLines 行,如不指定,默认从容器启动时或 sinceSeconds 指定的时间读取。; """, dest='tailLines', type=int, required=False)), + (['--since-seconds'], dict(help="""(int) 返回相对于当前时间之前sinceSeconds之内的日志。; """, dest='sinceSeconds', type=int, required=False)), + (['--limit-bytes'], dict(help="""(int) 限制返回的日志文件内容字节数,取值范围 [1-4]KB,最大 4KB.; """, dest='limitBytes', type=int, required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除单个 secret; ''', + help=''' 查询单个容器日志; ''', description=''' - 删除单个 secret; + 查询单个容器日志; - 示例: jdc nc delete-secret --name xxx + 示例: jdc nc get-logs --container-id xxx ''', ) - def delete_secret(self): + def get_logs(self): client_factory = ClientFactory('nc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.nc.apis.DeleteSecretRequest import DeleteSecretRequest + from jdcloud_sdk.services.nc.apis.GetLogsRequest import GetLogsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteSecretRequest(params_dict, headers) + req = GetLogsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -624,7 +624,7 @@ def attach(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-containers','create-containers','describe-container','delete-container','start-container','stop-container','modify-container-attribute','associate-elastic-ip','disassociate-elastic-ip','get-logs','describe-quota','describe-secrets','create-secret','describe-secret','delete-secret',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-secrets','create-secret','describe-secret','delete-secret','describe-quota','describe-containers','create-containers','describe-container','delete-container','start-container','stop-container','modify-container-attribute','associate-elastic-ip','disassociate-elastic-ip','get-logs',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/oss.py b/jdcloud_cli/controllers/services/oss.py index 206f25a..89d0b27 100644 --- a/jdcloud_cli/controllers/services/oss.py +++ b/jdcloud_cli/controllers/services/oss.py @@ -40,6 +40,7 @@ class Meta: arguments=[ (['--region-id'], dict(help="""(string) Region ID,例如:cn-north-1 """, dest='regionId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -73,6 +74,7 @@ def list_buckets(self): (['--region-id'], dict(help="""(string) Region ID,例如:cn-north-1 """, dest='regionId', required=False)), (['--bucketname'], dict(help="""(string) bucket名字,例如:test-bucket """, dest='bucketname', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -106,6 +108,7 @@ def put_bucket(self): (['--region-id'], dict(help="""(string) Region ID,例如:cn-north-1 """, dest='regionId', required=False)), (['--bucketname'], dict(help="""(string) bucket名字,例如:test-bucket """, dest='bucketname', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -139,6 +142,7 @@ def delete_bucket(self): (['--region-id'], dict(help="""(string) Region ID,例如:cn-north-1 """, dest='regionId', required=False)), (['--bucketname'], dict(help="""(string) bucket名字,例如:test-bucket """, dest='bucketname', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, diff --git a/jdcloud_cli/controllers/services/ossopenapi.py b/jdcloud_cli/controllers/services/ossopenapi.py index 01f86d2..163e491 100644 --- a/jdcloud_cli/controllers/services/ossopenapi.py +++ b/jdcloud_cli/controllers/services/ossopenapi.py @@ -46,6 +46,7 @@ class Meta: (['--period-type'], dict(help="""(int) 查询数据的聚合方式:
0:all, 最大查询区间365天
1:hour,最大查询区间31天。默认1
2:day, 最大查询区间365天。 """, dest='periodType', type=int, required=False)), (['--method'], dict(help="""(int) 返回数据的方式: 1:recent(区间值), 2:current(当前值。method = 2 时如果查询当前值时传入beginTime,则按照beginTime时间来进行查询;如果不传beginTime,则按照后端系统时间查询。) """, dest='method', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -53,7 +54,7 @@ class Meta: description=''' 根据type获取指定bucket用量数据。 - 示例: jdc ossopenapi get-single-bucket-capacity --bucket-name xxx --capacity-types [0] --method 0 + 示例: jdc ossopenapi get-single-bucket-capacity --bucket-name xxx --capacity-types [5] --method 5 ''', ) def get_single_bucket_capacity(self): @@ -79,6 +80,7 @@ def get_single_bucket_capacity(self): (['--region-id'], dict(help="""(string) 区域ID """, dest='regionId', required=False)), (['--bucket-name'], dict(help="""(string) Bucket名称 """, dest='bucketName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -113,6 +115,7 @@ def get_back_source_configuration(self): (['--bucket-name'], dict(help="""(string) Bucket名称 """, dest='bucketName', required=True)), (['--back-source-rules'], dict(help="""(array: backSourceRule) 回源配置规则 """, dest='backSourceRules', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -146,6 +149,7 @@ def put_back_source_configuration(self): (['--region-id'], dict(help="""(string) 区域ID """, dest='regionId', required=False)), (['--bucket-name'], dict(help="""(string) Bucket名称 """, dest='bucketName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -176,7 +180,153 @@ def delete_back_source_configuration(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['get-single-bucket-capacity','get-back-source-configuration','put-back-source-configuration','delete-back-source-configuration',], required=True)), + (['--region-id'], dict(help="""(string) 区域ID """, dest='regionId', required=False)), + (['--bucket-name'], dict(help="""(string) Bucket名称 """, dest='bucketName', required=True)), + (['--task-id'], dict(help="""(string) 任务ID """, dest='taskId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 根据bucket名称获取该bucket下的同步任务 ''', + description=''' + 根据bucket名称获取该bucket下的同步任务。 + + 示例: jdc ossopenapi get-historical-replicat-task --bucket-name xxx --task-id xxx + ''', + ) + def get_historical_replicat_task(self): + client_factory = ClientFactory('ossopenapi') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ossopenapi.apis.GetHistoricalReplicatTaskRequest import GetHistoricalReplicatTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = GetHistoricalReplicatTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域ID """, dest='regionId', required=False)), + (['--bucket-name'], dict(help="""(string) Bucket名称 """, dest='bucketName', required=True)), + (['--task-id'], dict(help="""(string) 任务ID """, dest='taskId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 停止bucket名称获取该bucket下的同步任务 ''', + description=''' + 停止bucket名称获取该bucket下的同步任务。 + + 示例: jdc ossopenapi abort-historical-replicat-task --bucket-name xxx --task-id xxx + ''', + ) + def abort_historical_replicat_task(self): + client_factory = ClientFactory('ossopenapi') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ossopenapi.apis.AbortHistoricalReplicatTaskRequest import AbortHistoricalReplicatTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = AbortHistoricalReplicatTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域ID """, dest='regionId', required=False)), + (['--bucket-name'], dict(help="""(string) Bucket名称 """, dest='bucketName', required=True)), + (['--marker'], dict(help="""(string) 同步任务列表开始的key """, dest='marker', required=False)), + (['--limit'], dict(help="""(int) 每次查询返回的结果数,默认为1000 """, dest='limit', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 根据bucket名称获取该bucket下的同步任务列表 ''', + description=''' + 根据bucket名称获取该bucket下的同步任务列表。 + + 示例: jdc ossopenapi list-historical-replicat-tasks --bucket-name xxx + ''', + ) + def list_historical_replicat_tasks(self): + client_factory = ClientFactory('ossopenapi') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ossopenapi.apis.ListHistoricalReplicatTasksRequest import ListHistoricalReplicatTasksRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ListHistoricalReplicatTasksRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 区域ID """, dest='regionId', required=False)), + (['--bucket-name'], dict(help="""(string) Bucket名称 """, dest='bucketName', required=True)), + (['--action'], dict(help="""(string) 是否覆盖 """, dest='action', required=True)), + (['--bucket-region'], dict(help="""(string) bucket所属区域 """, dest='bucketRegion', required=True)), + (['--target-bucket-name'], dict(help="""(string) 目标bucket名称 """, dest='targetBucketName', required=True)), + (['--target-bucket-region'], dict(help="""(string) 目标bucket所属区域 """, dest='targetBucketRegion', required=True)), + (['--storage-class'], dict(help="""(string) 存储类型 """, dest='storageClass', required=True)), + (['--prefix-set'], dict(help="""(array: string) NA """, dest='prefixSet', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建历史同步任务 ''', + description=''' + 创建历史同步任务。 + + 示例: jdc ossopenapi create-historical-replicat-task --bucket-name xxx --action xxx --bucket-region xxx --target-bucket-name xxx --target-bucket-region xxx --storage-class xxx + ''', + ) + def create_historical_replicat_task(self): + client_factory = ClientFactory('ossopenapi') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.ossopenapi.apis.CreateHistoricalReplicatTaskRequest import CreateHistoricalReplicatTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateHistoricalReplicatTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--api'], dict(help="""(string) api name """, choices=['get-single-bucket-capacity','get-back-source-configuration','put-back-source-configuration','delete-back-source-configuration','get-historical-replicat-task','abort-historical-replicat-task','list-historical-replicat-tasks','create-historical-replicat-task',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/partner.py b/jdcloud_cli/controllers/services/partner.py index 5e28364..bb345fa 100644 --- a/jdcloud_cli/controllers/services/partner.py +++ b/jdcloud_cli/controllers/services/partner.py @@ -47,6 +47,7 @@ class Meta: (['--page-index'], dict(help="""(int) 当前页序号 """, dest='pageIndex', type=int, required=False)), (['--page-size'], dict(help="""(int) 当前条数 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -81,6 +82,7 @@ def query_my_customer_list(self): (['--start-time'], dict(help="""(string) 按月查询开始时间(yyyy/MM/dd) """, dest='startTime', required=True)), (['--end-time'], dict(help="""(string) 按月查询结束时间(yyyy/MM/dd) """, dest='endTime', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -118,6 +120,7 @@ def get_total_consumption(self): (['--page-size'], dict(help="""(int) 每页条数 """, dest='pageSize', type=int, required=True)), (['--page-index'], dict(help="""(int) 第几页 """, dest='pageIndex', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -125,7 +128,7 @@ def get_total_consumption(self): description=''' 查询服务商下每个客户总消费数据。 - 示例: jdc partner get-each-consumption --start-time xxx --end-time xxx --page-size 0 --page-index 0 + 示例: jdc partner get-each-consumption --start-time xxx --end-time xxx --page-size 5 --page-index 5 ''', ) def get_each_consumption(self): @@ -155,6 +158,7 @@ def get_each_consumption(self): (['--page-size'], dict(help="""(int) 每页条数,不超过100 """, dest='pageSize', type=int, required=True)), (['--page-index'], dict(help="""(int) 第几页 """, dest='pageIndex', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -162,7 +166,7 @@ def get_each_consumption(self): description=''' 查询服务商相关pin下每个产品的消费数据。 - 示例: jdc partner describe-customer-bill-by-product --start-time xxx --end-time xxx --page-size 0 --page-index 0 + 示例: jdc partner describe-customer-bill-by-product --start-time xxx --end-time xxx --page-size 5 --page-index 5 ''', ) def describe_customer_bill_by_product(self): diff --git a/jdcloud_cli/controllers/services/pod.py b/jdcloud_cli/controllers/services/pod.py index 5393f0d..3510137 100644 --- a/jdcloud_cli/controllers/services/pod.py +++ b/jdcloud_cli/controllers/services/pod.py @@ -39,6 +39,309 @@ class Meta: stacked_on = 'base' stacked_type = 'nested' + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) name - secret名称,支持模糊搜索; """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询 secret 列表。
; 此接口支持分页查询,默认每页20条。; ''', + description=''' + 查询 secret 列表。
; 此接口支持分页查询,默认每页20条。; + + 示例: jdc pod describe-secrets + ''', + ) + def describe_secrets(self): + client_factory = ClientFactory('pod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.pod.apis.DescribeSecretsRequest import DescribeSecretsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeSecretsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--name'], dict(help="""(string) 机密数据名称,不能重复; """, dest='name', required=True)), + (['--secret-type'], dict(help="""(string) 机密数据的类型,目前仅支持:docker-registry 类型,用来和docker registry认证的类型。; """, dest='secretType', required=True)), + (['--data'], dict(help="""(dockerRegistryData) 机密的数据。
; key 的有效字符包括字母、数字、-、_和.;
; value 是 Base64 编码的字符串,不能包含换行符(在 linux 下使用 base64 -w 0选项),每个value长度上限为4KB,整个data的长度不能超过256KB;
; 必须包含server、username、password 字段,email 字段是可选的。
; """, dest='data', required=True)), + (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建一个 secret,用于存放镜像仓库机密相关信息。; ''', + description=''' + 创建一个 secret,用于存放镜像仓库机密相关信息。; + + 示例: jdc pod create-secret --name xxx --secret-type xxx --data {"":""} + ''', + ) + def create_secret(self): + client_factory = ClientFactory('pod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.pod.apis.CreateSecretRequest import CreateSecretRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateSecretRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--name'], dict(help="""(string) Secret Name """, dest='name', required=True)), + (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询单个 secret 详情; ''', + description=''' + 查询单个 secret 详情; + + 示例: jdc pod describe-secret --name xxx + ''', + ) + def describe_secret(self): + client_factory = ClientFactory('pod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.pod.apis.DescribeSecretRequest import DescribeSecretRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeSecretRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--name'], dict(help="""(string) Secret Name """, dest='name', required=True)), + (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除单个 secret; ''', + description=''' + 删除单个 secret; + + 示例: jdc pod delete-secret --name xxx + ''', + ) + def delete_secret(self): + client_factory = ClientFactory('pod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.pod.apis.DeleteSecretRequest import DeleteSecretRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteSecretRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--name'], dict(help="""(string) ConfigFile 的名字,名称不能重复; 长度不超过63(命名字母小写,数字和-); """, dest='name', required=True)), + (['--data'], dict(help="""(array: configFileData) configFile数据,个数不超过32个; """, dest='data', required=True)), + (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建一个 configFile,存放文件内容(键值对)。; ''', + description=''' + 创建一个 configFile,存放文件内容(键值对)。; + + 示例: jdc pod create-config-file --name xxx --data [{"":""}] + ''', + ) + def create_config_file(self): + client_factory = ClientFactory('pod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.pod.apis.CreateConfigFileRequest import CreateConfigFileRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateConfigFileRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--name'], dict(help="""(string) Name """, dest='name', required=True)), + (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询单个 configFile 详情; ''', + description=''' + 查询单个 configFile 详情; + + 示例: jdc pod describe-config-file --name xxx + ''', + ) + def describe_config_file(self): + client_factory = ClientFactory('pod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.pod.apis.DescribeConfigFileRequest import DescribeConfigFileRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeConfigFileRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--name'], dict(help="""(string) Name """, dest='name', required=True)), + (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除单个 configFile; ''', + description=''' + 删除单个 configFile; + + 示例: jdc pod delete-config-file --name xxx + ''', + ) + def delete_config_file(self): + client_factory = ClientFactory('pod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.pod.apis.DeleteConfigFileRequest import DeleteConfigFileRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteConfigFileRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--name'], dict(help="""(string) Name """, dest='name', required=True)), + (['--data'], dict(help="""(array: configFileData) configFile数据,个数不超过32个; """, dest='data', required=True)), + (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 更新configFile信息; ''', + description=''' + 更新configFile信息; + + 示例: jdc pod update-config-file --name xxx --data [{"":""}] + ''', + ) + def update_config_file(self): + client_factory = ClientFactory('pod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.pod.apis.UpdateConfigFileRequest import UpdateConfigFileRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateConfigFileRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--resource-type'], dict(help="""(string) resourceType - 资源类型,支持 [container, pod, secret]; """, dest='resourceType', required=True)), + (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询资源的配额,支持:原生容器 pod 和 secret.; ''', + description=''' + 查询资源的配额,支持:原生容器 pod 和 secret.; + + 示例: jdc pod describe-quota --resource-type xxx + ''', + ) + def describe_quota(self): + client_factory = ClientFactory('pod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.pod.apis.DescribeQuotaRequest import DescribeQuotaRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeQuotaRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), @@ -160,7 +463,7 @@ def exec_get_exit_code(self): description=''' 设置TTY大小 - 示例: jdc pod resize-tty --pod-id xxx --container-name xxx --height 0 --width 0 + 示例: jdc pod resize-tty --pod-id xxx --container-name xxx --height 5 --width 5 ''', ) def resize_tty(self): @@ -181,45 +484,12 @@ def resize_tty(self): except Exception as e: print(e) - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--filters'], dict(help="""(array: filter) instanceTypes - 实例规格,精确匹配,支持多个; az - 可用区,精确匹配,支持多个; """, dest='filters', required=False)), - (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查询实例规格信息列表; ''', - description=''' - 查询实例规格信息列表; - - 示例: jdc pod describe-instance-types - ''', - ) - def describe_instance_types(self): - client_factory = ClientFactory('pod') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.pod.apis.DescribeInstanceTypesRequest import DescribeInstanceTypesRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DescribeInstanceTypesRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) podId - pod ID,精确匹配,支持多个; privateIpAddress - 主网卡IP地址,精确匹配,支持单个; az - 可用区,精确匹配,支持多个; vpcId - 私有网络ID,精确匹配,支持多个; phase - pod 状态,精确匹配,支持多个; name - 实例名称,模糊匹配,支持单个; subnetId - 镜像ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) podId - pod ID,精确匹配,支持多个; privateIpAddress - 主网卡IP地址,模糊匹配,支持单个; az - 可用区,精确匹配,支持多个; vpcId - 私有网络ID,精确匹配,支持多个; phase - pod 状态,精确匹配,支持多个; name - 实例名称,模糊匹配,支持单个; subnetId - 镜像ID,精确匹配,支持多个; agId - 镜像ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), @@ -260,11 +530,11 @@ def describe_pods(self): (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一台或多台 pod; - 创建pod需要通过实名认证; - hostname规范; - 支持两种方式:以标签方式书写或以完整主机名方式书写; - 标签规范; - 0-9,a-z(不分大小写)和-(减号),其他的都是无效的字符串; - 不能以减号开始,也不能以减号结尾; - 最小1个字符,最大63个字符; - 完整的主机名由一系列标签与点连接组成; - 标签与标签之间使用“.”(点)进行连接; - 不能以“.”(点)开始,也不能以“.”(点)结尾; - 整个主机名(包括标签以及分隔点“.”)最多有63个ASCII字符; - 网络配置; - 指定主网卡配置信息; - 必须指定subnetId; - 可以指定elasticIp规格来约束创建的弹性IP,带宽取值范围[1-100]Mbps,步进1Mbps; - 可以指定网卡的主IP(primaryIpAddress)和辅助IP(secondaryIpAddresses),此时maxCount只能为1; - 可以设置网卡的自动删除autoDelete属性,指明是否删除实例时自动删除网卡; - 安全组securityGroup需与子网Subnet在同一个私有网络VPC内; - 一个 pod 创建时至多指定5个安全组; - 主网卡deviceIndex设置为1; - 存储; - volume分为container system disk和pod data volume,container system disk的挂载目录是/,data volume的挂载目录可以随意指定; - container system disk; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[20,100]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - data volume; - 当前只能选择cloud类别; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[20,2000]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - 可以从快照创建磁盘; - pod 容器日志; - default:默认在本地分配10MB的存储空间,自动rotate; - DNS-1123 label规范; - 支持数字、小写字母、英文中划线“-”,但不支持以“-”作为开始字符和结束字符,1~63字符。; - 例子: my-name, 123-abc; - DNS-1123 subdomain规范; - 由一或多个标签组成,标签之间用'.'分隔;标签可由小写字母、数字、英文中划线'-'构成,标签首尾不可为'-';所有字符总长度为1~253。; - 例子: example.com, registry.docker-cn.com; - 其他; - 创建完成后,pod 状态为running; - maxCount为最大努力,不保证一定能达到maxCount; ''', + help=''' 创建一台或多台 pod; - 创建pod需要通过实名认证; - 可用区; - Pod所属的可用区; - 创建Pod,需要使用中心可用区的相关资源:; - 具有中心可用区属性的子网; - 公网IP服务商; - hostname规范; - 支持两种方式:以标签方式书写或以完整主机名方式书写; - 标签规范; - 0-9,a-z(不分大小写)和-(减号),其他的都是无效的字符串; - 不能以减号开始,也不能以减号结尾; - 最小1个字符,最大63个字符; - 完整的主机名由一系列标签与点连接组成; - 标签与标签之间使用“.”(点)进行连接; - 不能以“.”(点)开始,也不能以“.”(点)结尾; - 整个主机名(包括标签以及分隔点“.”)最多有63个ASCII字符; - 网络配置; - 指定主网卡配置信息; - 必须指定subnetId; - 可以指定elasticIp规格来约束创建的弹性IP,带宽取值范围[1-100]Mbps,步进1Mbps; - 可以指定网卡的主IP(primaryIpAddress)和辅助IP(secondaryIpAddresses),此时maxCount只能为1; - 可以设置网卡的自动删除autoDelete属性,指明是否删除实例时自动删除网卡; - 安全组securityGroup需与子网Subnet在同一个私有网络VPC内; - 一个 pod 创建时至多指定5个安全组; - 主网卡deviceIndex设置为1; - 存储; - volume分为container system disk和pod data volume,container system disk的挂载目录是/,data volume的挂载目录可以随意指定; - container system disk; - 支持cloud和local; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[20,100]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - data volume; -cloudDisk; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[20,2000]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - 可以从快照创建磁盘; -CFS; - 从zbs去获取数据,挂载到当前的volume; -configFile; - 提前创建好configFile相关数据,然后挂载到volume; ; ; - pod 容器日志; - default:默认在本地分配10MB的存储空间,自动rotate; - DNS-1123 label规范; - 支持数字、小写字母、英文中划线“-”,但不支持以“-”作为开始字符和结束字符,1~63字符。; - 例子: my-name, 123-abc; - DNS-1123 subdomain规范; - 由一或多个标签组成,标签之间用'.'分隔;标签可由小写字母、数字、英文中划线'-'构成,标签首尾不可为'-';所有字符总长度为1~253。; - 例子: example.com, registry.docker-cn.com; - 其他; - 创建完成后,pod 状态为running; - maxCount为最大努力,不保证一定能达到maxCount; ''', description=''' - 创建一台或多台 pod; - 创建pod需要通过实名认证; - hostname规范; - 支持两种方式:以标签方式书写或以完整主机名方式书写; - 标签规范; - 0-9,a-z(不分大小写)和-(减号),其他的都是无效的字符串; - 不能以减号开始,也不能以减号结尾; - 最小1个字符,最大63个字符; - 完整的主机名由一系列标签与点连接组成; - 标签与标签之间使用“.”(点)进行连接; - 不能以“.”(点)开始,也不能以“.”(点)结尾; - 整个主机名(包括标签以及分隔点“.”)最多有63个ASCII字符; - 网络配置; - 指定主网卡配置信息; - 必须指定subnetId; - 可以指定elasticIp规格来约束创建的弹性IP,带宽取值范围[1-100]Mbps,步进1Mbps; - 可以指定网卡的主IP(primaryIpAddress)和辅助IP(secondaryIpAddresses),此时maxCount只能为1; - 可以设置网卡的自动删除autoDelete属性,指明是否删除实例时自动删除网卡; - 安全组securityGroup需与子网Subnet在同一个私有网络VPC内; - 一个 pod 创建时至多指定5个安全组; - 主网卡deviceIndex设置为1; - 存储; - volume分为container system disk和pod data volume,container system disk的挂载目录是/,data volume的挂载目录可以随意指定; - container system disk; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[20,100]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - data volume; - 当前只能选择cloud类别; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[20,2000]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - 可以从快照创建磁盘; - pod 容器日志; - default:默认在本地分配10MB的存储空间,自动rotate; - DNS-1123 label规范; - 支持数字、小写字母、英文中划线“-”,但不支持以“-”作为开始字符和结束字符,1~63字符。; - 例子: my-name, 123-abc; - DNS-1123 subdomain规范; - 由一或多个标签组成,标签之间用'.'分隔;标签可由小写字母、数字、英文中划线'-'构成,标签首尾不可为'-';所有字符总长度为1~253。; - 例子: example.com, registry.docker-cn.com; - 其他; - 创建完成后,pod 状态为running; - maxCount为最大努力,不保证一定能达到maxCount; + 创建一台或多台 pod; - 创建pod需要通过实名认证; - 可用区; - Pod所属的可用区; - 创建Pod,需要使用中心可用区的相关资源:; - 具有中心可用区属性的子网; - 公网IP服务商; - hostname规范; - 支持两种方式:以标签方式书写或以完整主机名方式书写; - 标签规范; - 0-9,a-z(不分大小写)和-(减号),其他的都是无效的字符串; - 不能以减号开始,也不能以减号结尾; - 最小1个字符,最大63个字符; - 完整的主机名由一系列标签与点连接组成; - 标签与标签之间使用“.”(点)进行连接; - 不能以“.”(点)开始,也不能以“.”(点)结尾; - 整个主机名(包括标签以及分隔点“.”)最多有63个ASCII字符; - 网络配置; - 指定主网卡配置信息; - 必须指定subnetId; - 可以指定elasticIp规格来约束创建的弹性IP,带宽取值范围[1-100]Mbps,步进1Mbps; - 可以指定网卡的主IP(primaryIpAddress)和辅助IP(secondaryIpAddresses),此时maxCount只能为1; - 可以设置网卡的自动删除autoDelete属性,指明是否删除实例时自动删除网卡; - 安全组securityGroup需与子网Subnet在同一个私有网络VPC内; - 一个 pod 创建时至多指定5个安全组; - 主网卡deviceIndex设置为1; - 存储; - volume分为container system disk和pod data volume,container system disk的挂载目录是/,data volume的挂载目录可以随意指定; - container system disk; - 支持cloud和local; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[20,100]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - data volume; -cloudDisk; - 云硬盘类型可以选择hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - 所有类型:范围[20,2000]GB,步长为10G; - 自动删除; - 默认自动删除; - 可以选择已存在的云硬盘; - 可以从快照创建磁盘; -CFS; - 从zbs去获取数据,挂载到当前的volume; -configFile; - 提前创建好configFile相关数据,然后挂载到volume; ; ; - pod 容器日志; - default:默认在本地分配10MB的存储空间,自动rotate; - DNS-1123 label规范; - 支持数字、小写字母、英文中划线“-”,但不支持以“-”作为开始字符和结束字符,1~63字符。; - 例子: my-name, 123-abc; - DNS-1123 subdomain规范; - 由一或多个标签组成,标签之间用'.'分隔;标签可由小写字母、数字、英文中划线'-'构成,标签首尾不可为'-';所有字符总长度为1~253。; - 例子: example.com, registry.docker-cn.com; - 其他; - 创建完成后,pod 状态为running; - maxCount为最大努力,不保证一定能达到maxCount; - 示例: jdc pod create-pods --pod-spec {"":""} --max-count 0 + 示例: jdc pod create-pods --pod-spec {"":""} --max-count 5 ''', ) def create_pods(self): @@ -663,166 +933,30 @@ def resize_pod(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--resource-type'], dict(help="""(string) resourceType - 资源类型,支持 [container, pod, secret]; """, dest='resourceType', required=True)), - (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查询资源的配额,支持:原生容器 pod 和 secret.; ''', - description=''' - 查询资源的配额,支持:原生容器 pod 和 secret.; - - 示例: jdc pod describe-quota --resource-type xxx - ''', - ) - def describe_quota(self): - client_factory = ClientFactory('pod') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.pod.apis.DescribeQuotaRequest import DescribeQuotaRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DescribeQuotaRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) name - secret名称,支持模糊搜索; """, dest='filters', required=False)), - (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查询 secret 列表。
; 此接口支持分页查询,默认每页20条。; ''', - description=''' - 查询 secret 列表。
; 此接口支持分页查询,默认每页20条。; - - 示例: jdc pod describe-secrets - ''', - ) - def describe_secrets(self): - client_factory = ClientFactory('pod') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.pod.apis.DescribeSecretsRequest import DescribeSecretsRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DescribeSecretsRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) 机密数据名称,不能重复; """, dest='name', required=True)), - (['--secret-type'], dict(help="""(string) 机密数据的类型,目前仅支持:docker-registry 类型,用来和docker registry认证的类型。; """, dest='secretType', required=True)), - (['--data'], dict(help="""(dockerRegistryData) 机密的数据。
; key 的有效字符包括字母、数字、-、_和.;
; value 是 Base64 编码的字符串,不能包含换行符(在 linux 下使用 base64 -w 0选项),每个value长度上限为4KB,整个data的长度不能超过256KB;
; 必须包含server、username、password 字段,email 字段是可选的。
; """, dest='data', required=True)), - (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 创建一个 secret,用于存放镜像仓库机密相关信息。; ''', - description=''' - 创建一个 secret,用于存放镜像仓库机密相关信息。; - - 示例: jdc pod create-secret --name xxx --secret-type xxx --data {"":""} - ''', - ) - def create_secret(self): - client_factory = ClientFactory('pod') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.pod.apis.CreateSecretRequest import CreateSecretRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = CreateSecretRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) Secret Name """, dest='name', required=True)), - (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 查询单个 secret 详情; ''', - description=''' - 查询单个 secret 详情; - - 示例: jdc pod describe-secret --name xxx - ''', - ) - def describe_secret(self): - client_factory = ClientFactory('pod') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.pod.apis.DescribeSecretRequest import DescribeSecretRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = DescribeSecretRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) Secret Name """, dest='name', required=True)), + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--filters'], dict(help="""(array: filter) instanceTypes - 实例规格,精确匹配,支持多个; az - 可用区,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式:--input-json file:///xxxx.json', dest='input_json', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除单个 secret; ''', + help=''' 查询实例规格信息列表; ''', description=''' - 删除单个 secret; + 查询实例规格信息列表; - 示例: jdc pod delete-secret --name xxx + 示例: jdc pod describe-instance-types ''', ) - def delete_secret(self): + def describe_instance_types(self): client_factory = ClientFactory('pod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.pod.apis.DeleteSecretRequest import DeleteSecretRequest + from jdcloud_sdk.services.pod.apis.DescribeInstanceTypesRequest import DescribeInstanceTypesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteSecretRequest(params_dict, headers) + req = DescribeInstanceTypesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -878,7 +1012,7 @@ def attach(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-container','exec-create','exec-get-exit-code','resize-tty','describe-instance-types','describe-pods','create-pods','check-pod-name','describe-pod','delete-pod','start-pod','stop-pod','modify-pod-attribute','associate-elastic-ip','disassociate-elastic-ip','get-container-logs','rebuild-pod','resize-pod','describe-quota','describe-secrets','create-secret','describe-secret','delete-secret',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-secrets','create-secret','describe-secret','delete-secret','create-config-file','describe-config-file','delete-config-file','update-config-file','describe-quota','describe-container','exec-create','exec-get-exit-code','resize-tty','describe-pods','create-pods','check-pod-name','describe-pod','delete-pod','start-pod','stop-pod','modify-pod-attribute','associate-elastic-ip','disassociate-elastic-ip','get-container-logs','rebuild-pod','resize-pod','describe-instance-types',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/portal.py b/jdcloud_cli/controllers/services/portal.py index 4444ae5..addf44c 100644 --- a/jdcloud_cli/controllers/services/portal.py +++ b/jdcloud_cli/controllers/services/portal.py @@ -43,6 +43,7 @@ class Meta: (['--lang'], dict(help="""(string) 中文cn 英文en """, dest='lang', required=True)), (['--ak'], dict(help="""(string) 外部使用ak; """, dest='ak', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -77,6 +78,7 @@ def describe_product(self): (['--id'], dict(help="""(int) 语言类型;中文cn;英文en; """, dest='id', type=int, required=True)), (['--ak'], dict(help="""(string) 外部使用ak; """, dest='ak', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -84,7 +86,7 @@ def describe_product(self): description=''' 产品页列表查询接口; 。 - 示例: jdc portal describe-products-by-id --id 0 --ak xxx + 示例: jdc portal describe-products-by-id --id 5 --ak xxx ''', ) def describe_products_by_id(self): diff --git a/jdcloud_cli/controllers/services/rds.py b/jdcloud_cli/controllers/services/rds.py index 7cf2922..054929c 100644 --- a/jdcloud_cli/controllers/services/rds.py +++ b/jdcloud_cli/controllers/services/rds.py @@ -36,6 +36,114 @@ class Meta: stacked_on = 'base' stacked_type = 'nested' + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、30、50、100 """, dest='pageSize', type=int, required=False)), + (['--start-time'], dict(help="""(string) 查询开始时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到结束时间不超过三天 """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询结束时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到结束时间不超过三天 """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取MySQL实例中binlog的详细信息
- 仅支持 MySQL, Percona, MariaDB ''', + description=''' + 获取MySQL实例中binlog的详细信息
- 仅支持 MySQL, Percona, MariaDB。 + + 示例: jdc rds describe-binlogs --instance-id xxx + ''', + ) + def describe_binlogs(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DescribeBinlogsRequest import DescribeBinlogsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeBinlogsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--binlog-backup-id'], dict(help="""(string) binlog的备份ID,可以通过describeBinlogs获得 """, dest='binlogBackupId', required=True)), + (['--seconds'], dict(help="""(int) 设置链接地址的过期时间,单位是秒,默认值是 300 秒,最长不能超过取值范围为 1 ~ 86400 秒 """, dest='seconds', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取MySQL实例的binlog的下载链接
- 仅支持 MySQL, Percona, MariaDB ''', + description=''' + 获取MySQL实例的binlog的下载链接
- 仅支持 MySQL, Percona, MariaDB。 + + 示例: jdc rds describe-binlog-download-url --instance-id xxx --binlog-backup-id xxx + ''', + ) + def describe_binlog_download_url(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DescribeBinlogDownloadURLRequest import DescribeBinlogDownloadURLRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeBinlogDownloadURLRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 清理本地的binlog并释放空间。 系统只会清理已经备份到存储的binlog,不会影响MySQL实例的备份恢复
- 仅支持MySQL ''', + description=''' + 清理本地的binlog并释放空间。 系统只会清理已经备份到存储的binlog,不会影响MySQL实例的备份恢复
- 仅支持MySQL。 + + 示例: jdc rds clear-binlogs --instance-id xxx + ''', + ) + def clear_binlogs(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.ClearBinlogsRequest import ClearBinlogsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ClearBinlogsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), @@ -43,6 +151,7 @@ class Meta: (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为100,取值范围:[10,100],用于查询列表的接口 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -79,6 +188,7 @@ def describe_accounts(self): (['--account-password'], dict(help="""(string) 密码,密码的具体规则可参见帮助中心文档:[名称及密码限制](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='accountPassword', required=True)), (['--notes'], dict(help="""(string) 备注信息,仅支持PostgreSQL """, dest='notes', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -113,6 +223,7 @@ def create_account(self): (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--account-name'], dict(help="""(string) 账号名,在同一个实例中账号名不能重复 """, dest='accountName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -147,6 +258,7 @@ def describe_account_privilege(self): (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--account-name'], dict(help="""(string) 账号名,在同一个实例中账号名不能重复 """, dest='accountName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -182,6 +294,7 @@ def delete_account(self): (['--account-name'], dict(help="""(string) 账号名,在同一个实例中账号名不能重复 """, dest='accountName', required=True)), (['--account-privileges'], dict(help="""(array: accountPrivilege) 账号的访问权限 """, dest='accountPrivileges', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -217,6 +330,7 @@ def grant_privilege(self): (['--account-name'], dict(help="""(string) 账号名,在同一个实例中账号名不能重复 """, dest='accountName', required=True)), (['--db-names'], dict(help="""(array: string) 需要取消授权的数据库的名称。权限取消后,该账号将不能访问此数据库 """, dest='dbNames', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -252,6 +366,7 @@ def revoke_privilege(self): (['--account-name'], dict(help="""(string) 账号名,在同一个实例中账号名不能重复 """, dest='accountName', required=True)), (['--account-password'], dict(help="""(string) 新密码,密码的具体规则可参见帮助中心文档:[名称及密码限制](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='accountPassword', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -287,6 +402,7 @@ def reset_password(self): (['--account-name'], dict(help="""(string) 账号名,在同一个RDS实例中,账号名不能重复。账号名的具体规则可参见帮助中心文档:[名称及密码限制](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='accountName', required=True)), (['--account-password'], dict(help="""(string) 密码,密码的具体规则可参见帮助中心文档:[名称及密码限制](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='accountPassword', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -323,6 +439,7 @@ def create_super_account(self): (['--database-privileges'], dict(help="""(array: array) 设置数据库细粒度权限内容 """, dest='databasePrivileges', required=False)), (['--global-privileges'], dict(help="""(array) 设置全局权限,权限的具体定义参见[枚举参数定义](../Enum-Definitions/Enum-Definitions.md) """, dest='globalPrivileges', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -356,27 +473,28 @@ def grant_account_privilege(self): (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看当前实例已开启的审计选项。如当前实例未开启审计,则返回空
- 仅支持SQL Server ''', + help=''' 查看某个RDS实例下的运维账号信息。
- 仅支持 MySQL,Percona,MariaDB ''', description=''' - 查看当前实例已开启的审计选项。如当前实例未开启审计,则返回空
- 仅支持SQL Server。 + 查看某个RDS实例下的运维账号信息。
- 仅支持 MySQL,Percona,MariaDB。 - 示例: jdc rds describe-audit --instance-id xxx + 示例: jdc rds describe-accounts-for-ops --instance-id xxx ''', ) - def describe_audit(self): + def describe_accounts_for_ops(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeAuditRequest import DescribeAuditRequest + from jdcloud_sdk.services.rds.apis.DescribeAccountsForOpsRequest import DescribeAccountsForOpsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAuditRequest(params_dict, headers) + req = DescribeAccountsForOpsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -388,29 +506,30 @@ def describe_audit(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--enabled'], dict(help="""(string) 要开启的审计选项,各个选项之间用英文逗号或空格进行分割,例如:DATABASE_OBJECT_ACCESS_GROUP,ACKUP_RESTORE_GROU等
各个数据库版本支持的审计选项可以通过接口[describeAuditOptions](./describeAuditOptions.md)获得,各个审计项的具体含义可以参看微软的官方文档 """, dest='enabled', required=True)), + (['--expired-time'], dict(help="""(string) 运维账号到期时间,UTC时间格式 """, dest='expiredTime', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启SQL Server的数据库审计功能,目前支持实例级的数据库审计。用户可以根据需要开启、关闭审计、自定义审计策略,并下载审计文件。审计文件为原生的SQL Server审计文件,缺省保存6个月。
- 仅支持SQL Server ''', + help=''' 创建数据库临时运维账号。
如果在使用数据库过程中需要京东云提供技术支持,并且需要对您的实例进行操作,您可以把临时运维账号提供给技术支持人员。
临时运维账号默认授予全局Select、Process权限,且账号只能通过控制台或者OpenAPI进行创建、删除账号以及对账号授权等,用户不能通过SQL语句对账号进行相关操作。
- 仅支持 MySQL,Percona,MariaDB ''', description=''' - 开启SQL Server的数据库审计功能,目前支持实例级的数据库审计。用户可以根据需要开启、关闭审计、自定义审计策略,并下载审计文件。审计文件为原生的SQL Server审计文件,缺省保存6个月。
- 仅支持SQL Server。 + 创建数据库临时运维账号。
如果在使用数据库过程中需要京东云提供技术支持,并且需要对您的实例进行操作,您可以把临时运维账号提供给技术支持人员。
临时运维账号默认授予全局Select、Process权限,且账号只能通过控制台或者OpenAPI进行创建、删除账号以及对账号授权等,用户不能通过SQL语句对账号进行相关操作。
- 仅支持 MySQL,Percona,MariaDB。 - 示例: jdc rds create-audit --instance-id xxx --enabled xxx + 示例: jdc rds create-account-for-ops --instance-id xxx ''', ) - def create_audit(self): + def create_account_for_ops(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.CreateAuditRequest import CreateAuditRequest + from jdcloud_sdk.services.rds.apis.CreateAccountForOpsRequest import CreateAccountForOpsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateAuditRequest(params_dict, headers) + req = CreateAccountForOpsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -422,28 +541,31 @@ def create_audit(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--expired-time'], dict(help="""(string) 运维账号到期时间,UTC时间格式 """, dest='expiredTime', required=False)), + (['--global-privileges'], dict(help="""(array) NA """, dest='globalPrivileges', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 关闭数据库审计。关闭数据库审计后,以前生成的审计结果文件并不会被立即删除。审计结果文件会过期后由系统自动删除,过期时间缺省为6个月
- 仅支持SQL Server ''', + help=''' 修改数据库临时运维账号属性。
- 仅支持 MySQL,Percona,MariaDB ''', description=''' - 关闭数据库审计。关闭数据库审计后,以前生成的审计结果文件并不会被立即删除。审计结果文件会过期后由系统自动删除,过期时间缺省为6个月
- 仅支持SQL Server。 + 修改数据库临时运维账号属性。
- 仅支持 MySQL,Percona,MariaDB。 - 示例: jdc rds delete-audit --instance-id xxx + 示例: jdc rds modify-account-for-ops --instance-id xxx ''', ) - def delete_audit(self): + def modify_account_for_ops(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DeleteAuditRequest import DeleteAuditRequest + from jdcloud_sdk.services.rds.apis.ModifyAccountForOpsRequest import ModifyAccountForOpsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteAuditRequest(params_dict, headers) + req = ModifyAccountForOpsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -454,30 +576,33 @@ def delete_audit(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--name'], dict(help="""(string) 审计选项类别,**大小写敏感**,目前支持两种类型:
(1)AuditOptions开头:在disalbed参数中返回SQL Server各个版本支持的所有选项,支持的名称为
AuditOptions2008R2
AuditOptions2012
AuditOptions2014
AuditOptions2016
例如输入参数为"AuditOptions2016",则在disabled字段中返回SQL Server 2016 版本所支持的所有的审计选项
(2)AuditDefault开头:京东云建议的默认选项,在enabled参数中返回建议开启的选项,在disabled参数中返回不开启的选项,支持的名称为:
AuditDefault2008R2
AuditDefault2012
AuditDefault2014
AuditDefault2016
例如输入参数为"AuditDefault2016",则在enabled字段返回SQL Server 2016 版本中京东云建议开启的审计选项,在disabled字段中返回建议不开启的选项 """, dest='name', required=True)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:[10,100],且为10的整数倍 """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 过滤参数,多个过滤参数之间的关系为“与”(and); 支持以下属性的过滤:; instanceId, 支持operator选项:eq; instanceName, 支持operator选项:eq, like; engine, 支持operator选项:eq; engineVersion, 支持operator选项:eq; instanceStatus, 支持operator选项:eq; vpcId, 支持operator选项:eq; instanceType, 支持operator选项:eq; internalDomainName, 支持operator选项:eq; publicDomainName, 支持operator选项:eq; """, dest='filters', required=False)), + (['--tag-filters'], dict(help="""(array: tagFilter) 资源标签 """, dest='tagFilters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取当前系统所支持的各种数据库版本的审计选项及相应的推荐选项
- 仅支持SQL Server ''', + help=''' 获取当前账号下所有RDS实例及MySQL/PostgreSQL只读实例的概要信息,例如实例类型,版本,计费信息等 ''', description=''' - 获取当前系统所支持的各种数据库版本的审计选项及相应的推荐选项
- 仅支持SQL Server。 + 获取当前账号下所有RDS实例及MySQL/PostgreSQL只读实例的概要信息,例如实例类型,版本,计费信息等。 - 示例: jdc rds describe-audit-options --instance-id xxx --name xxx + 示例: jdc rds describe-instances ''', ) - def describe_audit_options(self): + def describe_instances(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeAuditOptionsRequest import DescribeAuditOptionsRequest + from jdcloud_sdk.services.rds.apis.DescribeInstancesRequest import DescribeInstancesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAuditOptionsRequest(params_dict, headers) + req = DescribeInstancesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -488,31 +613,30 @@ def describe_audit_options(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--add'], dict(help="""(string) 在原有审计项基础上,增加新的审计项,多个审计项之间用英文逗号,分号或空格分隔,例如DATABASE_OBJECT_ACCESS_GROUP,ACKUP_RESTORE_GROUP """, dest='add', required=False)), - (['--drop'], dict(help="""(string) 删除审计项,多个审计项之间用英文逗号,分号或空格分隔,例如DATABASE_OBJECT_ACCESS_GROUP,ACKUP_RESTORE_GROUP
如删除了所有审计项,则审计自动关闭 """, dest='drop', required=False)), + (['--instance-spec'], dict(help="""(dBInstanceSpec) 新建实例规格 """, dest='instanceSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改当前的审计选项。当前已有审计选项可以通过describeAudit获得,支持的全部选项可以通过getAuditOptions获得。
- 仅支持SQL Server ''', + help=''' 创建一个RDS实例,用户可以使用相应的数据库客户端或者应用程序通过域名和端口链接到该RDS实例上,进行操作。 ''', description=''' - 修改当前的审计选项。当前已有审计选项可以通过describeAudit获得,支持的全部选项可以通过getAuditOptions获得。
- 仅支持SQL Server。 + 创建一个RDS实例,用户可以使用相应的数据库客户端或者应用程序通过域名和端口链接到该RDS实例上,进行操作。。 - 示例: jdc rds modify-audit --instance-id xxx + 示例: jdc rds create-instance --instance-spec '{"":""}' ''', ) - def modify_audit(self): + def create_instance(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ModifyAuditRequest import ModifyAuditRequest + from jdcloud_sdk.services.rds.apis.CreateInstanceRequest import CreateInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyAuditRequest(params_dict, headers) + req = CreateInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -525,27 +649,28 @@ def modify_audit(self): (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取当前实例下的所有审计结果文件的列表
- 仅支持SQL Server ''', + help=''' 查询RDS实例(MySQL、SQL Server等)的详细信息以及MySQL/PostgreSQL只读实例详细信息 ''', description=''' - 获取当前实例下的所有审计结果文件的列表
- 仅支持SQL Server。 + 查询RDS实例(MySQL、SQL Server等)的详细信息以及MySQL/PostgreSQL只读实例详细信息。 - 示例: jdc rds describe-audit-files --instance-id xxx + 示例: jdc rds describe-instance-attributes --instance-id xxx ''', ) - def describe_audit_files(self): + def describe_instance_attributes(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeAuditFilesRequest import DescribeAuditFilesRequest + from jdcloud_sdk.services.rds.apis.DescribeInstanceAttributesRequest import DescribeInstanceAttributesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAuditFilesRequest(params_dict, headers) + req = DescribeInstanceAttributesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -557,29 +682,29 @@ def describe_audit_files(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--file-name'], dict(help="""(string) 审计文件名 """, dest='fileName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取某个审计文件的下载链接,同时支持内链和外链,链接的有效时间为24小时
- 仅支持SQL Server ''', + help=''' 删除一个RDS实例或者MySQL/PostgreSQL的只读实例。删除MySQL/PostgreSQL主实例时,会同时将对应的MySQL/PostgreSQL只读实例也删除 [MFA enabled] ''', description=''' - 获取某个审计文件的下载链接,同时支持内链和外链,链接的有效时间为24小时
- 仅支持SQL Server。 + 删除一个RDS实例或者MySQL/PostgreSQL的只读实例。删除MySQL/PostgreSQL主实例时,会同时将对应的MySQL/PostgreSQL只读实例也删除 [MFA enabled]。 - 示例: jdc rds describe-audit-download-url --instance-id xxx --file-name xxx + 示例: jdc rds delete-instance --instance-id xxx ''', ) - def describe_audit_download_url(self): + def delete_instance(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeAuditDownloadURLRequest import DescribeAuditDownloadURLRequest + from jdcloud_sdk.services.rds.apis.DeleteInstanceRequest import DeleteInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAuditDownloadURLRequest(params_dict, headers) + req = DeleteInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -592,27 +717,28 @@ def describe_audit_download_url(self): (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 仅支持MySQL实例开启数据库审计
- 仅支持 MySQL 5.6, MySQL 5.7, Percona, MariaDB, PostgreSQL ''', + help=''' 查看RDS实例备份策略。根据数据库类型的不同,支持的备份策略也略有差异,具体请看返回参数中的详细说明 ''', description=''' - 仅支持MySQL实例开启数据库审计
- 仅支持 MySQL 5.6, MySQL 5.7, Percona, MariaDB, PostgreSQL。 + 查看RDS实例备份策略。根据数据库类型的不同,支持的备份策略也略有差异,具体请看返回参数中的详细说明。 - 示例: jdc rds enable-audit --instance-id xxx + 示例: jdc rds describe-backup-policy --instance-id xxx ''', ) - def enable_audit(self): + def describe_backup_policy(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.EnableAuditRequest import EnableAuditRequest + from jdcloud_sdk.services.rds.apis.DescribeBackupPolicyRequest import DescribeBackupPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableAuditRequest(params_dict, headers) + req = DescribeBackupPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -624,28 +750,35 @@ def enable_audit(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--start-window'], dict(help="""(string) 自动备份开始时间窗口,例如:00:00-01:00,表示0点到1点开始进行数据库自动备份,备份完成时间则跟实例大小有关,不一定在这个时间范围中
SQL Server:范围00:00-23:59,时间范围差不得小于30分钟。
MySQL,只能是以下取值:
00:00-01:00
01:00-02:00
......
23:00-24:00 """, dest='startWindow', required=False)), + (['--binlog-retention-period'], dict(help="""(int) binlog本地保留周期,单位小时,范围1-168 """, dest='binlogRetentionPeriod', type=int, required=False)), + (['--binlog-usage-limit'], dict(help="""(int) binlog本地占用空间上限,单位%,范围1-50 """, dest='binlogUsageLimit', type=int, required=False)), + (['--binlog-space-protection'], dict(help="""(string) 设置空间保护,开启:on,关闭:off
- 仅支持MySQL """, dest='binlogSpaceProtection', required=False)), + (['--retention-period'], dict(help="""(int) 自动备份保留周期,单位天,范围7-730
当enhancedBackup为true时可修改
- 仅支持SQL Server """, dest='retentionPeriod', type=int, required=False)), + (['--cycle-mode'], dict(help="""(int) 自动备份循环模式
1:表示每天都是全量备份
2:表示自动备份按照全量、增量、增量这样的方式进行,例如第1天是全量备份,第2、3天是增量备份;第4天又是全量备份,以此类推
当enhancedBackup为true时可修改
- 仅支持SQL Server """, dest='cycleMode', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 仅支持MySQL实例关闭数据库审计
- 仅支持 MySQL 5.6, MySQL 5.7, Percona, MariaDB, PostgreSQL ''', + help=''' 修改RDS实例备份策略,目前仅支持用户修改“自动备份开始时间窗口”这个参数,其他参数暂不开放修改 ''', description=''' - 仅支持MySQL实例关闭数据库审计
- 仅支持 MySQL 5.6, MySQL 5.7, Percona, MariaDB, PostgreSQL。 + 修改RDS实例备份策略,目前仅支持用户修改“自动备份开始时间窗口”这个参数,其他参数暂不开放修改。 - 示例: jdc rds disable-audit --instance-id xxx + 示例: jdc rds modify-backup-policy --instance-id xxx ''', ) - def disable_audit(self): + def modify_backup_policy(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DisableAuditRequest import DisableAuditRequest + from jdcloud_sdk.services.rds.apis.ModifyBackupPolicyRequest import ModifyBackupPolicyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisableAuditRequest(params_dict, headers) + req = ModifyBackupPolicyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -657,35 +790,29 @@ def disable_audit(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--start-time'], dict(help="""(string) 查询开始时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间不能早于当前时间30天 """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 查询截止时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到结束时间不能超过3天 """, dest='endTime', required=True)), - (['--db-name'], dict(help="""(string) 数据库名 """, dest='dbName', required=False)), - (['--account-name'], dict(help="""(string) 账号名 """, dest='accountName', required=False)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、50 """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 过滤参数,多个过滤参数之间的关系为“与”(and); 支持以下属性的过滤:; operation; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 仅支持查看MySQL实例的审计内容
- 仅支持 MySQL 5.6, MySQL 5.7, Percona, MariaDB, PostgreSQL ''', + help=''' 开启增强备份模式,开启后,备份保留天数可大于7天。 免费备份额度外的备份将按照备份占用的空间收费。开启后,不支持关闭。
- 仅支持SQL Server ''', description=''' - 仅支持查看MySQL实例的审计内容
- 仅支持 MySQL 5.6, MySQL 5.7, Percona, MariaDB, PostgreSQL。 + 开启增强备份模式,开启后,备份保留天数可大于7天。 免费备份额度外的备份将按照备份占用的空间收费。开启后,不支持关闭。
- 仅支持SQL Server。 - 示例: jdc rds describe-audit-result --instance-id xxx --start-time xxx --end-time xxx + 示例: jdc rds enable-enhanced-backup --instance-id xxx ''', ) - def describe_audit_result(self): + def enable_enhanced_backup(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeAuditResultRequest import DescribeAuditResultRequest + from jdcloud_sdk.services.rds.apis.EnableEnhancedBackupRequest import EnableEnhancedBackupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAuditResultRequest(params_dict, headers) + req = EnableEnhancedBackupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -696,29 +823,30 @@ def describe_audit_result(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--engine'], dict(help="""(string) RDS引擎类型,参见[枚举参数定义](../Enum-Definitions/Enum-Definitions.md) """, dest='engine', required=True)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看指定地域下各种RDS数据库支持的可用区,不同类型的RDS支持的可用区不一样 ''', + help=''' 当实例开启增强备份模式后,查询实例备份的空间使用情况
- 仅支持SQL Server ''', description=''' - 查看指定地域下各种RDS数据库支持的可用区,不同类型的RDS支持的可用区不一样。 + 当实例开启增强备份模式后,查询实例备份的空间使用情况
- 仅支持SQL Server。 - 示例: jdc rds describe-azs --engine xxx + 示例: jdc rds describe-backup-space --instance-id xxx ''', ) - def describe_azs(self): + def describe_backup_space(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeAzsRequest import DescribeAzsRequest + from jdcloud_sdk.services.rds.apis.DescribeBackupSpaceRequest import DescribeBackupSpaceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeAzsRequest(params_dict, headers) + req = DescribeBackupSpaceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -729,36 +857,30 @@ def describe_azs(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS实例ID,唯一标识一个实例 """, dest='instanceId', required=True)), - (['--auto'], dict(help="""(int) 查询备份类型,0为手动备份,1为自动备份,不传表示全部.
**- 测试参数,仅支持SQL Server,后续可能被其他参数取代** """, dest='auto', type=int, required=False)), - (['--backup-type-filter'], dict(help="""(string) 返回backupType等于指定值的备份列表。full为全量备份,diff为增量备份
**- 测试参数,仅支持SQL Server,后续可能被其他参数取代** """, dest='backupTypeFilter', required=False)), - (['--db-name-filter'], dict(help="""(string) 返回dbName等于指定值的备份列表,不传或为空返回全部
**- 测试参数,仅支持SQL Server,后续可能被其他参数取代** """, dest='dbNameFilter', required=False)), - (['--backup-time-range-start-filter'], dict(help="""(string) 返回备份开始时间大于该时间的备份列表
**- 测试参数,仅支持SQL Server,后续可能被其他参数取代** """, dest='backupTimeRangeStartFilter', required=False)), - (['--backup-time-range-end-filter'], dict(help="""(string) 返回备份开始时间小于等于该时间的备份列表
**- 测试参数,仅支持SQL Server,后续可能被其他参数取代** """, dest='backupTimeRangeEndFilter', required=False)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=True)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、30、50、100 """, dest='pageSize', type=int, required=True)), + (['--engine'], dict(help="""(string) 实例引擎类型 """, dest='engine', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看该RDS实例下所有备份的详细信息,返回的备份列表按照备份开始时间(backupStartTime)降序排列。 ''', + help=''' 查询该用户pin关联的备份的计费信息。仅当该用户开启了增强备份后有效。如用户未开启增强备份,返回null
- 仅支持SQL Server ''', description=''' - 查看该RDS实例下所有备份的详细信息,返回的备份列表按照备份开始时间(backupStartTime)降序排列。。 + 查询该用户pin关联的备份的计费信息。仅当该用户开启了增强备份后有效。如用户未开启增强备份,返回null
- 仅支持SQL Server。 - 示例: jdc rds describe-backups --instance-id xxx --page-number 0 --page-size 0 + 示例: jdc rds describe-backup-charge --engine xxx ''', ) - def describe_backups(self): + def describe_backup_charge(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeBackupsRequest import DescribeBackupsRequest + from jdcloud_sdk.services.rds.apis.DescribeBackupChargeRequest import DescribeBackupChargeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBackupsRequest(params_dict, headers) + req = DescribeBackupChargeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -769,30 +891,31 @@ def describe_backups(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS实例ID,唯一标识一个实例 """, dest='instanceId', required=False)), - (['--backup-spec'], dict(help="""(backupSpec) 备份规格 """, dest='backupSpec', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--instance-name'], dict(help="""(string) 实例名称,名称支持中文,实例名的具体规则可参见帮助中心文档:[名称及密码限制](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='instanceName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个RDS实例全量备份,可以对整个实例或者部分数据库(仅SQL Server支持)进行全量备份。同一时间点,只能有一个正在运行的备份任务 ''', + help=''' 修改实例名称,可支持中文,实例名的具体规则可参见帮助中心文档:[名称及密码限制](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) ''', description=''' - 创建一个RDS实例全量备份,可以对整个实例或者部分数据库(仅SQL Server支持)进行全量备份。同一时间点,只能有一个正在运行的备份任务。 + 修改实例名称,可支持中文,实例名的具体规则可参见帮助中心文档:[名称及密码限制](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md)。 - 示例: jdc rds create-backup + 示例: jdc rds modify-instance-name --instance-id xxx --instance-name xxx ''', ) - def create_backup(self): + def modify_instance_name(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.CreateBackupRequest import CreateBackupRequest + from jdcloud_sdk.services.rds.apis.ModifyInstanceNameRequest import ModifyInstanceNameRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateBackupRequest(params_dict, headers) + req = ModifyInstanceNameRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -803,29 +926,30 @@ def create_backup(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--backup-id'], dict(help="""(string) 备份ID """, dest='backupId', required=True)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除RDS实例备份,仅允许删除用户生成的备份,系统自动备份不允许删除。 ''', + help=''' 对RDS实例进行主备切换。
注意:如果实例正在进行备份,那么主备切换将会终止备份操作。可以查看备份策略中的备份开始时间确认是否有备份正在运行。如果确实需要在实例备份时进行主备切换,建议切换完成 后,手工进行一次实例的全备
对于SQL Server,主备切换后30分钟内,不支持按时间点恢复/创建,例如在10:05分用户进行了主备切换,那么10:05 ~ 10:35这个时间段不能进行按时间点恢复/创建。
- 仅支持SQL Server ''', description=''' - 删除RDS实例备份,仅允许删除用户生成的备份,系统自动备份不允许删除。。 + 对RDS实例进行主备切换。
注意:如果实例正在进行备份,那么主备切换将会终止备份操作。可以查看备份策略中的备份开始时间确认是否有备份正在运行。如果确实需要在实例备份时进行主备切换,建议切换完成 后,手工进行一次实例的全备
对于SQL Server,主备切换后30分钟内,不支持按时间点恢复/创建,例如在10:05分用户进行了主备切换,那么10:05 ~ 10:35这个时间段不能进行按时间点恢复/创建。
- 仅支持SQL Server。 - 示例: jdc rds delete-backup --backup-id xxx + 示例: jdc rds failover-instance --instance-id xxx ''', ) - def delete_backup(self): + def failover_instance(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DeleteBackupRequest import DeleteBackupRequest + from jdcloud_sdk.services.rds.apis.FailoverInstanceRequest import FailoverInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteBackupRequest(params_dict, headers) + req = FailoverInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -836,31 +960,33 @@ def delete_backup(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--backup-id'], dict(help="""(string) 备份ID """, dest='backupId', required=True)), - (['--file-name'], dict(help="""(string) 文件名称
- MySQL:不支持该参数
- SQL Server:必须输入该参数,指定该备份中需要获取下载链接的文件名称。备份中的文件名(不包括后缀)即为备份的数据库名。例如文件名为my_test_db.bak,表示该文件是my_test_db数据库的备份 """, dest='fileName', required=False)), - (['--url-expiration-second'], dict(help="""(string) 指定下载链接的过期时间,单位秒, 取值范围为 1 ~ 86400 秒;支持 SQL Server:缺省为 86400 秒。支持 MySQL, Percona, MariaDB:缺省为 300 秒。 """, dest='urlExpirationSecond', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--reboot-master'], dict(help="""(bool) 是否重启主节点。
- 仅SQL Server 支持该参数 """, dest='rebootMaster', type=bool, required=False)), + (['--reboot-slave'], dict(help="""(bool) 是否重启备节点。
- 仅SQL Server 支持该参数 """, dest='rebootSlave', type=bool, required=False)), + (['--force'], dict(help="""(bool) 是否强制重启
- 仅支持MySQL """, dest='force', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取整个备份或备份中单个文件的下载链接。
- 当输入参数中有文件名时,获取该文件的下载链接。
- 输入参数中无文件名时,获取整个备份的下载链接。
由于备份机制的差异,使用该接口下载备份时,SQL Server必须输入文件名,每个文件逐一下载,不支持下载整个备份。SQL Server备份中的文件名(不包括后缀)即为备份的数据库名。例如文件名为my_test_db.bak,表示该文件是my_test_db数据库的备份。
MySQL可下载整个备份集,但不支持单个文件的下载。 ''', + help=''' 重启RDS实例,例如修改了一些配置参数后,需要重启实例才能生效。可以结合主备切换的功能,轮流重启备机,降低对业务的影响
**注意:如果实例正在进行备份,那么重启主实例将会终止备份操作。** 可以查看备份策略中的备份开始时间确认是否有备份正在运行。如果确实需要在实例备份时重启主实例,建议重启后,手工进行一次实例的全备。 ''', description=''' - 获取整个备份或备份中单个文件的下载链接。
- 当输入参数中有文件名时,获取该文件的下载链接。
- 输入参数中无文件名时,获取整个备份的下载链接。
由于备份机制的差异,使用该接口下载备份时,SQL Server必须输入文件名,每个文件逐一下载,不支持下载整个备份。SQL Server备份中的文件名(不包括后缀)即为备份的数据库名。例如文件名为my_test_db.bak,表示该文件是my_test_db数据库的备份。
MySQL可下载整个备份集,但不支持单个文件的下载。。 + 重启RDS实例,例如修改了一些配置参数后,需要重启实例才能生效。可以结合主备切换的功能,轮流重启备机,降低对业务的影响
**注意:如果实例正在进行备份,那么重启主实例将会终止备份操作。** 可以查看备份策略中的备份开始时间确认是否有备份正在运行。如果确实需要在实例备份时重启主实例,建议重启后,手工进行一次实例的全备。。 - 示例: jdc rds describe-backup-download-url --backup-id xxx + 示例: jdc rds reboot-instance --instance-id xxx ''', ) - def describe_backup_download_url(self): + def reboot_instance(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeBackupDownloadURLRequest import DescribeBackupDownloadURLRequest + from jdcloud_sdk.services.rds.apis.RebootInstanceRequest import RebootInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBackupDownloadURLRequest(params_dict, headers) + req = RebootInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -871,30 +997,30 @@ def describe_backup_download_url(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[1,∞),页码超过总页数时,显示最后一页,用于查询列表的接口 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、30、50、100 """, dest='pageSize', type=int, required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询跨地域备份同步服务列表。 ''', + help=''' 开启RDS实例的外网访问功能。开启后,用户可以通过internet访问RDS实例 ''', description=''' - 查询跨地域备份同步服务列表。。 + 开启RDS实例的外网访问功能。开启后,用户可以通过internet访问RDS实例。 - 示例: jdc rds describe-backup-synchronicities + 示例: jdc rds enable-internet-access --instance-id xxx ''', ) - def describe_backup_synchronicities(self): + def enable_internet_access(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeBackupSynchronicitiesRequest import DescribeBackupSynchronicitiesRequest + from jdcloud_sdk.services.rds.apis.EnableInternetAccessRequest import EnableInternetAccessRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBackupSynchronicitiesRequest(params_dict, headers) + req = EnableInternetAccessRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -905,30 +1031,30 @@ def describe_backup_synchronicities(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 源实例ID """, dest='instanceId', required=True)), - (['--dest-region'], dict(help="""(string) 备份同步的目标地域 """, dest='destRegion', required=True)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个跨地域备份同步服务。 ''', + help=''' 关闭RDS实例的外网访问功能。关闭后,用户无法通过Internet访问RDS,但可以在京东云内网通过内网域名访问 ''', description=''' - 创建一个跨地域备份同步服务。。 + 关闭RDS实例的外网访问功能。关闭后,用户无法通过Internet访问RDS,但可以在京东云内网通过内网域名访问。 - 示例: jdc rds create-backup-synchronicity --instance-id xxx --dest-region xxx + 示例: jdc rds disable-internet-access --instance-id xxx ''', ) - def create_backup_synchronicity(self): + def disable_internet_access(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.CreateBackupSynchronicityRequest import CreateBackupSynchronicityRequest + from jdcloud_sdk.services.rds.apis.DisableInternetAccessRequest import DisableInternetAccessRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateBackupSynchronicityRequest(params_dict, headers) + req = DisableInternetAccessRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -939,29 +1065,31 @@ def create_backup_synchronicity(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--service-id'], dict(help="""(string) 跨地域备份同步服务ID """, dest='serviceId', required=True)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--backup-id'], dict(help="""(string) 用于恢复的备份Id,仅限于本实例生成的备份 """, dest='backupId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除一个跨地域备份同步服务。 ''', + help=''' 使用实例的全量备份覆盖恢复当前实例 ''', description=''' - 删除一个跨地域备份同步服务。。 + 使用实例的全量备份覆盖恢复当前实例。 - 示例: jdc rds delete-backup-synchronicity --service-id xxx + 示例: jdc rds restore-instance --instance-id xxx ''', ) - def delete_backup_synchronicity(self): + def restore_instance(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DeleteBackupSynchronicityRequest import DeleteBackupSynchronicityRequest + from jdcloud_sdk.services.rds.apis.RestoreInstanceRequest import RestoreInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteBackupSynchronicityRequest(params_dict, headers) + req = RestoreInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -972,31 +1100,32 @@ def delete_backup_synchronicity(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--restore-time'], dict(help="""(string) 根据源实例的哪个时间点创建新实例 """, dest='restoreTime', required=True)), - (['--service-id'], dict(help="""(string) 跨地域备份同步服务ID """, dest='serviceId', required=True)), + (['--backup-id'], dict(help="""(string) 备份ID """, dest='backupId', required=True)), + (['--engine'], dict(help="""(string) 标识是创建什么类型的实例,例如MySQL,SQL Server等,具体可参见文档[枚举参数定义](../Enum-Definitions/Enum-Definitions.md)
**注意:备份来源实例的engine和要创建的实例的engine必须一致** """, dest='engine', required=True)), (['--instance-spec'], dict(help="""(restoredNewDBInstanceSpec) 新建实例规格 """, dest='instanceSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据跨地域备份同步服务时间点创建实例。 ''', + help=''' 根据源实例全量备份创建一个新实例,新实例的数据跟源实例在创建备份时的数据状态一样。
例如根据源实例A的一个全量备份“mybak”新建一个实例B,该备份是在“‘2018-8-18 03:23:54”创建的。那么新建实例B的数据状态跟实例A‘2018-8-18 03:23:54’的状态一致 ''', description=''' - 根据跨地域备份同步服务时间点创建实例。。 + 根据源实例全量备份创建一个新实例,新实例的数据跟源实例在创建备份时的数据状态一样。
例如根据源实例A的一个全量备份“mybak”新建一个实例B,该备份是在“‘2018-8-18 03:23:54”创建的。那么新建实例B的数据状态跟实例A‘2018-8-18 03:23:54’的状态一致。 - 示例: jdc rds create-instance-by-time-in-cross-region --restore-time xxx --service-id xxx --instance-spec '{"":""}' + 示例: jdc rds create-instance-from-backup --backup-id xxx --engine xxx --instance-spec '{"":""}' ''', ) - def create_instance_by_time_in_cross_region(self): + def create_instance_from_backup(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.CreateInstanceByTimeInCrossRegionRequest import CreateInstanceByTimeInCrossRegionRequest + from jdcloud_sdk.services.rds.apis.CreateInstanceFromBackupRequest import CreateInstanceFromBackupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateInstanceByTimeInCrossRegionRequest(params_dict, headers) + req = CreateInstanceFromBackupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1008,32 +1137,36 @@ def create_instance_by_time_in_cross_region(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、30、50、100 """, dest='pageSize', type=int, required=False)), - (['--start-time'], dict(help="""(string) 查询开始时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到结束时间不超过三天 """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询结束时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到结束时间不超过三天 """, dest='endTime', required=False)), + (['--new-instance-class'], dict(help="""(string) 扩容后实例规格 """, dest='newInstanceClass', required=True)), + (['--new-instance-storage-gb'], dict(help="""(int) 扩容后实例磁盘大小 """, dest='newInstanceStorageGB', type=int, required=True)), + (['--new-instance-storage-type'], dict(help="""(string) 存储类型,如果不指定,默认会采用实例原存储类型. """, dest='newInstanceStorageType', required=False)), + (['--storage-encrypted'], dict(help="""(bool) 实例数据加密(存储类型为云硬盘才支持数据加密). false:不加密; true:加密. 如果实例从本地盘变为云硬盘,缺省为false. 如果实例本来就是使用云硬盘的,缺省和源实例保持一致 """, dest='storageEncrypted', type=bool, required=False)), + (['--subnet-id'], dict(help="""(string) 变配后的子网ID """, dest='subnetId', required=False)), + (['--effective-time'], dict(help="""(string) 生效时间,取值:
immediate:立即生效
maintainTime:在可维护时间段内生效。
postpone:延后生效。 """, dest='effectiveTime', required=False)), + (['--postpone-time'], dict(help="""(int) 延后生效的时间,单位为分钟。effectiveTime为postpone时必传,取值1-1440分钟 """, dest='postponeTime', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取MySQL实例中binlog的详细信息
- 仅支持 MySQL, Percona, MariaDB ''', + help=''' 实例扩容,支持升级实例的CPU,内存及磁盘。 ''', description=''' - 获取MySQL实例中binlog的详细信息
- 仅支持 MySQL, Percona, MariaDB。 + 实例扩容,支持升级实例的CPU,内存及磁盘。。 - 示例: jdc rds describe-binlogs --instance-id xxx + 示例: jdc rds modify-instance-spec --instance-id xxx --new-instance-class xxx --new-instance-storage-gb 5 ''', ) - def describe_binlogs(self): + def modify_instance_spec(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeBinlogsRequest import DescribeBinlogsRequest + from jdcloud_sdk.services.rds.apis.ModifyInstanceSpecRequest import ModifyInstanceSpecRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBinlogsRequest(params_dict, headers) + req = ModifyInstanceSpecRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1045,30 +1178,31 @@ def describe_binlogs(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--binlog-backup-id'], dict(help="""(string) binlog的备份ID,可以通过describeBinlogs获得 """, dest='binlogBackupId', required=True)), - (['--seconds'], dict(help="""(int) 设置链接地址的过期时间,单位是秒,默认值是 300 秒,最长不能超过取值范围为 1 ~ 86400 秒 """, dest='seconds', type=int, required=False)), + (['--restore-time'], dict(help="""(string) 根据源实例的哪个时间点创建新实例 """, dest='restoreTime', required=True)), + (['--instance-spec'], dict(help="""(restoredNewDBInstanceSpec) 新建实例规格 """, dest='instanceSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取MySQL实例的binlog的下载链接
- 仅支持 MySQL, Percona, MariaDB ''', + help=''' 根据源实例备份创建一个新实例,并通过追加日志的方式,将新实例的数据恢复到跟源实例指定时间点的数据状态一样。
例如根据实例A在“2018-06-18 23:00:00”时间点创建一个实例B,就是新建一个实例B,该实例B的数据跟实例A在“2018-06-18 23:00:00”这个时间点的数据完全一致。
对于SQL Server,主备切换后30分钟内,不支持按时间点恢复/创建,例如在10:05分用户进行了主备切换,那么10:05 ~ 10:35这个时间段不能进行按时间点恢复/创建。 ''', description=''' - 获取MySQL实例的binlog的下载链接
- 仅支持 MySQL, Percona, MariaDB。 + 根据源实例备份创建一个新实例,并通过追加日志的方式,将新实例的数据恢复到跟源实例指定时间点的数据状态一样。
例如根据实例A在“2018-06-18 23:00:00”时间点创建一个实例B,就是新建一个实例B,该实例B的数据跟实例A在“2018-06-18 23:00:00”这个时间点的数据完全一致。
对于SQL Server,主备切换后30分钟内,不支持按时间点恢复/创建,例如在10:05分用户进行了主备切换,那么10:05 ~ 10:35这个时间段不能进行按时间点恢复/创建。。 - 示例: jdc rds describe-binlog-download-url --instance-id xxx --binlog-backup-id xxx + 示例: jdc rds create-instance-by-time --instance-id xxx --restore-time xxx --instance-spec '{"":""}' ''', ) - def describe_binlog_download_url(self): + def create_instance_by_time(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeBinlogDownloadURLRequest import DescribeBinlogDownloadURLRequest + from jdcloud_sdk.services.rds.apis.CreateInstanceByTimeRequest import CreateInstanceByTimeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBinlogDownloadURLRequest(params_dict, headers) + req = CreateInstanceByTimeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1080,28 +1214,41 @@ def describe_binlog_download_url(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--instance-name'], dict(help="""(string) 实例名称,具体规则可参见帮助中心文档:[名称及密码限制](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='instanceName', required=True)), + (['--instance-class'], dict(help="""(string) 只读实例规格FlavorId """, dest='instanceClass', required=True)), + (['--instance-storage-type'], dict(help="""(string) 存储类型,参见[枚举参数定义](../Enum-Definitions/Enum-Definitions.md),缺省值为:LOCAL_SSD """, dest='instanceStorageType', required=False)), + (['--instance-storage-gb'], dict(help="""(int) 磁盘空间 """, dest='instanceStorageGB', type=int, required=True)), + (['--az-id'], dict(help="""(string) 可用区ID """, dest='azId', required=True)), + (['--vpc-id'], dict(help="""(string) VPC的ID,如果没有填写就保持和常规实例一样的VPC """, dest='vpcId', required=False)), + (['--subnet-id'], dict(help="""(string) 子网ID,如果没有填写就保持和常规实例一样的subnet """, dest='subnetId', required=False)), + (['--parameter-group'], dict(help="""(string) 参数组ID,缺省采用和常规实例一样的参数组 """, dest='parameterGroup', required=False)), + (['--storage-encrypted'], dict(help="""(bool) 实例数据加密(存储类型为云硬盘才支持数据加密)。false:不加密;true:加密。缺省为false。 """, dest='storageEncrypted', type=bool, required=False)), + (['--count'], dict(help="""(int) 创建只读实例的数目,缺省为1 """, dest='count', type=int, required=False)), + (['--ro-instance-proxy'], dict(help="""(string) 只读代理服务的ID,缺省值为 “NULL”,表示不绑定代理服务 """, dest='roInstanceProxy', required=False)), + (['--tag-spec'], dict(help="""(array: tag) 标签信息 """, dest='tagSpec', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 清理本地的binlog并释放空间。 系统只会清理已经备份到存储的binlog,不会影响MySQL实例的备份恢复
- 仅支持MySQL ''', + help=''' 创建MySQL的只读实例
- 仅支持MySQL
- 创建的只读实例跟主实例在同一个VPC同一个子网中
* 只读实例只支持按配置计费 ''', description=''' - 清理本地的binlog并释放空间。 系统只会清理已经备份到存储的binlog,不会影响MySQL实例的备份恢复
- 仅支持MySQL。 + 创建MySQL的只读实例
- 仅支持MySQL
- 创建的只读实例跟主实例在同一个VPC同一个子网中
* 只读实例只支持按配置计费。 - 示例: jdc rds clear-binlogs --instance-id xxx + 示例: jdc rds create-roinstance --instance-id xxx --instance-name xxx --instance-class xxx --instance-storage-gb 5 --az-id xxx ''', ) - def clear_binlogs(self): + def create_roinstance(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ClearBinlogsRequest import ClearBinlogsRequest + from jdcloud_sdk.services.rds.apis.CreateROInstanceRequest import CreateROInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ClearBinlogsRequest(params_dict, headers) + req = CreateROInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1113,31 +1260,30 @@ def clear_binlogs(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--database'], dict(help="""(string) DDL命令修改的库名 """, dest='database', required=True)), - (['--table'], dict(help="""(string) DDL命令修改的表名 """, dest='table', required=True)), - (['--command'], dict(help="""(string) 需要执行的的DDL命令 """, dest='command', required=True)), + (['--connection-mode'], dict(help="""(string) 连接模式
- standard:标准模式(缺省),响应时间短,但没有 SQL 审计和拦截的能力
- security:高安全模式,具备一定的 SQL注入拦截能力,并可开启 SQL 审计,但会增加一定的响应时间 """, dest='connectionMode', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 通过 PT-OSC 服务来处理 DDL 命令, 避免锁表。此接口暂是对部分用户开放 ''', + help=''' 修改MySQL实例的连接模式:标准模式(standard) 和高安全模式(security).
- **标准模式**:响应时间短,但没有 SQL 审计和拦截的能力。
- **高安全模式**:具备一定的 SQL注入拦截能力(通过分析表达式、关键系统函数等来实现防御 SQL 注入攻击),并可开启 SQL 审计,但会增加一定的响应时间。
- 仅支持MySQL ''', description=''' - 通过 PT-OSC 服务来处理 DDL 命令, 避免锁表。此接口暂是对部分用户开放。 + 修改MySQL实例的连接模式:标准模式(standard) 和高安全模式(security).
- **标准模式**:响应时间短,但没有 SQL 审计和拦截的能力。
- **高安全模式**:具备一定的 SQL注入拦截能力(通过分析表达式、关键系统函数等来实现防御 SQL 注入攻击),并可开启 SQL 审计,但会增加一定的响应时间。
- 仅支持MySQL。 - 示例: jdc rds alter-table-with-online-ddl --instance-id xxx --database xxx --table xxx --command xxx + 示例: jdc rds modify-connection-mode --instance-id xxx --connection-mode xxx ''', ) - def alter_table_with_online_ddl(self): + def modify_connection_mode(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.AlterTableWithOnlineDDLRequest import AlterTableWithOnlineDDLRequest + from jdcloud_sdk.services.rds.apis.ModifyConnectionModeRequest import ModifyConnectionModeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AlterTableWithOnlineDDLRequest(params_dict, headers) + req = ModifyConnectionModeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1148,29 +1294,30 @@ def alter_table_with_online_ddl(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--engine'], dict(help="""(string) 设置可见的引擎类型,如 MySQL 等 """, dest='engine', required=True)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看云数据库 RDS 的权限信息 - 仅支持 MySQL,Percona,MariaDB ''', + help=''' 获取SQL Server实例按时间点恢复/创建时,可恢复到的最后的一个时间点
- 仅支持SQL Server ''', description=''' - 查看云数据库 RDS 的权限信息 - 仅支持 MySQL,Percona,MariaDB。 + 获取SQL Server实例按时间点恢复/创建时,可恢复到的最后的一个时间点
- 仅支持SQL Server。 - 示例: jdc rds describe-privilege --engine xxx + 示例: jdc rds describe-latest-restore-time --instance-id xxx ''', ) - def describe_privilege(self): + def describe_latest_restore_time(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribePrivilegeRequest import DescribePrivilegeRequest + from jdcloud_sdk.services.rds.apis.DescribeLatestRestoreTimeRequest import DescribeLatestRestoreTimeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribePrivilegeRequest(params_dict, headers) + req = DescribeLatestRestoreTimeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1182,31 +1329,30 @@ def describe_privilege(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--db-name'], dict(help="""(string) 数据库名。如果不指定数据库名,则返回所有数据库列表
- **MySQL:不支持该字段**
- **SQL Server:支持该字段** """, dest='dbName', required=False)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为100,取值范围:[10,100],用于查询列表的接口 """, dest='pageSize', type=int, required=False)), + (['--parameter-group-id'], dict(help="""(string) 参数组ID """, dest='parameterGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取当前实例的所有数据库详细信息的列表 ''', + help=''' 修改RDS实例的参数组
- 仅支持MySQL ''', description=''' - 获取当前实例的所有数据库详细信息的列表。 + 修改RDS实例的参数组
- 仅支持MySQL。 - 示例: jdc rds describe-databases --instance-id xxx + 示例: jdc rds modify-parameter-group --instance-id xxx --parameter-group-id xxx ''', ) - def describe_databases(self): + def modify_parameter_group(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeDatabasesRequest import DescribeDatabasesRequest + from jdcloud_sdk.services.rds.apis.ModifyParameterGroupRequest import ModifyParameterGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeDatabasesRequest(params_dict, headers) + req = ModifyParameterGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1218,30 +1364,30 @@ def describe_databases(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--db-name'], dict(help="""(string) 数据库名,数据库名称的限制请参考[帮助中心文档](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='dbName', required=True)), - (['--character-set-name'], dict(help="""(string) 数据库的字符集名,当前支持的字符集请查看[枚举参数定义](../Enum-Definitions/Enum-Definitions.md) """, dest='characterSetName', required=True)), + (['--target-instance-id'], dict(help="""(string) 要交换的实例ID """, dest='targetInstanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个数据库。 为了实例的管理和数据恢复,RDS对用户权限进行了限制,用户仅能通过控制台或本接口创建数据库 ''', + help=''' 交换两个实例的域名,包括内网域名和外网域名。如果一个实例有外网域名,一个没有,则不允许交换。
- 仅支持SQL Server ''', description=''' - 创建一个数据库。 为了实例的管理和数据恢复,RDS对用户权限进行了限制,用户仅能通过控制台或本接口创建数据库。 + 交换两个实例的域名,包括内网域名和外网域名。如果一个实例有外网域名,一个没有,则不允许交换。
- 仅支持SQL Server。 - 示例: jdc rds create-database --instance-id xxx --db-name xxx --character-set-name xxx + 示例: jdc rds exchange-instance-dns --instance-id xxx --target-instance-id xxx ''', ) - def create_database(self): + def exchange_instance_dns(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.CreateDatabaseRequest import CreateDatabaseRequest + from jdcloud_sdk.services.rds.apis.ExchangeInstanceDnsRequest import ExchangeInstanceDnsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateDatabaseRequest(params_dict, headers) + req = ExchangeInstanceDnsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1253,29 +1399,30 @@ def create_database(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--db-name'], dict(help="""(string) 库名称 """, dest='dbName', required=True)), + (['--new-az-id'], dict(help="""(array) 新可用区ID。 如果是单机实例,只需输入一个可用区;如果是主备实例,则必须输入两个可用区ID:第一个为主节点所在可用区,第二个为备节点所在可用区。主备两个可用区可以相同,也可以不同 """, dest='newAzId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 从RDS实例中删除数据库。为便于管理和数据恢复,RDS对用户权限进行了控制,用户仅能通过控制台或本接口删除数据库 [MFA enabled] ''', + help=''' 修改实例的可用区,例如将实例的可用区从单可用区调整为多可用区 ''', description=''' - 从RDS实例中删除数据库。为便于管理和数据恢复,RDS对用户权限进行了控制,用户仅能通过控制台或本接口删除数据库 [MFA enabled]。 + 修改实例的可用区,例如将实例的可用区从单可用区调整为多可用区。 - 示例: jdc rds delete-database --instance-id xxx --db-name xxx + 示例: jdc rds modify-instance-az --instance-id xxx --new-az-id '{"":""}' ''', ) - def delete_database(self): + def modify_instance_az(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DeleteDatabaseRequest import DeleteDatabaseRequest + from jdcloud_sdk.services.rds.apis.ModifyInstanceAzRequest import ModifyInstanceAzRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteDatabaseRequest(params_dict, headers) + req = ModifyInstanceAzRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1287,31 +1434,29 @@ def delete_database(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--db-name'], dict(help="""(string) 库名称 """, dest='dbName', required=True)), - (['--backup-id'], dict(help="""(string) 备份ID,可从备份查询接口describeBackups获取 """, dest='backupId', required=True)), - (['--backup-file-name'], dict(help="""(string) 指定该备份中用于恢复数据库的文件名称。通常情况下文件名(不包括后缀)即为备份的数据库名。例如文件名为my_test_db.bak,表示该文件是my_test_db数据库的备份 """, dest='backupFileName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 从备份中恢复单个数据库,支持从其他实例(但必须是同一个账号下的实例)备份中恢复。例如可以从生产环境的数据库实例的备份恢复到测试环境的数据库中。
- 仅支持SQL Server ''', + help=''' 查看当前实例已开启加密连接。 ''', description=''' - 从备份中恢复单个数据库,支持从其他实例(但必须是同一个账号下的实例)备份中恢复。例如可以从生产环境的数据库实例的备份恢复到测试环境的数据库中。
- 仅支持SQL Server。 + 查看当前实例已开启加密连接。。 - 示例: jdc rds restore-database-from-backup --instance-id xxx --db-name xxx --backup-id xxx --backup-file-name xxx + 示例: jdc rds describe-ssl --instance-id xxx ''', ) - def restore_database_from_backup(self): + def describe_ssl(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.RestoreDatabaseFromBackupRequest import RestoreDatabaseFromBackupRequest + from jdcloud_sdk.services.rds.apis.DescribeSSLRequest import DescribeSSLRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RestoreDatabaseFromBackupRequest(params_dict, headers) + req = DescribeSSLRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1323,31 +1468,29 @@ def restore_database_from_backup(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--db-name'], dict(help="""(string) 库名称 """, dest='dbName', required=True)), - (['--shared-file-gid'], dict(help="""(string) 共享文件的全局ID,可从上传文件查询接口[describeImportFiles](../Cloud-on-Single-Database/describeImportFiles.md)获取;如果该文件不是共享文件,则不用输入该参数 """, dest='sharedFileGid', required=False)), - (['--file-name'], dict(help="""(string) 用户上传的备份文件名称(包括文件后缀名),例如mydb1.bak """, dest='fileName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 从用户通过单库上云工具上传到云上的备份文件中恢复单个数据库
- 仅支持SQL Server ''', + help=''' 开启数据库的加密连接, 同时会重启数据库实例 ''', description=''' - 从用户通过单库上云工具上传到云上的备份文件中恢复单个数据库
- 仅支持SQL Server。 + 开启数据库的加密连接, 同时会重启数据库实例。 - 示例: jdc rds restore-database-from-file --instance-id xxx --db-name xxx --file-name xxx + 示例: jdc rds enable-ssl --instance-id xxx ''', ) - def restore_database_from_file(self): + def enable_ssl(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.RestoreDatabaseFromFileRequest import RestoreDatabaseFromFileRequest + from jdcloud_sdk.services.rds.apis.EnableSSLRequest import EnableSSLRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RestoreDatabaseFromFileRequest(params_dict, headers) + req = EnableSSLRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1359,30 +1502,29 @@ def restore_database_from_file(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--db-name'], dict(help="""(string) 库名称 """, dest='dbName', required=True)), - (['--oss-url'], dict(help="""(string) 用户上传到对象存储OSS上的备份文件的路径。
例如用户备份上传的bucket为db_backup,文件为test_server/db1.bak,那么ossULR为db_backup/test_server/db1.bak。
**授权说明**:需要授予账户ID:785455908940,对这个bucket的读取权限,具体步骤可以查看[文档](https://docs.jdcloud.com/cn/object-storage-service/set-bucket-policy-2)。 """, dest='ossURL', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 从上传到OSS的备份文件中恢复单个数据库
- 仅支持SQL Server ''', + help=''' 关闭数据库的加密连接, 需要重启数据库实例才生效
- 仅支持SQL Server ''', description=''' - 从上传到OSS的备份文件中恢复单个数据库
- 仅支持SQL Server。 + 关闭数据库的加密连接, 需要重启数据库实例才生效
- 仅支持SQL Server。 - 示例: jdc rds restore-database-from-oss --instance-id xxx --db-name xxx --oss-url xxx + 示例: jdc rds disable-ssl --instance-id xxx ''', ) - def restore_database_from_oss(self): + def disable_ssl(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.RestoreDatabaseFromOSSRequest import RestoreDatabaseFromOSSRequest + from jdcloud_sdk.services.rds.apis.DisableSSLRequest import DisableSSLRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RestoreDatabaseFromOSSRequest(params_dict, headers) + req = DisableSSLRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1394,28 +1536,31 @@ def restore_database_from_oss(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--restore-time'], dict(help="""(string) 根据源实例的哪个时间点创建新实例 """, dest='restoreTime', required=True)), + (['--restore-schema'], dict(help="""(array: array) 需要进行单库,单表恢复的概要信息 """, dest='restoreSchema', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取SQL Server 错误日志及下载信息
- 仅支持SQL Server ''', + help=''' 根据时间点,选择单表恢复当前实例
- 仅支持MySQL ''', description=''' - 获取SQL Server 错误日志及下载信息
- 仅支持SQL Server。 + 根据时间点,选择单表恢复当前实例
- 仅支持MySQL。 - 示例: jdc rds describe-error-logs --instance-id xxx + 示例: jdc rds restore-instance-by-time --instance-id xxx --restore-time xxx --restore-schema ['{"":""}'] ''', ) - def describe_error_logs(self): + def restore_instance_by_time(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeErrorLogsRequest import DescribeErrorLogsRequest + from jdcloud_sdk.services.rds.apis.RestoreInstanceByTimeRequest import RestoreInstanceByTimeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeErrorLogsRequest(params_dict, headers) + req = RestoreInstanceByTimeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1427,28 +1572,31 @@ def describe_error_logs(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--ad-resource-id'], dict(help="""(string) 目录服务的资源ID
- 加入目录服务:要加入的目录服务的资源ID
- 修改目录服务:新目录服务的资源ID
- 移除目录服务:传入字符串“none”,不区分大小写 """, dest='adResourceId', required=True)), + (['--force-restart'], dict(help="""(string) 修改后,是否强制重启实例,使修改生效。
- true 修改后立即重启
- false:默认值,修改后不重启,需用户自行重启 """, dest='forceRestart', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取用户通过单库上云工具上传到该实例上的文件列表
- 仅支持SQL Server ''', + help=''' 修改SQL Server对接的Active Directory 服务。支持SQL Server 2012 及2012以上以上的版本。
注意:修改目录服务后,需重启SQL Server实例才能生效 ''', description=''' - 获取用户通过单库上云工具上传到该实例上的文件列表
- 仅支持SQL Server。 + 修改SQL Server对接的Active Directory 服务。支持SQL Server 2012 及2012以上以上的版本。
注意:修改目录服务后,需重启SQL Server实例才能生效。 - 示例: jdc rds describe-import-files --instance-id xxx + 示例: jdc rds modify-active-directory --instance-id xxx --ad-resource-id xxx --force-restart xxx ''', ) - def describe_import_files(self): + def modify_active_directory(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeImportFilesRequest import DescribeImportFilesRequest + from jdcloud_sdk.services.rds.apis.ModifyActiveDirectoryRequest import ModifyActiveDirectoryRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeImportFilesRequest(params_dict, headers) + req = ModifyActiveDirectoryRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1460,28 +1608,31 @@ def describe_import_files(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--maintain-time'], dict(help="""(string) 实例的可维护时间段。格式:HH:mm-HH:mm,取值为一个小时整点 """, dest='maintainTime', required=False)), + (['--maintain-period'], dict(help="""(array) 选择维护周期,可选择一周中的某一天或多天 """, dest='maintainPeriod', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取单库上云工具上传文件的需要的Key。单库上云工具需要正确的key值方能连接到京东云
- 仅支持SQL Server ''', + help=''' 修改实例的可维护时间。实例可维护时间段一般设置为业务的低峰时间段。京东云会在您设置的可维护时间段内进行实例维护,保证对业务的影响降到最低。 ''', description=''' - 获取单库上云工具上传文件的需要的Key。单库上云工具需要正确的key值方能连接到京东云
- 仅支持SQL Server。 + 修改实例的可维护时间。实例可维护时间段一般设置为业务的低峰时间段。京东云会在您设置的可维护时间段内进行实例维护,保证对业务的影响降到最低。。 - 示例: jdc rds get-upload-key --instance-id xxx + 示例: jdc rds modify-instance-maintain-time --instance-id xxx ''', ) - def get_upload_key(self): + def modify_instance_maintain_time(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.GetUploadKeyRequest import GetUploadKeyRequest + from jdcloud_sdk.services.rds.apis.ModifyInstanceMaintainTimeRequest import ModifyInstanceMaintainTimeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetUploadKeyRequest(params_dict, headers) + req = ModifyInstanceMaintainTimeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1493,30 +1644,29 @@ def get_upload_key(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--file-name'], dict(help="""(string) 单库上云文件名 """, dest='fileName', required=True)), - (['--shared'], dict(help="""(string) 文件是否共享
true:共享
false:不共享 """, dest='shared', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置或取消上传文件是否共享给同一账号下的其他实例。缺省情况下,文件仅在上传的实例上可见并可导入,其他实例不可见不可导入。如果需要该文件在其他实例上也可导入,可将此文件设置为共享
- 仅支持SQL Server ''', + help=''' 查询实例的可维护时间 ''', description=''' - 设置或取消上传文件是否共享给同一账号下的其他实例。缺省情况下,文件仅在上传的实例上可见并可导入,其他实例不可见不可导入。如果需要该文件在其他实例上也可导入,可将此文件设置为共享
- 仅支持SQL Server。 + 查询实例的可维护时间。 - 示例: jdc rds set-import-file-shared --instance-id xxx --file-name xxx --shared xxx + 示例: jdc rds describe-instance-maintain-time --instance-id xxx ''', ) - def set_import_file_shared(self): + def describe_instance_maintain_time(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.SetImportFileSharedRequest import SetImportFileSharedRequest + from jdcloud_sdk.services.rds.apis.DescribeInstanceMaintainTimeRequest import DescribeInstanceMaintainTimeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SetImportFileSharedRequest(params_dict, headers) + req = DescribeInstanceMaintainTimeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1528,30 +1678,29 @@ def set_import_file_shared(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--file-name'], dict(help="""(string) 单库上云文件名 """, dest='fileName', required=True)), - (['--shared-file-gid'], dict(help="""(string) 共享文件的全局ID,可从上传文件查询接口describeImportFiles中获取;如果该文件不是共享文件,则无须输入该字段 """, dest='sharedFileGid', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除用户通过单库上云工具上传的数据库备份文件
- 仅支持SQL Server ''', + help=''' 实例状态为变配待切换中,可执行,执行后,状态变为变配中 ''', description=''' - 删除用户通过单库上云工具上传的数据库备份文件
- 仅支持SQL Server。 + 实例状态为变配待切换中,可执行,执行后,状态变为变配中。 - 示例: jdc rds delete-import-file --instance-id xxx --file-name xxx + 示例: jdc rds switch-for-modifying-instance-spec --instance-id xxx ''', ) - def delete_import_file(self): + def switch_for_modifying_instance_spec(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DeleteImportFileRequest import DeleteImportFileRequest + from jdcloud_sdk.services.rds.apis.SwitchForModifyingInstanceSpecRequest import SwitchForModifyingInstanceSpecRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteImportFileRequest(params_dict, headers) + req = SwitchForModifyingInstanceSpecRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1562,32 +1711,30 @@ def delete_import_file(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:[10,100],且为10的整数倍 """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 过滤参数,多个过滤参数之间的关系为“与”(and); 支持以下属性的过滤:; instanceId, 支持operator选项:eq; instanceName, 支持operator选项:eq, like; engine, 支持operator选项:eq; engineVersion, 支持operator选项:eq; instanceStatus, 支持operator选项:eq; vpcId, 支持operator选项:eq; instanceType, 支持operator选项:eq; internalDomainName, 支持operator选项:eq; publicDomainName, 支持operator选项:eq; """, dest='filters', required=False)), - (['--tag-filters'], dict(help="""(array: tagFilter) 资源标签 """, dest='tagFilters', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取当前账号下所有RDS实例及MySQL/PostgreSQL只读实例的概要信息,例如实例类型,版本,计费信息等 ''', + help=''' 获取当前数据库可升级到的版本,仅支持MySQL ''', description=''' - 获取当前账号下所有RDS实例及MySQL/PostgreSQL只读实例的概要信息,例如实例类型,版本,计费信息等。 + 获取当前数据库可升级到的版本,仅支持MySQL。 - 示例: jdc rds describe-instances + 示例: jdc rds describe-upgrade-versions --instance-id xxx ''', ) - def describe_instances(self): + def describe_upgrade_versions(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeInstancesRequest import DescribeInstancesRequest + from jdcloud_sdk.services.rds.apis.DescribeUpgradeVersionsRequest import DescribeUpgradeVersionsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstancesRequest(params_dict, headers) + req = DescribeUpgradeVersionsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1598,29 +1745,30 @@ def describe_instances(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-spec'], dict(help="""(dBInstanceSpec) 新建实例规格 """, dest='instanceSpec', required=True)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个RDS实例,用户可以使用相应的数据库客户端或者应用程序通过域名和端口链接到该RDS实例上,进行操作。 ''', + help=''' 查询当前发起的数据库的升级计划,仅支持MySQL ''', description=''' - 创建一个RDS实例,用户可以使用相应的数据库客户端或者应用程序通过域名和端口链接到该RDS实例上,进行操作。。 + 查询当前发起的数据库的升级计划,仅支持MySQL。 - 示例: jdc rds create-instance --instance-spec '{"":""}' + 示例: jdc rds describe-upgrade-plan --instance-id xxx ''', ) - def create_instance(self): + def describe_upgrade_plan(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.CreateInstanceRequest import CreateInstanceRequest + from jdcloud_sdk.services.rds.apis.DescribeUpgradePlanRequest import DescribeUpgradePlanRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateInstanceRequest(params_dict, headers) + req = DescribeUpgradePlanRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1632,28 +1780,31 @@ def create_instance(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--upgrade-schedule'], dict(help="""(int) 计划开始升级的时间,1:立即开始升级,2:维护时间窗口升级,0:取消升级 """, dest='upgradeSchedule', type=int, required=True)), + (['--new-version'], dict(help="""(string) 升级到的新版本,默认为当前实例可升级到的最新版本 """, dest='newVersion', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询RDS实例(MySQL、SQL Server等)的详细信息以及MySQL/PostgreSQL只读实例详细信息 ''', + help=''' 升级引擎版本,例如从5.7.21 升级到5.7.24,仅支持MySQL ''', description=''' - 查询RDS实例(MySQL、SQL Server等)的详细信息以及MySQL/PostgreSQL只读实例详细信息。 + 升级引擎版本,例如从5.7.21 升级到5.7.24,仅支持MySQL。 - 示例: jdc rds describe-instance-attributes --instance-id xxx + 示例: jdc rds upgrade-engine-version --instance-id xxx --upgrade-schedule 5 ''', ) - def describe_instance_attributes(self): + def upgrade_engine_version(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeInstanceAttributesRequest import DescribeInstanceAttributesRequest + from jdcloud_sdk.services.rds.apis.UpgradeEngineVersionRequest import UpgradeEngineVersionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceAttributesRequest(params_dict, headers) + req = UpgradeEngineVersionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1666,27 +1817,28 @@ def describe_instance_attributes(self): (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除一个RDS实例或者MySQL/PostgreSQL的只读实例。删除MySQL/PostgreSQL主实例时,会同时将对应的MySQL/PostgreSQL只读实例也删除 [MFA enabled] ''', + help=''' 获取用户通过单库上云工具上传到该实例上的文件列表
- 仅支持SQL Server ''', description=''' - 删除一个RDS实例或者MySQL/PostgreSQL的只读实例。删除MySQL/PostgreSQL主实例时,会同时将对应的MySQL/PostgreSQL只读实例也删除 [MFA enabled]。 + 获取用户通过单库上云工具上传到该实例上的文件列表
- 仅支持SQL Server。 - 示例: jdc rds delete-instance --instance-id xxx + 示例: jdc rds describe-import-files --instance-id xxx ''', ) - def delete_instance(self): + def describe_import_files(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DeleteInstanceRequest import DeleteInstanceRequest + from jdcloud_sdk.services.rds.apis.DescribeImportFilesRequest import DescribeImportFilesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteInstanceRequest(params_dict, headers) + req = DescribeImportFilesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1699,27 +1851,28 @@ def delete_instance(self): (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看RDS实例备份策略。根据数据库类型的不同,支持的备份策略也略有差异,具体请看返回参数中的详细说明 ''', + help=''' 获取单库上云工具上传文件的需要的Key。单库上云工具需要正确的key值方能连接到京东云
- 仅支持SQL Server ''', description=''' - 查看RDS实例备份策略。根据数据库类型的不同,支持的备份策略也略有差异,具体请看返回参数中的详细说明。 + 获取单库上云工具上传文件的需要的Key。单库上云工具需要正确的key值方能连接到京东云
- 仅支持SQL Server。 - 示例: jdc rds describe-backup-policy --instance-id xxx + 示例: jdc rds get-upload-key --instance-id xxx ''', ) - def describe_backup_policy(self): + def get_upload_key(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeBackupPolicyRequest import DescribeBackupPolicyRequest + from jdcloud_sdk.services.rds.apis.GetUploadKeyRequest import GetUploadKeyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBackupPolicyRequest(params_dict, headers) + req = GetUploadKeyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1731,29 +1884,31 @@ def describe_backup_policy(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--start-window'], dict(help="""(string) 自动备份开始时间窗口,例如:00:00-01:00,表示0点到1点开始进行数据库自动备份,备份完成时间则跟实例大小有关,不一定在这个时间范围中
SQL Server:范围00:00-23:59,时间范围差不得小于30分钟。
MySQL,只能是以下取值:
00:00-01:00
01:00-02:00
......
23:00-24:00 """, dest='startWindow', required=False)), + (['--file-name'], dict(help="""(string) 单库上云文件名 """, dest='fileName', required=True)), + (['--shared'], dict(help="""(string) 文件是否共享
true:共享
false:不共享 """, dest='shared', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改RDS实例备份策略,目前仅支持用户修改“自动备份开始时间窗口”这个参数,其他参数暂不开放修改 ''', + help=''' 设置或取消上传文件是否共享给同一账号下的其他实例。缺省情况下,文件仅在上传的实例上可见并可导入,其他实例不可见不可导入。如果需要该文件在其他实例上也可导入,可将此文件设置为共享
- 仅支持SQL Server ''', description=''' - 修改RDS实例备份策略,目前仅支持用户修改“自动备份开始时间窗口”这个参数,其他参数暂不开放修改。 + 设置或取消上传文件是否共享给同一账号下的其他实例。缺省情况下,文件仅在上传的实例上可见并可导入,其他实例不可见不可导入。如果需要该文件在其他实例上也可导入,可将此文件设置为共享
- 仅支持SQL Server。 - 示例: jdc rds modify-backup-policy --instance-id xxx + 示例: jdc rds set-import-file-shared --instance-id xxx --file-name xxx --shared xxx ''', ) - def modify_backup_policy(self): + def set_import_file_shared(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ModifyBackupPolicyRequest import ModifyBackupPolicyRequest + from jdcloud_sdk.services.rds.apis.SetImportFileSharedRequest import SetImportFileSharedRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyBackupPolicyRequest(params_dict, headers) + req = SetImportFileSharedRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1765,29 +1920,31 @@ def modify_backup_policy(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--instance-name'], dict(help="""(string) 实例名称,名称支持中文,实例名的具体规则可参见帮助中心文档:[名称及密码限制](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='instanceName', required=True)), + (['--file-name'], dict(help="""(string) 单库上云文件名 """, dest='fileName', required=True)), + (['--shared-file-gid'], dict(help="""(string) 共享文件的全局ID,可从上传文件查询接口describeImportFiles中获取;如果该文件不是共享文件,则无须输入该字段 """, dest='sharedFileGid', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改实例名称,可支持中文,实例名的具体规则可参见帮助中心文档:[名称及密码限制](../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) ''', + help=''' 删除用户通过单库上云工具上传的数据库备份文件
- 仅支持SQL Server ''', description=''' - 修改实例名称,可支持中文,实例名的具体规则可参见帮助中心文档:[名称及密码限制](../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md)。 + 删除用户通过单库上云工具上传的数据库备份文件
- 仅支持SQL Server。 - 示例: jdc rds modify-instance-name --instance-id xxx --instance-name xxx + 示例: jdc rds delete-import-file --instance-id xxx --file-name xxx ''', ) - def modify_instance_name(self): + def delete_import_file(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ModifyInstanceNameRequest import ModifyInstanceNameRequest + from jdcloud_sdk.services.rds.apis.DeleteImportFileRequest import DeleteImportFileRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyInstanceNameRequest(params_dict, headers) + req = DeleteImportFileRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1799,28 +1956,32 @@ def modify_instance_name(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为100,取值范围:[10,100],用于查询列表的接口 """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 过滤参数,多个过滤参数之间的关系为“与”(and); 支持以下属性的过滤:logType, 支持operator选项:eq, 仅支持 MySQL,Percona,MariaDB; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 对RDS实例进行主备切换。
注意:如果实例正在进行备份,那么主备切换将会终止备份操作。可以查看备份策略中的备份开始时间确认是否有备份正在运行。如果确实需要在实例备份时进行主备切换,建议切换完成 后,手工进行一次实例的全备
对于SQL Server,主备切换后30分钟内,不支持按时间点恢复/创建,例如在10:05分用户进行了主备切换,那么10:05 ~ 10:35这个时间段不能进行按时间点恢复/创建。
- 仅支持SQL Server ''', + help=''' 获取日志文件列表
- 仅支持PostgreSQL, MySQL, Percona, MariaDB ''', description=''' - 对RDS实例进行主备切换。
注意:如果实例正在进行备份,那么主备切换将会终止备份操作。可以查看备份策略中的备份开始时间确认是否有备份正在运行。如果确实需要在实例备份时进行主备切换,建议切换完成 后,手工进行一次实例的全备
对于SQL Server,主备切换后30分钟内,不支持按时间点恢复/创建,例如在10:05分用户进行了主备切换,那么10:05 ~ 10:35这个时间段不能进行按时间点恢复/创建。
- 仅支持SQL Server。 + 获取日志文件列表
- 仅支持PostgreSQL, MySQL, Percona, MariaDB。 - 示例: jdc rds failover-instance --instance-id xxx + 示例: jdc rds describe-logs --instance-id xxx ''', ) - def failover_instance(self): + def describe_logs(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.FailoverInstanceRequest import FailoverInstanceRequest + from jdcloud_sdk.services.rds.apis.DescribeLogsRequest import DescribeLogsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = FailoverInstanceRequest(params_dict, headers) + req = DescribeLogsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1832,30 +1993,31 @@ def failover_instance(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--reboot-master'], dict(help="""(bool) 是否重启主节点。
- 仅SQL Server 支持该参数 """, dest='rebootMaster', required=False)), - (['--reboot-slave'], dict(help="""(bool) 是否重启备节点。
- 仅SQL Server 支持该参数 """, dest='rebootSlave', required=False)), + (['--log-id'], dict(help="""(string) 日志文件ID """, dest='logId', required=True)), + (['--seconds'], dict(help="""(int) 设置链接地址的过期时间,单位是秒,最长不能超过取值范围为 1 ~ 86400 秒 """, dest='seconds', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 重启RDS实例,例如修改了一些配置参数后,需要重启实例才能生效。可以结合主备切换的功能,轮流重启备机,降低对业务的影响
**注意:如果实例正在进行备份,那么重启主实例将会终止备份操作。** 可以查看备份策略中的备份开始时间确认是否有备份正在运行。如果确实需要在实例备份时重启主实例,建议重启后,手工进行一次实例的全备。 ''', + help=''' 设置日志文件的下载链接过期时间,重新生成 PostgreSQL 的日志文件下载地址 ''', description=''' - 重启RDS实例,例如修改了一些配置参数后,需要重启实例才能生效。可以结合主备切换的功能,轮流重启备机,降低对业务的影响
**注意:如果实例正在进行备份,那么重启主实例将会终止备份操作。** 可以查看备份策略中的备份开始时间确认是否有备份正在运行。如果确实需要在实例备份时重启主实例,建议重启后,手工进行一次实例的全备。。 + 设置日志文件的下载链接过期时间,重新生成 PostgreSQL 的日志文件下载地址。 - 示例: jdc rds reboot-instance --instance-id xxx + 示例: jdc rds update-log-download-urlinternal --instance-id xxx --log-id xxx --seconds 5 ''', ) - def reboot_instance(self): + def update_log_download_urlinternal(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.RebootInstanceRequest import RebootInstanceRequest + from jdcloud_sdk.services.rds.apis.UpdateLogDownloadURLInternalRequest import UpdateLogDownloadURLInternalRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RebootInstanceRequest(params_dict, headers) + req = UpdateLogDownloadURLInternalRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1867,28 +2029,31 @@ def reboot_instance(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--log-id'], dict(help="""(string) 日志文件ID """, dest='logId', required=True)), + (['--seconds'], dict(help="""(int) 设置链接地址的过期时间,单位是秒,默认值是 300 秒,最长不能超过取值范围为 1 ~ 86400 秒 """, dest='seconds', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启RDS实例的外网访问功能。开启后,用户可以通过internet访问RDS实例 ''', + help=''' 根据日志文件的下载链接过期时间,生成日志文件下载地址 仅支持 PostgreSQL, MySQL, Percona, MariaDB ''', description=''' - 开启RDS实例的外网访问功能。开启后,用户可以通过internet访问RDS实例。 + 根据日志文件的下载链接过期时间,生成日志文件下载地址 仅支持 PostgreSQL, MySQL, Percona, MariaDB。 - 示例: jdc rds enable-internet-access --instance-id xxx + 示例: jdc rds describe-log-download-url --instance-id xxx --log-id xxx ''', ) - def enable_internet_access(self): + def describe_log_download_url(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.EnableInternetAccessRequest import EnableInternetAccessRequest + from jdcloud_sdk.services.rds.apis.DescribeLogDownloadURLRequest import DescribeLogDownloadURLRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableInternetAccessRequest(params_dict, headers) + req = DescribeLogDownloadURLRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1900,28 +2065,32 @@ def enable_internet_access(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--db-name'], dict(help="""(string) 数据库名。如果不指定数据库名,则返回所有数据库列表
- **MySQL:不支持该字段**
- **SQL Server:支持该字段** """, dest='dbName', required=False)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为100,取值范围:[10,100],用于查询列表的接口 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 关闭RDS实例的外网访问功能。关闭后,用户无法通过Internet访问RDS,但可以在京东云内网通过内网域名访问 ''', + help=''' 获取当前实例的所有数据库详细信息的列表 ''', description=''' - 关闭RDS实例的外网访问功能。关闭后,用户无法通过Internet访问RDS,但可以在京东云内网通过内网域名访问。 + 获取当前实例的所有数据库详细信息的列表。 - 示例: jdc rds disable-internet-access --instance-id xxx + 示例: jdc rds describe-databases --instance-id xxx ''', ) - def disable_internet_access(self): + def describe_databases(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DisableInternetAccessRequest import DisableInternetAccessRequest + from jdcloud_sdk.services.rds.apis.DescribeDatabasesRequest import DescribeDatabasesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisableInternetAccessRequest(params_dict, headers) + req = DescribeDatabasesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1933,29 +2102,31 @@ def disable_internet_access(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--backup-id'], dict(help="""(string) 用于恢复的备份Id,仅限于本实例生成的备份 """, dest='backupId', required=False)), + (['--db-name'], dict(help="""(string) 数据库名,数据库名称的限制请参考[帮助中心文档](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='dbName', required=True)), + (['--character-set-name'], dict(help="""(string) 数据库的字符集名,当前支持的字符集请查看[枚举参数定义](../Enum-Definitions/Enum-Definitions.md) """, dest='characterSetName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 使用实例的全量备份覆盖恢复当前实例 ''', + help=''' 创建一个数据库。 为了实例的管理和数据恢复,RDS对用户权限进行了限制,用户仅能通过控制台或本接口创建数据库 ''', description=''' - 使用实例的全量备份覆盖恢复当前实例。 + 创建一个数据库。 为了实例的管理和数据恢复,RDS对用户权限进行了限制,用户仅能通过控制台或本接口创建数据库。 - 示例: jdc rds restore-instance --instance-id xxx + 示例: jdc rds create-database --instance-id xxx --db-name xxx --character-set-name xxx ''', ) - def restore_instance(self): + def create_database(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.RestoreInstanceRequest import RestoreInstanceRequest + from jdcloud_sdk.services.rds.apis.CreateDatabaseRequest import CreateDatabaseRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RestoreInstanceRequest(params_dict, headers) + req = CreateDatabaseRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1966,31 +2137,31 @@ def restore_instance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--backup-id'], dict(help="""(string) 备份ID """, dest='backupId', required=True)), - (['--engine'], dict(help="""(string) 标识是创建什么类型的实例,例如MySQL,SQL Server等,具体可参见文档[枚举参数定义](../Enum-Definitions/Enum-Definitions.md)
**注意:备份来源实例的engine和要创建的实例的engine必须一致** """, dest='engine', required=True)), - (['--instance-spec'], dict(help="""(restoredNewDBInstanceSpec) 新建实例规格 """, dest='instanceSpec', required=True)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--db-name'], dict(help="""(string) 库名称 """, dest='dbName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据源实例全量备份创建一个新实例,新实例的数据跟源实例在创建备份时的数据状态一样。
例如根据源实例A的一个全量备份“mybak”新建一个实例B,该备份是在“‘2018-8-18 03:23:54”创建的。那么新建实例B的数据状态跟实例A‘2018-8-18 03:23:54’的状态一致 ''', + help=''' 从RDS实例中删除数据库。为便于管理和数据恢复,RDS对用户权限进行了控制,用户仅能通过控制台或本接口删除数据库 [MFA enabled] ''', description=''' - 根据源实例全量备份创建一个新实例,新实例的数据跟源实例在创建备份时的数据状态一样。
例如根据源实例A的一个全量备份“mybak”新建一个实例B,该备份是在“‘2018-8-18 03:23:54”创建的。那么新建实例B的数据状态跟实例A‘2018-8-18 03:23:54’的状态一致。 + 从RDS实例中删除数据库。为便于管理和数据恢复,RDS对用户权限进行了控制,用户仅能通过控制台或本接口删除数据库 [MFA enabled]。 - 示例: jdc rds create-instance-from-backup --backup-id xxx --engine xxx --instance-spec '{"":""}' + 示例: jdc rds delete-database --instance-id xxx --db-name xxx ''', ) - def create_instance_from_backup(self): + def delete_database(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.CreateInstanceFromBackupRequest import CreateInstanceFromBackupRequest + from jdcloud_sdk.services.rds.apis.DeleteDatabaseRequest import DeleteDatabaseRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateInstanceFromBackupRequest(params_dict, headers) + req = DeleteDatabaseRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2002,32 +2173,32 @@ def create_instance_from_backup(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--new-instance-class'], dict(help="""(string) 扩容后实例规格 """, dest='newInstanceClass', required=True)), - (['--new-instance-storage-gb'], dict(help="""(int) 扩容后实例磁盘大小 """, dest='newInstanceStorageGB', type=int, required=True)), - (['--new-instance-storage-type'], dict(help="""(string) 存储类型,如果不指定,默认会采用实例原存储类型. """, dest='newInstanceStorageType', required=False)), - (['--storage-encrypted'], dict(help="""(bool) 实例数据加密(存储类型为云硬盘才支持数据加密). false:不加密; true:加密. 如果实例从本地盘变为云硬盘,缺省为false. 如果实例本来就是使用云硬盘的,缺省和源实例保持一致 """, dest='storageEncrypted', required=False)), + (['--db-name'], dict(help="""(string) 库名称 """, dest='dbName', required=True)), + (['--backup-id'], dict(help="""(string) 备份ID,可从备份查询接口describeBackups获取 """, dest='backupId', required=True)), + (['--backup-file-name'], dict(help="""(string) 指定该备份中用于恢复数据库的文件名称。通常情况下文件名(不包括后缀)即为备份的数据库名。例如文件名为my_test_db.bak,表示该文件是my_test_db数据库的备份 """, dest='backupFileName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 实例扩容,支持升级实例的CPU,内存及磁盘。 ''', + help=''' 从备份中恢复单个数据库,支持从其他实例(但必须是同一个账号下的实例)备份中恢复。例如可以从生产环境的数据库实例的备份恢复到测试环境的数据库中。
- 仅支持SQL Server ''', description=''' - 实例扩容,支持升级实例的CPU,内存及磁盘。。 + 从备份中恢复单个数据库,支持从其他实例(但必须是同一个账号下的实例)备份中恢复。例如可以从生产环境的数据库实例的备份恢复到测试环境的数据库中。
- 仅支持SQL Server。 - 示例: jdc rds modify-instance-spec --instance-id xxx --new-instance-class xxx --new-instance-storage-gb 0 + 示例: jdc rds restore-database-from-backup --instance-id xxx --db-name xxx --backup-id xxx --backup-file-name xxx ''', ) - def modify_instance_spec(self): + def restore_database_from_backup(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ModifyInstanceSpecRequest import ModifyInstanceSpecRequest + from jdcloud_sdk.services.rds.apis.RestoreDatabaseFromBackupRequest import RestoreDatabaseFromBackupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyInstanceSpecRequest(params_dict, headers) + req = RestoreDatabaseFromBackupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2039,30 +2210,32 @@ def modify_instance_spec(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--restore-time'], dict(help="""(string) 根据源实例的哪个时间点创建新实例 """, dest='restoreTime', required=True)), - (['--instance-spec'], dict(help="""(restoredNewDBInstanceSpec) 新建实例规格 """, dest='instanceSpec', required=True)), + (['--db-name'], dict(help="""(string) 库名称 """, dest='dbName', required=True)), + (['--shared-file-gid'], dict(help="""(string) 共享文件的全局ID,可从上传文件查询接口[describeImportFiles](../Cloud-on-Single-Database/describeImportFiles.md)获取;如果该文件不是共享文件,则不用输入该参数 """, dest='sharedFileGid', required=False)), + (['--file-name'], dict(help="""(string) 用户上传的备份文件名称(包括文件后缀名),例如mydb1.bak """, dest='fileName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据源实例备份创建一个新实例,并通过追加日志的方式,将新实例的数据恢复到跟源实例指定时间点的数据状态一样。
例如根据实例A在“2018-06-18 23:00:00”时间点创建一个实例B,就是新建一个实例B,该实例B的数据跟实例A在“2018-06-18 23:00:00”这个时间点的数据完全一致。
对于SQL Server,主备切换后30分钟内,不支持按时间点恢复/创建,例如在10:05分用户进行了主备切换,那么10:05 ~ 10:35这个时间段不能进行按时间点恢复/创建。 ''', + help=''' 从用户通过单库上云工具上传到云上的备份文件中恢复单个数据库
- 仅支持SQL Server ''', description=''' - 根据源实例备份创建一个新实例,并通过追加日志的方式,将新实例的数据恢复到跟源实例指定时间点的数据状态一样。
例如根据实例A在“2018-06-18 23:00:00”时间点创建一个实例B,就是新建一个实例B,该实例B的数据跟实例A在“2018-06-18 23:00:00”这个时间点的数据完全一致。
对于SQL Server,主备切换后30分钟内,不支持按时间点恢复/创建,例如在10:05分用户进行了主备切换,那么10:05 ~ 10:35这个时间段不能进行按时间点恢复/创建。。 + 从用户通过单库上云工具上传到云上的备份文件中恢复单个数据库
- 仅支持SQL Server。 - 示例: jdc rds create-instance-by-time --instance-id xxx --restore-time xxx --instance-spec '{"":""}' + 示例: jdc rds restore-database-from-file --instance-id xxx --db-name xxx --file-name xxx ''', ) - def create_instance_by_time(self): + def restore_database_from_file(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.CreateInstanceByTimeRequest import CreateInstanceByTimeRequest + from jdcloud_sdk.services.rds.apis.RestoreDatabaseFromFileRequest import RestoreDatabaseFromFileRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateInstanceByTimeRequest(params_dict, headers) + req = RestoreDatabaseFromFileRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2074,38 +2247,31 @@ def create_instance_by_time(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--instance-name'], dict(help="""(string) 实例名称,具体规则可参见帮助中心文档:[名称及密码限制](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='instanceName', required=True)), - (['--instance-class'], dict(help="""(string) 只读实例规格FlavorId """, dest='instanceClass', required=True)), - (['--instance-storage-type'], dict(help="""(string) 存储类型,参见[枚举参数定义](../Enum-Definitions/Enum-Definitions.md),缺省值为:LOCAL_SSD """, dest='instanceStorageType', required=False)), - (['--instance-storage-gb'], dict(help="""(int) 磁盘空间 """, dest='instanceStorageGB', type=int, required=True)), - (['--az-id'], dict(help="""(string) 可用区ID """, dest='azId', required=True)), - (['--vpc-id'], dict(help="""(string) VPC的ID,如果没有填写就保持和常规实例一样的VPC """, dest='vpcId', required=False)), - (['--subnet-id'], dict(help="""(string) 子网ID,如果没有填写就保持和常规实例一样的subnet """, dest='subnetId', required=False)), - (['--parameter-group'], dict(help="""(string) 参数组ID,缺省采用和常规实例一样的参数组 """, dest='parameterGroup', required=False)), - (['--storage-encrypted'], dict(help="""(bool) 实例数据加密(存储类型为云硬盘才支持数据加密)。false:不加密;true:加密。缺省为false。 """, dest='storageEncrypted', required=False)), - (['--count'], dict(help="""(int) 创建只读实例的数目,缺省为1 """, dest='count', type=int, required=False)), + (['--db-name'], dict(help="""(string) 库名称 """, dest='dbName', required=True)), + (['--oss-url'], dict(help="""(string) 用户上传到对象存储OSS上的备份文件的路径。
例如用户备份上传的bucket为db_backup,文件为test_server/db1.bak,那么ossULR为db_backup/test_server/db1.bak。
**授权说明**:需要授予账户ID:785455908940,对这个bucket的读取权限,具体步骤可以查看[文档](https://docs.jdcloud.com/cn/object-storage-service/set-bucket-policy-2)。 """, dest='ossURL', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建MySQL的只读实例
- 仅支持MySQL
- 创建的只读实例跟主实例在同一个VPC同一个子网中
* 只读实例只支持按配置计费 ''', + help=''' 从上传到OSS的备份文件中恢复单个数据库
- 仅支持SQL Server ''', description=''' - 创建MySQL的只读实例
- 仅支持MySQL
- 创建的只读实例跟主实例在同一个VPC同一个子网中
* 只读实例只支持按配置计费。 + 从上传到OSS的备份文件中恢复单个数据库
- 仅支持SQL Server。 - 示例: jdc rds create-roinstance --instance-id xxx --instance-name xxx --instance-class xxx --instance-storage-gb 0 --az-id xxx + 示例: jdc rds restore-database-from-oss --instance-id xxx --db-name xxx --oss-url xxx ''', ) - def create_roinstance(self): + def restore_database_from_oss(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.CreateROInstanceRequest import CreateROInstanceRequest + from jdcloud_sdk.services.rds.apis.RestoreDatabaseFromOSSRequest import RestoreDatabaseFromOSSRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateROInstanceRequest(params_dict, headers) + req = RestoreDatabaseFromOSSRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2117,29 +2283,31 @@ def create_roinstance(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--connection-mode'], dict(help="""(string) 连接模式
- standard:标准模式(缺省),响应时间短,但没有 SQL 审计和拦截的能力
- security:高安全模式,具备一定的 SQL注入拦截能力,并可开启 SQL 审计,但会增加一定的响应时间 """, dest='connectionMode', required=True)), + (['--db-name'], dict(help="""(string) 库名称 """, dest='dbName', required=True)), + (['--comment'], dict(help="""(string) 数据库的备注信息,支持中午,ASCII字符,最大长度64 """, dest='comment', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改MySQL实例的连接模式:标准模式(standard) 和高安全模式(security).
- **标准模式**:响应时间短,但没有 SQL 审计和拦截的能力。
- **高安全模式**:具备一定的 SQL注入拦截能力(通过分析表达式、关键系统函数等来实现防御 SQL 注入攻击),并可开启 SQL 审计,但会增加一定的响应时间。
- 仅支持MySQL ''', + help=''' 修改数据库备注,仅支持MySQL ''', description=''' - 修改MySQL实例的连接模式:标准模式(standard) 和高安全模式(security).
- **标准模式**:响应时间短,但没有 SQL 审计和拦截的能力。
- **高安全模式**:具备一定的 SQL注入拦截能力(通过分析表达式、关键系统函数等来实现防御 SQL 注入攻击),并可开启 SQL 审计,但会增加一定的响应时间。
- 仅支持MySQL。 + 修改数据库备注,仅支持MySQL。 - 示例: jdc rds modify-connection-mode --instance-id xxx --connection-mode xxx + 示例: jdc rds modify-database-comment --instance-id xxx --db-name xxx --comment xxx ''', ) - def modify_connection_mode(self): + def modify_database_comment(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ModifyConnectionModeRequest import ModifyConnectionModeRequest + from jdcloud_sdk.services.rds.apis.ModifyDatabaseCommentRequest import ModifyDatabaseCommentRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyConnectionModeRequest(params_dict, headers) + req = ModifyDatabaseCommentRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2149,30 +2317,31 @@ def modify_connection_mode(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取SQL Server实例按时间点恢复/创建时,可恢复到的最后的一个时间点
- 仅支持SQL Server ''', + help=''' 开启数据库的高安全模式
- 仅支持MySQL ''', description=''' - 获取SQL Server实例按时间点恢复/创建时,可恢复到的最后的一个时间点
- 仅支持SQL Server。 + 开启数据库的高安全模式
- 仅支持MySQL。 - 示例: jdc rds describe-latest-restore-time --instance-id xxx + 示例: jdc rds enable-intercept --instance-id xxx ''', ) - def describe_latest_restore_time(self): + def enable_intercept(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeLatestRestoreTimeRequest import DescribeLatestRestoreTimeRequest + from jdcloud_sdk.services.rds.apis.EnableInterceptRequest import EnableInterceptRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLatestRestoreTimeRequest(params_dict, headers) + req = EnableInterceptRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2182,31 +2351,31 @@ def describe_latest_restore_time(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--parameter-group-id'], dict(help="""(string) 参数组ID """, dest='parameterGroupId', required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改RDS实例的参数组
- 仅支持MySQL ''', + help=''' 关闭数据库的高安全模式
- 仅支持MySQL ''', description=''' - 修改RDS实例的参数组
- 仅支持MySQL。 + 关闭数据库的高安全模式
- 仅支持MySQL。 - 示例: jdc rds modify-parameter-group --instance-id xxx --parameter-group-id xxx + 示例: jdc rds disable-intercept --instance-id xxx ''', ) - def modify_parameter_group(self): + def disable_intercept(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ModifyParameterGroupRequest import ModifyParameterGroupRequest + from jdcloud_sdk.services.rds.apis.DisableInterceptRequest import DisableInterceptRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyParameterGroupRequest(params_dict, headers) + req = DisableInterceptRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2216,31 +2385,34 @@ def modify_parameter_group(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--target-instance-id'], dict(help="""(string) 要交换的实例ID """, dest='targetInstanceId', required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:[10,100],且为10的整数倍 """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 过滤参数,多个过滤参数之间的关系为“与”(and);; 支持以下属性的过滤:account,database,keyword; 支持operator选项:eq,in; 仅支持 MySQL,Percona,MariaDB; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 交换两个实例的域名,包括内网域名和外网域名。如果一个实例有外网域名,一个没有,则不允许交换。
- 仅支持SQL Server ''', + help=''' 查看开启高安全模式后,当前实例的 SQL 拦截记录
- 仅支持MySQL ''', description=''' - 交换两个实例的域名,包括内网域名和外网域名。如果一个实例有外网域名,一个没有,则不允许交换。
- 仅支持SQL Server。 + 查看开启高安全模式后,当前实例的 SQL 拦截记录
- 仅支持MySQL。 - 示例: jdc rds exchange-instance-dns --instance-id xxx --target-instance-id xxx + 示例: jdc rds describe-intercept-result --instance-id xxx ''', ) - def exchange_instance_dns(self): + def describe_intercept_result(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ExchangeInstanceDnsRequest import ExchangeInstanceDnsRequest + from jdcloud_sdk.services.rds.apis.DescribeInterceptResultRequest import DescribeInterceptResultRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ExchangeInstanceDnsRequest(params_dict, headers) + req = DescribeInterceptResultRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2250,31 +2422,31 @@ def exchange_instance_dns(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--new-az-id'], dict(help="""(array) 新可用区ID。 如果是单机实例,只需输入一个可用区;如果是主备实例,则必须输入两个可用区ID:第一个为主节点所在可用区,第二个为备节点所在可用区。主备两个可用区可以相同,也可以不同 """, dest='newAzId', required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改实例的可用区,例如将实例的可用区从单可用区调整为多可用区 ''', + help=''' 查看当前实例已开启的安全模式。如果开启数据库的高安全模式,会返回配置信息
- 仅支持MySQL ''', description=''' - 修改实例的可用区,例如将实例的可用区从单可用区调整为多可用区。 + 查看当前实例已开启的安全模式。如果开启数据库的高安全模式,会返回配置信息
- 仅支持MySQL。 - 示例: jdc rds modify-instance-az --instance-id xxx --new-az-id '{"":""}' + 示例: jdc rds describe-intercept --instance-id xxx ''', ) - def modify_instance_az(self): + def describe_intercept(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ModifyInstanceAzRequest import ModifyInstanceAzRequest + from jdcloud_sdk.services.rds.apis.DescribeInterceptRequest import DescribeInterceptRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyInstanceAzRequest(params_dict, headers) + req = DescribeInterceptRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2285,29 +2457,30 @@ def modify_instance_az(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--instance-id'], dict(help="""(string) RDS实例ID,唯一标识一个实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看当前实例已开启加密连接。 ''', + help=''' 查看RDS读写分离代理列表
- 仅支持MySQL ''', description=''' - 查看当前实例已开启加密连接。。 + 查看RDS读写分离代理列表
- 仅支持MySQL。 - 示例: jdc rds describe-ssl --instance-id xxx + 示例: jdc rds describe-read-write-proxies --instance-id xxx ''', ) - def describe_ssl(self): + def describe_read_write_proxies(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeSSLRequest import DescribeSSLRequest + from jdcloud_sdk.services.rds.apis.DescribeReadWriteProxiesRequest import DescribeReadWriteProxiesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSSLRequest(params_dict, headers) + req = DescribeReadWriteProxiesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2318,29 +2491,33 @@ def describe_ssl(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--instance-id'], dict(help="""(string) RDS 实例ID """, dest='instanceId', required=True)), + (['--delay-threshold'], dict(help="""(int) 延迟阈值,范围是0~1000,单位:秒,默认为100 """, dest='delayThreshold', type=int, required=False)), + (['--load-balancer-policy'], dict(help="""(string) 读写分离代理后端实例负载均衡策略,默认值为LEAST_CURRENT_OPERATIONS;当前支持的负载均衡策略请查看[枚举参数定义](../Enum-Definitions/Enum-Definitions.md) """, dest='loadBalancerPolicy', required=False)), + (['--health-check-spec'], dict(help="""(healthCheckSpec) 后端实例健康检查配置 """, dest='healthCheckSpec', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启数据库的加密连接, 同时会重启数据库实例 ''', + help=''' 创建数据库读写分离代理服务
- 仅支持MySQL ''', description=''' - 开启数据库的加密连接, 同时会重启数据库实例。 + 创建数据库读写分离代理服务
- 仅支持MySQL。 - 示例: jdc rds enable-ssl --instance-id xxx + 示例: jdc rds create-read-write-proxy --instance-id xxx ''', ) - def enable_ssl(self): + def create_read_write_proxy(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.EnableSSLRequest import EnableSSLRequest + from jdcloud_sdk.services.rds.apis.CreateReadWriteProxyRequest import CreateReadWriteProxyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableSSLRequest(params_dict, headers) + req = CreateReadWriteProxyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2351,31 +2528,30 @@ def enable_ssl(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--restore-time'], dict(help="""(string) 根据源实例的哪个时间点创建新实例 """, dest='restoreTime', required=True)), - (['--restore-schema'], dict(help="""(array: array) 需要进行单库,单表恢复的概要信息 """, dest='restoreSchema', required=True)), + (['--read-write-proxy-id'], dict(help="""(string) 读写分离代理服务ID """, dest='readWriteProxyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据时间点,选择单表恢复当前实例
- 仅支持MySQL ''', + help=''' 查看指定RDS读写分离代理详情
- 仅支持MySQL ''', description=''' - 根据时间点,选择单表恢复当前实例
- 仅支持MySQL。 + 查看指定RDS读写分离代理详情
- 仅支持MySQL。 - 示例: jdc rds restore-instance-by-time --instance-id xxx --restore-time xxx --restore-schema ['{"":""}'] + 示例: jdc rds describe-read-write-proxy-attribute --read-write-proxy-id xxx ''', ) - def restore_instance_by_time(self): + def describe_read_write_proxy_attribute(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.RestoreInstanceByTimeRequest import RestoreInstanceByTimeRequest + from jdcloud_sdk.services.rds.apis.DescribeReadWriteProxyAttributeRequest import DescribeReadWriteProxyAttributeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RestoreInstanceByTimeRequest(params_dict, headers) + req = DescribeReadWriteProxyAttributeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2385,30 +2561,31 @@ def restore_instance_by_time(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--read-write-proxy-id'], dict(help="""(string) 读写分离代理服务ID """, dest='readWriteProxyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启数据库的高安全模式
- 仅支持MySQL ''', + help=''' 删除RDS 实例的读写分离代理
- 仅支持MySQL ''', description=''' - 开启数据库的高安全模式
- 仅支持MySQL。 + 删除RDS 实例的读写分离代理
- 仅支持MySQL。 - 示例: jdc rds enable-intercept --instance-id xxx + 示例: jdc rds delete-read-write-proxy --read-write-proxy-id xxx ''', ) - def enable_intercept(self): + def delete_read_write_proxy(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.EnableInterceptRequest import EnableInterceptRequest + from jdcloud_sdk.services.rds.apis.DeleteReadWriteProxyRequest import DeleteReadWriteProxyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableInterceptRequest(params_dict, headers) + req = DeleteReadWriteProxyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2418,30 +2595,31 @@ def enable_intercept(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--read-write-proxy-id'], dict(help="""(string) 读写分离代理服务ID """, dest='readWriteProxyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 关闭数据库的高安全模式
- 仅支持MySQL ''', + help=''' 开启读写分离代理服务的外网访问功能。开启后,用户可以通过 internet 连接读写分离代理服务
- 仅支持MySQL ''', description=''' - 关闭数据库的高安全模式
- 仅支持MySQL。 + 开启读写分离代理服务的外网访问功能。开启后,用户可以通过 internet 连接读写分离代理服务
- 仅支持MySQL。 - 示例: jdc rds disable-intercept --instance-id xxx + 示例: jdc rds enable-read-write-proxy-internet-access --read-write-proxy-id xxx ''', ) - def disable_intercept(self): + def enable_read_write_proxy_internet_access(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DisableInterceptRequest import DisableInterceptRequest + from jdcloud_sdk.services.rds.apis.EnableReadWriteProxyInternetAccessRequest import EnableReadWriteProxyInternetAccessRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisableInterceptRequest(params_dict, headers) + req = EnableReadWriteProxyInternetAccessRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2451,32 +2629,31 @@ def disable_intercept(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:[10,100],且为10的整数倍 """, dest='pageSize', type=int, required=False)), + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--read-write-proxy-id'], dict(help="""(string) 读写分离代理服务ID """, dest='readWriteProxyId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看开启高安全模式后,当前实例的 SQL 拦截记录
- 仅支持MySQL ''', + help=''' 关闭读写分离代理服务的外网访问功能。关闭后,用户无法通过 Internet 连接读写分离代理服务,但可以在京东云内网通过内网域名连接
- 仅支持MySQL ''', description=''' - 查看开启高安全模式后,当前实例的 SQL 拦截记录
- 仅支持MySQL。 + 关闭读写分离代理服务的外网访问功能。关闭后,用户无法通过 Internet 连接读写分离代理服务,但可以在京东云内网通过内网域名连接
- 仅支持MySQL。 - 示例: jdc rds describe-intercept-result --instance-id xxx + 示例: jdc rds disable-read-write-proxy-internet-access --read-write-proxy-id xxx ''', ) - def describe_intercept_result(self): + def disable_read_write_proxy_internet_access(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeInterceptResultRequest import DescribeInterceptResultRequest + from jdcloud_sdk.services.rds.apis.DisableReadWriteProxyInternetAccessRequest import DisableReadWriteProxyInternetAccessRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInterceptResultRequest(params_dict, headers) + req = DisableReadWriteProxyInternetAccessRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2486,30 +2663,34 @@ def describe_intercept_result(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--read-write-proxy-id'], dict(help="""(string) 读写分离代理服务ID """, dest='readWriteProxyId', required=True)), + (['--delay-threshold'], dict(help="""(int) 延迟阈值,范围是0~1000,单位:秒,默认为100 """, dest='delayThreshold', type=int, required=False)), + (['--load-balancer-policy'], dict(help="""(string) 读写分离代理后端实例负载均衡策略,默认值为LEAST_CURRENT_OPERATIONS;当前支持的负载均衡策略请查看[枚举参数定义](../Enum-Definitions/Enum-Definitions.md) """, dest='loadBalancerPolicy', required=False)), + (['--health-check-spec'], dict(help="""(healthCheckSpec) 后端实例健康检查配置 """, dest='healthCheckSpec', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看当前实例已开启的安全模式。如果开启数据库的高安全模式,会返回配置信息
- 仅支持MySQL ''', + help=''' 修改数据库读写分离代理服务配置
- 仅支持MySQL ''', description=''' - 查看当前实例已开启的安全模式。如果开启数据库的高安全模式,会返回配置信息
- 仅支持MySQL。 + 修改数据库读写分离代理服务配置
- 仅支持MySQL。 - 示例: jdc rds describe-intercept --instance-id xxx + 示例: jdc rds modify-read-write-proxy --read-write-proxy-id xxx ''', ) - def describe_intercept(self): + def modify_read_write_proxy(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeInterceptRequest import DescribeInterceptRequest + from jdcloud_sdk.services.rds.apis.ModifyReadWriteProxyRequest import ModifyReadWriteProxyRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInterceptRequest(params_dict, headers) + req = ModifyReadWriteProxyRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2519,33 +2700,31 @@ def describe_intercept(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为100,取值范围:[10,100],用于查询列表的接口 """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) 过滤参数,多个过滤参数之间的关系为“与”(and); 支持以下属性的过滤:logType, 支持operator选项:eq, 仅支持 MySQL,Percona,MariaDB; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--parameter-group-id'], dict(help="""(string) Parameter Group ID """, dest='parameterGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取日志文件列表
- 仅支持PostgreSQL, MySQL, Percona, MariaDB ''', + help=''' 删除参数组
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', description=''' - 获取日志文件列表
- 仅支持PostgreSQL, MySQL, Percona, MariaDB。 + 删除参数组
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 - 示例: jdc rds describe-logs --instance-id xxx + 示例: jdc rds delete-parameter-group --parameter-group-id xxx ''', ) - def describe_logs(self): + def delete_parameter_group(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeLogsRequest import DescribeLogsRequest + from jdcloud_sdk.services.rds.apis.DeleteParameterGroupRequest import DeleteParameterGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLogsRequest(params_dict, headers) + req = DeleteParameterGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2555,32 +2734,33 @@ def describe_logs(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--log-id'], dict(help="""(string) 日志文件ID """, dest='logId', required=True)), - (['--seconds'], dict(help="""(int) 设置链接地址的过期时间,单位是秒,最长不能超过取值范围为 1 ~ 86400 秒 """, dest='seconds', type=int, required=True)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--parameter-group-id'], dict(help="""(string) Parameter Group ID """, dest='parameterGroupId', required=True)), + (['--parameter-group-name'], dict(help="""(string) 参数组名称 """, dest='parameterGroupName', required=True)), + (['--description'], dict(help="""(string) 参数组描述 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 设置日志文件的下载链接过期时间,重新生成 PostgreSQL 的日志文件下载地址 ''', + help=''' 修改参数组名称,描述
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', description=''' - 设置日志文件的下载链接过期时间,重新生成 PostgreSQL 的日志文件下载地址。 + 修改参数组名称,描述
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 - 示例: jdc rds update-log-download-urlinternal --instance-id xxx --log-id xxx --seconds 0 + 示例: jdc rds modify-parameter-group-attribute --parameter-group-id xxx --parameter-group-name xxx ''', ) - def update_log_download_urlinternal(self): + def modify_parameter_group_attribute(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.UpdateLogDownloadURLInternalRequest import UpdateLogDownloadURLInternalRequest + from jdcloud_sdk.services.rds.apis.ModifyParameterGroupAttributeRequest import ModifyParameterGroupAttributeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateLogDownloadURLInternalRequest(params_dict, headers) + req = ModifyParameterGroupAttributeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2590,32 +2770,32 @@ def update_log_download_urlinternal(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--log-id'], dict(help="""(string) 日志文件ID """, dest='logId', required=True)), - (['--seconds'], dict(help="""(int) 设置链接地址的过期时间,单位是秒,默认值是 300 秒,最长不能超过取值范围为 1 ~ 86400 秒 """, dest='seconds', type=int, required=False)), + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:[10,100],且为10的整数倍 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据日志文件的下载链接过期时间,生成日志文件下载地址 仅支持 PostgreSQL, MySQL, Percona, MariaDB ''', + help=''' 获取当前账号下所有的参数组列表
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', description=''' - 根据日志文件的下载链接过期时间,生成日志文件下载地址 仅支持 PostgreSQL, MySQL, Percona, MariaDB。 + 获取当前账号下所有的参数组列表
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 - 示例: jdc rds describe-log-download-url --instance-id xxx --log-id xxx + 示例: jdc rds describe-parameter-groups ''', ) - def describe_log_download_url(self): + def describe_parameter_groups(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeLogDownloadURLRequest import DescribeLogDownloadURLRequest + from jdcloud_sdk.services.rds.apis.DescribeParameterGroupsRequest import DescribeParameterGroupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeLogDownloadURLRequest(params_dict, headers) + req = DescribeParameterGroupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2626,29 +2806,33 @@ def describe_log_download_url(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--engine'], dict(help="""(string) 实例引擎类型,参见[枚举参数定义](../Enum-Definitions/Enum-Definitions.md) """, dest='engine', required=True)), + (['--engine-version'], dict(help="""(string) 实例引擎版本,参见[枚举参数定义](../Enum-Definitions/Enum-Definitions.md) """, dest='engineVersion', required=True)), + (['--parameter-group-name'], dict(help="""(string) 参数组的名字 """, dest='parameterGroupName', required=True)), + (['--description'], dict(help="""(string) 参数组的描述 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看SQL Server实例的配置参数
- 仅支持SQL Server ''', + help=''' 创建一个参数组
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', description=''' - 查看SQL Server实例的配置参数
- 仅支持SQL Server。 + 创建一个参数组
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 - 示例: jdc rds describe-parameters --instance-id xxx + 示例: jdc rds create-parameter-group --engine xxx --engine-version xxx --parameter-group-name xxx ''', ) - def describe_parameters(self): + def create_parameter_group(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeParametersRequest import DescribeParametersRequest + from jdcloud_sdk.services.rds.apis.CreateParameterGroupRequest import CreateParameterGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeParametersRequest(params_dict, headers) + req = CreateParameterGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2659,30 +2843,30 @@ def describe_parameters(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), - (['--parameters'], dict(help="""(array: parameter) 修改的实例参数 """, dest='parameters', required=True)), + (['--parameter-group-id'], dict(help="""(string) Parameter Group ID """, dest='parameterGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改SQL Server实例的配置参数,目前支持以下参数:max_worker_threads,max_degree_of_parallelism,max_server_memory_(MB)。 部分参数修改后,需要重启才能生效,具体可以参考微软的相关文档。
- 仅支持SQL Server ''', + help=''' 查看参数组的参数
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', description=''' - 修改SQL Server实例的配置参数,目前支持以下参数:max_worker_threads,max_degree_of_parallelism,max_server_memory_(MB)。 部分参数修改后,需要重启才能生效,具体可以参考微软的相关文档。
- 仅支持SQL Server。 + 查看参数组的参数
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 - 示例: jdc rds modify-parameters --instance-id xxx --parameters ['{"":""}'] + 示例: jdc rds describe-parameter-group-parameters --parameter-group-id xxx ''', ) - def modify_parameters(self): + def describe_parameter_group_parameters(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ModifyParametersRequest import ModifyParametersRequest + from jdcloud_sdk.services.rds.apis.DescribeParameterGroupParametersRequest import DescribeParameterGroupParametersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyParametersRequest(params_dict, headers) + req = DescribeParameterGroupParametersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2694,28 +2878,30 @@ def modify_parameters(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--parameter-group-id'], dict(help="""(string) Parameter Group ID """, dest='parameterGroupId', required=True)), + (['--parameters'], dict(help="""(array: array) 修改的参数 """, dest='parameters', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除参数组
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', + help=''' 修改参数组的参数
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', description=''' - 删除参数组
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 + 修改参数组的参数
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 - 示例: jdc rds delete-parameter-group --parameter-group-id xxx + 示例: jdc rds modify-parameter-group-parameters --parameter-group-id xxx --parameters ['{"":""}'] ''', ) - def delete_parameter_group(self): + def modify_parameter_group_parameters(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DeleteParameterGroupRequest import DeleteParameterGroupRequest + from jdcloud_sdk.services.rds.apis.ModifyParameterGroupParametersRequest import ModifyParameterGroupParametersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteParameterGroupRequest(params_dict, headers) + req = ModifyParameterGroupParametersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2727,30 +2913,33 @@ def delete_parameter_group(self): arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--parameter-group-id'], dict(help="""(string) Parameter Group ID """, dest='parameterGroupId', required=True)), - (['--parameter-group-name'], dict(help="""(string) 参数组名称 """, dest='parameterGroupName', required=True)), - (['--description'], dict(help="""(string) 参数组描述 """, dest='description', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:[10,100],且为10的整数倍 """, dest='pageSize', type=int, required=False)), + (['--start-time'], dict(help="""(string) 查询开始时间,格式为:YYYY-MM-DD HH:mm:ss """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 查询结束时间,格式为:YYYY-MM-DD HH:mm:ss """, dest='endTime', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], formatter_class=RawTextHelpFormatter, - help=''' 修改参数组名称,描述
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', + help=''' 查看参数的修改历史
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', description=''' - 修改参数组名称,描述
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 + 查看参数的修改历史
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 - 示例: jdc rds modify-parameter-group-attribute --parameter-group-id xxx --parameter-group-name xxx + 示例: jdc rds describe-parameter-modify-records --parameter-group-id xxx ''', ) - def modify_parameter_group_attribute(self): + def describe_parameter_modify_records(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ModifyParameterGroupAttributeRequest import ModifyParameterGroupAttributeRequest + from jdcloud_sdk.services.rds.apis.DescribeParameterModifyRecordsRequest import DescribeParameterModifyRecordsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyParameterGroupAttributeRequest(params_dict, headers) + req = DescribeParameterModifyRecordsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2761,30 +2950,32 @@ def modify_parameter_group_attribute(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:[10,100],且为10的整数倍 """, dest='pageSize', type=int, required=False)), + (['--parameter-group-id'], dict(help="""(string) 参数组ID """, dest='parameterGroupId', required=True)), + (['--parameter-group-name'], dict(help="""(string) 参数组的名字 """, dest='parameterGroupName', required=True)), + (['--description'], dict(help="""(string) 参数组的描述 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取当前账号下所有的参数组列表
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', + help=''' 拷贝参数组 ''', description=''' - 获取当前账号下所有的参数组列表
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 + 拷贝参数组。 - 示例: jdc rds describe-parameter-groups + 示例: jdc rds copy-parameter-group --parameter-group-id xxx --parameter-group-name xxx ''', ) - def describe_parameter_groups(self): + def copy_parameter_group(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeParameterGroupsRequest import DescribeParameterGroupsRequest + from jdcloud_sdk.services.rds.apis.CopyParameterGroupRequest import CopyParameterGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeParameterGroupsRequest(params_dict, headers) + req = CopyParameterGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2795,32 +2986,32 @@ def describe_parameter_groups(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--engine'], dict(help="""(string) 实例引擎类型,参见[枚举参数定义](../Enum-Definitions/Enum-Definitions.md) """, dest='engine', required=True)), - (['--engine-version'], dict(help="""(string) 实例引擎版本,参见[枚举参数定义](../Enum-Definitions/Enum-Definitions.md) """, dest='engineVersion', required=True)), - (['--parameter-group-name'], dict(help="""(string) 参数组的名字 """, dest='parameterGroupName', required=True)), - (['--description'], dict(help="""(string) 参数组的描述 """, dest='description', required=False)), + (['--parameter-group-id'], dict(help="""(string) Parameter Group ID """, dest='parameterGroupId', required=True)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:[10,100],且为10的整数倍 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个参数组
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', + help=''' 查看参数组绑定的云数据库实例
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', description=''' - 创建一个参数组
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 + 查看参数组绑定的云数据库实例
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 - 示例: jdc rds create-parameter-group --engine xxx --engine-version xxx --parameter-group-name xxx + 示例: jdc rds describe-parameter-group-attached-instances --parameter-group-id xxx ''', ) - def create_parameter_group(self): + def describe_parameter_group_attached_instances(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.CreateParameterGroupRequest import CreateParameterGroupRequest + from jdcloud_sdk.services.rds.apis.DescribeParameterGroupAttachedInstancesRequest import DescribeParameterGroupAttachedInstancesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateParameterGroupRequest(params_dict, headers) + req = DescribeParameterGroupAttachedInstancesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2830,30 +3021,38 @@ def create_parameter_group(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--parameter-group-id'], dict(help="""(string) Parameter Group ID """, dest='parameterGroupId', required=True)), + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS实例ID,唯一标识一个实例 """, dest='instanceId', required=True)), + (['--auto'], dict(help="""(int) 查询备份类型,0为手动备份,1为自动备份,不传表示全部.
**- 测试参数,仅支持SQL Server,后续可能被其他参数取代** """, dest='auto', type=int, required=False)), + (['--backup-type-filter'], dict(help="""(string) 返回backupType等于指定值的备份列表。full为全量备份,diff为增量备份
**- 测试参数,仅支持SQL Server,后续可能被其他参数取代** """, dest='backupTypeFilter', required=False)), + (['--db-name-filter'], dict(help="""(string) 返回dbName等于指定值的备份列表,不传或为空返回全部
**- 测试参数,仅支持SQL Server,后续可能被其他参数取代** """, dest='dbNameFilter', required=False)), + (['--backup-time-range-start-filter'], dict(help="""(string) 返回备份开始时间大于该时间的备份列表
**- 测试参数,仅支持SQL Server,后续可能被其他参数取代** """, dest='backupTimeRangeStartFilter', required=False)), + (['--backup-time-range-end-filter'], dict(help="""(string) 返回备份开始时间小于等于该时间的备份列表
**- 测试参数,仅支持SQL Server,后续可能被其他参数取代** """, dest='backupTimeRangeEndFilter', required=False)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=True)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、30、50、100 """, dest='pageSize', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看参数组的参数
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', + help=''' 查看该RDS实例下所有备份的详细信息,返回的备份列表按照备份开始时间(backupStartTime)降序排列。 ''', description=''' - 查看参数组的参数
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 + 查看该RDS实例下所有备份的详细信息,返回的备份列表按照备份开始时间(backupStartTime)降序排列。。 - 示例: jdc rds describe-parameter-group-parameters --parameter-group-id xxx + 示例: jdc rds describe-backups --instance-id xxx --page-number 5 --page-size 5 ''', ) - def describe_parameter_group_parameters(self): + def describe_backups(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeParameterGroupParametersRequest import DescribeParameterGroupParametersRequest + from jdcloud_sdk.services.rds.apis.DescribeBackupsRequest import DescribeBackupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeParameterGroupParametersRequest(params_dict, headers) + req = DescribeBackupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2863,31 +3062,699 @@ def describe_parameter_group_parameters(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--parameter-group-id'], dict(help="""(string) Parameter Group ID """, dest='parameterGroupId', required=True)), - (['--parameters'], dict(help="""(array: array) 修改的参数 """, dest='parameters', required=True)), + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS实例ID,唯一标识一个实例 """, dest='instanceId', required=False)), + (['--backup-spec'], dict(help="""(backupSpec) 备份规格 """, dest='backupSpec', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改参数组的参数
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', + help=''' 创建一个RDS实例全量备份,可以对整个实例或者部分数据库(仅SQL Server支持)进行全量备份。同一时间点,只能有一个正在运行的备份任务 ''', description=''' - 修改参数组的参数
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 + 创建一个RDS实例全量备份,可以对整个实例或者部分数据库(仅SQL Server支持)进行全量备份。同一时间点,只能有一个正在运行的备份任务。 - 示例: jdc rds modify-parameter-group-parameters --parameter-group-id xxx --parameters ['{"":""}'] + 示例: jdc rds create-backup ''', ) - def modify_parameter_group_parameters(self): + def create_backup(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ModifyParameterGroupParametersRequest import ModifyParameterGroupParametersRequest + from jdcloud_sdk.services.rds.apis.CreateBackupRequest import CreateBackupRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateBackupRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--backup-id'], dict(help="""(string) 备份ID """, dest='backupId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除RDS实例备份,仅允许删除用户生成的备份,系统自动备份不允许删除。 ''', + description=''' + 删除RDS实例备份,仅允许删除用户生成的备份,系统自动备份不允许删除。。 + + 示例: jdc rds delete-backup --backup-id xxx + ''', + ) + def delete_backup(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DeleteBackupRequest import DeleteBackupRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteBackupRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--backup-id'], dict(help="""(string) 备份ID """, dest='backupId', required=True)), + (['--file-name'], dict(help="""(string) 文件名称
- MySQL:不支持该参数
- SQL Server:必须输入该参数,指定该备份中需要获取下载链接的文件名称。备份中的文件名(不包括后缀)即为备份的数据库名。例如文件名为my_test_db.bak,表示该文件是my_test_db数据库的备份 """, dest='fileName', required=False)), + (['--url-expiration-second'], dict(help="""(string) 指定下载链接的过期时间,单位秒, 取值范围为 1 ~ 86400 秒;支持 SQL Server:缺省为 86400 秒。支持 MySQL, Percona, MariaDB:缺省为 300 秒。 """, dest='urlExpirationSecond', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取整个备份或备份中单个文件的下载链接。
- 当输入参数中有文件名时,获取该文件的下载链接。
- 输入参数中无文件名时,获取整个备份的下载链接。
由于备份机制的差异,使用该接口下载备份时,SQL Server必须输入文件名,每个文件逐一下载,不支持下载整个备份。SQL Server备份中的文件名(不包括后缀)即为备份的数据库名。例如文件名为my_test_db.bak,表示该文件是my_test_db数据库的备份。
MySQL可下载整个备份集,但不支持单个文件的下载。 ''', + description=''' + 获取整个备份或备份中单个文件的下载链接。
- 当输入参数中有文件名时,获取该文件的下载链接。
- 输入参数中无文件名时,获取整个备份的下载链接。
由于备份机制的差异,使用该接口下载备份时,SQL Server必须输入文件名,每个文件逐一下载,不支持下载整个备份。SQL Server备份中的文件名(不包括后缀)即为备份的数据库名。例如文件名为my_test_db.bak,表示该文件是my_test_db数据库的备份。
MySQL可下载整个备份集,但不支持单个文件的下载。。 + + 示例: jdc rds describe-backup-download-url --backup-id xxx + ''', + ) + def describe_backup_download_url(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DescribeBackupDownloadURLRequest import DescribeBackupDownloadURLRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeBackupDownloadURLRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--db-name'], dict(help="""(string) 库名称 """, dest='dbName', required=True)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为100,取值范围:[10,100],用于查询列表的接口 """, dest='pageSize', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取当前实例的指定库的表列表信息 - 仅支持 MySQL,Percona,MariaDB ''', + description=''' + 获取当前实例的指定库的表列表信息 - 仅支持 MySQL,Percona,MariaDB。 + + 示例: jdc rds describe-tables --instance-id xxx --db-name xxx + ''', + ) + def describe_tables(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DescribeTablesRequest import DescribeTablesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeTablesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查看当前实例是否开启TDE ''', + description=''' + 查看当前实例是否开启TDE。 + + 示例: jdc rds describe-tde --instance-id xxx + ''', + ) + def describe_tde(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DescribeTdeRequest import DescribeTdeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeTdeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 开启数据库的TDE功能 ''', + description=''' + 开启数据库的TDE功能。 + + 示例: jdc rds enable-tde --instance-id xxx + ''', + ) + def enable_tde(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.EnableTdeRequest import EnableTdeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = EnableTdeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查看RDS实例当前白名单。白名单是允许访问当前实例的IP/IP段列表,缺省情况下,白名单对本VPC开放。如果用户开启了外网访问的功能,还需要对外网的IP配置白名单。 ''', + description=''' + 查看RDS实例当前白名单。白名单是允许访问当前实例的IP/IP段列表,缺省情况下,白名单对本VPC开放。如果用户开启了外网访问的功能,还需要对外网的IP配置白名单。。 + + 示例: jdc rds describe-white-list --instance-id xxx + ''', + ) + def describe_white_list(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DescribeWhiteListRequest import DescribeWhiteListRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeWhiteListRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--ips'], dict(help="""(string) IP或IP段,不同的IP/IP段之间用英文逗号分隔,例如0.0.0.0/0,192.168.0.10 """, dest='ips', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改允许访问实例的IP白名单。白名单是允许访问当前实例的IP/IP段列表,缺省情况下,白名单对本VPC开放。如果用户开启了外网访问的功能,还需要对外网的IP配置白名单。 ''', + description=''' + 修改允许访问实例的IP白名单。白名单是允许访问当前实例的IP/IP段列表,缺省情况下,白名单对本VPC开放。如果用户开启了外网访问的功能,还需要对外网的IP配置白名单。。 + + 示例: jdc rds modify-white-list --instance-id xxx --ips xxx + ''', + ) + def modify_white_list(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.ModifyWhiteListRequest import ModifyWhiteListRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyWhiteListRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查看当前实例已开启的审计选项。如当前实例未开启审计,则返回空
- 仅支持SQL Server ''', + description=''' + 查看当前实例已开启的审计选项。如当前实例未开启审计,则返回空
- 仅支持SQL Server。 + + 示例: jdc rds describe-audit --instance-id xxx + ''', + ) + def describe_audit(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DescribeAuditRequest import DescribeAuditRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAuditRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--enabled'], dict(help="""(string) 要开启的审计选项,各个选项之间用英文逗号或空格进行分割,例如:DATABASE_OBJECT_ACCESS_GROUP,ACKUP_RESTORE_GROU等
各个数据库版本支持的审计选项可以通过接口[describeAuditOptions](./describeAuditOptions.md)获得,各个审计项的具体含义可以参看微软的官方文档 """, dest='enabled', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 开启SQL Server的数据库审计功能,目前支持实例级的数据库审计。用户可以根据需要开启、关闭审计、自定义审计策略,并下载审计文件。审计文件为原生的SQL Server审计文件,缺省保存6个月。
- 仅支持SQL Server ''', + description=''' + 开启SQL Server的数据库审计功能,目前支持实例级的数据库审计。用户可以根据需要开启、关闭审计、自定义审计策略,并下载审计文件。审计文件为原生的SQL Server审计文件,缺省保存6个月。
- 仅支持SQL Server。 + + 示例: jdc rds create-audit --instance-id xxx --enabled xxx + ''', + ) + def create_audit(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.CreateAuditRequest import CreateAuditRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateAuditRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 关闭数据库审计。关闭数据库审计后,以前生成的审计结果文件并不会被立即删除。审计结果文件会过期后由系统自动删除,过期时间缺省为6个月
- 仅支持SQL Server ''', + description=''' + 关闭数据库审计。关闭数据库审计后,以前生成的审计结果文件并不会被立即删除。审计结果文件会过期后由系统自动删除,过期时间缺省为6个月
- 仅支持SQL Server。 + + 示例: jdc rds delete-audit --instance-id xxx + ''', + ) + def delete_audit(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DeleteAuditRequest import DeleteAuditRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteAuditRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--name'], dict(help="""(string) 审计选项类别,**大小写敏感**,目前支持两种类型:
(1)AuditOptions开头:在disalbed参数中返回SQL Server各个版本支持的所有选项,支持的名称为
AuditOptions2008R2
AuditOptions2012
AuditOptions2014
AuditOptions2016
例如输入参数为"AuditOptions2016",则在disabled字段中返回SQL Server 2016 版本所支持的所有的审计选项
(2)AuditDefault开头:京东云建议的默认选项,在enabled参数中返回建议开启的选项,在disabled参数中返回不开启的选项,支持的名称为:
AuditDefault2008R2
AuditDefault2012
AuditDefault2014
AuditDefault2016
例如输入参数为"AuditDefault2016",则在enabled字段返回SQL Server 2016 版本中京东云建议开启的审计选项,在disabled字段中返回建议不开启的选项 """, dest='name', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取当前系统所支持的各种数据库版本的审计选项及相应的推荐选项
- 仅支持SQL Server ''', + description=''' + 获取当前系统所支持的各种数据库版本的审计选项及相应的推荐选项
- 仅支持SQL Server。 + + 示例: jdc rds describe-audit-options --instance-id xxx --name xxx + ''', + ) + def describe_audit_options(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DescribeAuditOptionsRequest import DescribeAuditOptionsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAuditOptionsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--add'], dict(help="""(string) 在原有审计项基础上,增加新的审计项,多个审计项之间用英文逗号,分号或空格分隔,例如DATABASE_OBJECT_ACCESS_GROUP,ACKUP_RESTORE_GROUP """, dest='add', required=False)), + (['--drop'], dict(help="""(string) 删除审计项,多个审计项之间用英文逗号,分号或空格分隔,例如DATABASE_OBJECT_ACCESS_GROUP,ACKUP_RESTORE_GROUP
如删除了所有审计项,则审计自动关闭 """, dest='drop', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改当前的审计选项。当前已有审计选项可以通过describeAudit获得,支持的全部选项可以通过getAuditOptions获得。
- 仅支持SQL Server ''', + description=''' + 修改当前的审计选项。当前已有审计选项可以通过describeAudit获得,支持的全部选项可以通过getAuditOptions获得。
- 仅支持SQL Server。 + + 示例: jdc rds modify-audit --instance-id xxx + ''', + ) + def modify_audit(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.ModifyAuditRequest import ModifyAuditRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyAuditRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取当前实例下的所有审计结果文件的列表
- 仅支持SQL Server ''', + description=''' + 获取当前实例下的所有审计结果文件的列表
- 仅支持SQL Server。 + + 示例: jdc rds describe-audit-files --instance-id xxx + ''', + ) + def describe_audit_files(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DescribeAuditFilesRequest import DescribeAuditFilesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAuditFilesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--file-name'], dict(help="""(string) 审计文件名 """, dest='fileName', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取某个审计文件的下载链接,同时支持内链和外链,链接的有效时间为24小时
- 仅支持SQL Server ''', + description=''' + 获取某个审计文件的下载链接,同时支持内链和外链,链接的有效时间为24小时
- 仅支持SQL Server。 + + 示例: jdc rds describe-audit-download-url --instance-id xxx --file-name xxx + ''', + ) + def describe_audit_download_url(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DescribeAuditDownloadURLRequest import DescribeAuditDownloadURLRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAuditDownloadURLRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 仅支持MySQL实例开启数据库审计
- 仅支持 MySQL 5.6, MySQL 5.7, Percona, MariaDB, PostgreSQL ''', + description=''' + 仅支持MySQL实例开启数据库审计
- 仅支持 MySQL 5.6, MySQL 5.7, Percona, MariaDB, PostgreSQL。 + + 示例: jdc rds enable-audit --instance-id xxx + ''', + ) + def enable_audit(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.EnableAuditRequest import EnableAuditRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = EnableAuditRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 仅支持MySQL实例关闭数据库审计
- 仅支持 MySQL 5.6, MySQL 5.7, Percona, MariaDB, PostgreSQL ''', + description=''' + 仅支持MySQL实例关闭数据库审计
- 仅支持 MySQL 5.6, MySQL 5.7, Percona, MariaDB, PostgreSQL。 + + 示例: jdc rds disable-audit --instance-id xxx + ''', + ) + def disable_audit(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DisableAuditRequest import DisableAuditRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DisableAuditRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--start-time'], dict(help="""(string) 查询开始时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间不能早于当前时间30天 """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 查询截止时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到结束时间不能超过3天 """, dest='endTime', required=True)), + (['--db-name'], dict(help="""(string) 数据库名 """, dest='dbName', required=False)), + (['--account-name'], dict(help="""(string) 账号名 """, dest='accountName', required=False)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、50 """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) 过滤参数,多个过滤参数之间的关系为“与”(and); 支持以下属性的过滤:; operation; """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 仅支持查看MySQL实例的审计内容
- 仅支持 MySQL 5.6, MySQL 5.7, Percona, MariaDB, PostgreSQL ''', + description=''' + 仅支持查看MySQL实例的审计内容
- 仅支持 MySQL 5.6, MySQL 5.7, Percona, MariaDB, PostgreSQL。 + + 示例: jdc rds describe-audit-result --instance-id xxx --start-time xxx --end-time xxx + ''', + ) + def describe_audit_result(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DescribeAuditResultRequest import DescribeAuditResultRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAuditResultRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--engine'], dict(help="""(string) RDS引擎类型,参见[枚举参数定义](../Enum-Definitions/Enum-Definitions.md) """, dest='engine', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查看指定地域下各种RDS数据库支持的可用区,不同类型的RDS支持的可用区不一样 ''', + description=''' + 查看指定地域下各种RDS数据库支持的可用区,不同类型的RDS支持的可用区不一样。 + + 示例: jdc rds describe-azs --engine xxx + ''', + ) + def describe_azs(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.DescribeAzsRequest import DescribeAzsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAzsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--database'], dict(help="""(string) DDL命令修改的库名 """, dest='database', required=True)), + (['--table'], dict(help="""(string) DDL命令修改的表名 """, dest='table', required=True)), + (['--command'], dict(help="""(string) 需要执行的的DDL命令 """, dest='command', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 通过 PT-OSC 服务来处理 DDL 命令, 避免锁表。此接口暂是对部分用户开放 ''', + description=''' + 通过 PT-OSC 服务来处理 DDL 命令, 避免锁表。此接口暂是对部分用户开放。 + + 示例: jdc rds alter-table-with-online-ddl --instance-id xxx --database xxx --table xxx --command xxx + ''', + ) + def alter_table_with_online_ddl(self): + client_factory = ClientFactory('rds') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.rds.apis.AlterTableWithOnlineDDLRequest import AlterTableWithOnlineDDLRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyParameterGroupParametersRequest(params_dict, headers) + req = AlterTableWithOnlineDDLRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2898,33 +3765,30 @@ def modify_parameter_group_parameters(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--parameter-group-id'], dict(help="""(string) Parameter Group ID """, dest='parameterGroupId', required=True)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:[10,100],且为10的整数倍 """, dest='pageSize', type=int, required=False)), - (['--start-time'], dict(help="""(string) 查询开始时间,格式为:YYYY-MM-DD HH:mm:ss """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 查询结束时间,格式为:YYYY-MM-DD HH:mm:ss """, dest='endTime', required=False)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看参数的修改历史
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', + help=''' 查看SQL Server实例的配置参数
- 仅支持SQL Server ''', description=''' - 查看参数的修改历史
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 + 查看SQL Server实例的配置参数
- 仅支持SQL Server。 - 示例: jdc rds describe-parameter-modify-records --parameter-group-id xxx + 示例: jdc rds describe-parameters --instance-id xxx ''', ) - def describe_parameter_modify_records(self): + def describe_parameters(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeParameterModifyRecordsRequest import DescribeParameterModifyRecordsRequest + from jdcloud_sdk.services.rds.apis.DescribeParametersRequest import DescribeParametersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeParameterModifyRecordsRequest(params_dict, headers) + req = DescribeParametersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2935,31 +3799,31 @@ def describe_parameter_modify_records(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--parameter-group-id'], dict(help="""(string) 参数组ID """, dest='parameterGroupId', required=True)), - (['--parameter-group-name'], dict(help="""(string) 参数组的名字 """, dest='parameterGroupName', required=True)), - (['--description'], dict(help="""(string) 参数组的描述 """, dest='description', required=False)), + (['--instance-id'], dict(help="""(string) Instance ID """, dest='instanceId', required=True)), + (['--parameters'], dict(help="""(array: parameter) 修改的实例参数 """, dest='parameters', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 拷贝参数组 ''', + help=''' 修改SQL Server实例的配置参数,目前支持以下参数:max_worker_threads,max_degree_of_parallelism,max_server_memory_(MB)。 部分参数修改后,需要重启才能生效,具体可以参考微软的相关文档。
- 仅支持SQL Server ''', description=''' - 拷贝参数组。 + 修改SQL Server实例的配置参数,目前支持以下参数:max_worker_threads,max_degree_of_parallelism,max_server_memory_(MB)。 部分参数修改后,需要重启才能生效,具体可以参考微软的相关文档。
- 仅支持SQL Server。 - 示例: jdc rds copy-parameter-group --parameter-group-id xxx --parameter-group-name xxx + 示例: jdc rds modify-parameters --instance-id xxx --parameters ['{"":""}'] ''', ) - def copy_parameter_group(self): + def modify_parameters(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.CopyParameterGroupRequest import CopyParameterGroupRequest + from jdcloud_sdk.services.rds.apis.ModifyParametersRequest import ModifyParametersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CopyParameterGroupRequest(params_dict, headers) + req = ModifyParametersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2969,32 +3833,32 @@ def copy_parameter_group(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--parameter-group-id'], dict(help="""(string) Parameter Group ID """, dest='parameterGroupId', required=True)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:[10,100],且为10的整数倍 """, dest='pageSize', type=int, required=False)), + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[1,∞),页码超过总页数时,显示最后一页,用于查询列表的接口 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、30、50、100 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看参数组绑定的云数据库实例
- 仅支持MySQL,Percona,MariaDB,PostgreSQL ''', + help=''' 查询跨地域备份同步服务列表。 ''', description=''' - 查看参数组绑定的云数据库实例
- 仅支持MySQL,Percona,MariaDB,PostgreSQL。 + 查询跨地域备份同步服务列表。。 - 示例: jdc rds describe-parameter-group-attached-instances --parameter-group-id xxx + 示例: jdc rds describe-backup-synchronicities ''', ) - def describe_parameter_group_attached_instances(self): + def describe_backup_synchronicities(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeParameterGroupAttachedInstancesRequest import DescribeParameterGroupAttachedInstancesRequest + from jdcloud_sdk.services.rds.apis.DescribeBackupSynchronicitiesRequest import DescribeBackupSynchronicitiesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeParameterGroupAttachedInstancesRequest(params_dict, headers) + req = DescribeBackupSynchronicitiesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3005,33 +3869,31 @@ def describe_parameter_group_attached_instances(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--query-type'], dict(help="""(string) 查询类型,不同的查询类型按照相应的字段从高到低返回结果。
支持如下类型:
Missing:缺失索引
Size:索引大小,单位KB
Updates:索引更新次数
Scans:表扫描次数
Used:最少使用
""", dest='queryType', required=True)), - (['--db'], dict(help="""(string) 需要查询的数据库名,多个数据库名之间用英文逗号分隔,默认所有数据库 """, dest='db', required=False)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,1000)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为50,取值范围:[1,100],只能为10的倍数,用于查询列表的接口 """, dest='pageSize', type=int, required=False)), + (['--instance-id'], dict(help="""(string) 源实例ID """, dest='instanceId', required=True)), + (['--dest-region'], dict(help="""(string) 备份同步的目标地域 """, dest='destRegion', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据用户定义的查询条件,获取索引性能的统计信息,并提供缺失索引及索引创建建议。用户可以根据这些信息查找与索引相关的性能瓶颈,并进行优化。
- 仅支持SQL Server ''', + help=''' 创建一个跨地域备份同步服务。 ''', description=''' - 根据用户定义的查询条件,获取索引性能的统计信息,并提供缺失索引及索引创建建议。用户可以根据这些信息查找与索引相关的性能瓶颈,并进行优化。
- 仅支持SQL Server。 + 创建一个跨地域备份同步服务。。 - 示例: jdc rds describe-index-performance --instance-id xxx --query-type xxx + 示例: jdc rds create-backup-synchronicity --instance-id xxx --dest-region xxx ''', ) - def describe_index_performance(self): + def create_backup_synchronicity(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeIndexPerformanceRequest import DescribeIndexPerformanceRequest + from jdcloud_sdk.services.rds.apis.CreateBackupSynchronicityRequest import CreateBackupSynchronicityRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeIndexPerformanceRequest(params_dict, headers) + req = CreateBackupSynchronicityRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3042,33 +3904,30 @@ def describe_index_performance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--query-type'], dict(help="""(string) 查询类型,不同的查询类型按照相应的字段从高到低返回结果。
支持如下类型:
ExecutionCount:执行次数
LastRows:上次返回行数
ElapsedTime:平均执行时间
CPUTime:平均CPU时间
LogicalReads:平均逻辑读
LogicalWrites:平均逻辑写
PhysicalReads:平均物理读
""", dest='queryType', required=True)), - (['--threshold'], dict(help="""(int) 只返回查询条件大于等于threshold的记录,默认为0 """, dest='threshold', type=int, required=False)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,1000]。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为50,取值范围:[1,100],只能为10的倍数,用于查询列表的接口 """, dest='pageSize', type=int, required=False)), + (['--service-id'], dict(help="""(string) 跨地域备份同步服务ID """, dest='serviceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据用户定义的查询条件,获取SQL执行的性能统计信息,例如慢SQL等。用户可以根据这些信息查找与SQL执行相关的性能瓶颈,并进行优化。
- 仅支持SQL Server ''', + help=''' 删除一个跨地域备份同步服务。 ''', description=''' - 根据用户定义的查询条件,获取SQL执行的性能统计信息,例如慢SQL等。用户可以根据这些信息查找与SQL执行相关的性能瓶颈,并进行优化。
- 仅支持SQL Server。 + 删除一个跨地域备份同步服务。。 - 示例: jdc rds describe-query-performance --instance-id xxx --query-type xxx + 示例: jdc rds delete-backup-synchronicity --service-id xxx ''', ) - def describe_query_performance(self): + def delete_backup_synchronicity(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeQueryPerformanceRequest import DescribeQueryPerformanceRequest + from jdcloud_sdk.services.rds.apis.DeleteBackupSynchronicityRequest import DeleteBackupSynchronicityRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeQueryPerformanceRequest(params_dict, headers) + req = DeleteBackupSynchronicityRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3079,34 +3938,32 @@ def describe_query_performance(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--start-time'], dict(help="""(string) 慢日志开始时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到当前时间不能大于 7 天, 开始时间不能大于结束时间,结束时间不能大于当前时间 """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 慢日志结束时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到当前时间不能大于 7 天, 开始时间不能大于结束时间,结束时间不能大于当前时间 """, dest='endTime', required=True)), - (['--db-name'], dict(help="""(string) 查询哪个数据库的慢日志,不填表示返回所有数据库的慢日志 """, dest='dbName', required=False)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,1000)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、30、50、100 """, dest='pageSize', type=int, required=False)), + (['--restore-time'], dict(help="""(string) 根据源实例的哪个时间点创建新实例 """, dest='restoreTime', required=True)), + (['--service-id'], dict(help="""(string) 跨地域备份同步服务ID """, dest='serviceId', required=True)), + (['--instance-spec'], dict(help="""(restoredNewDBInstanceSpec) 新建实例规格 """, dest='instanceSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询MySQL实例的慢日志的详细信息。
- 仅支持MySQL ''', + help=''' 根据跨地域备份同步服务时间点创建实例。 ''', description=''' - 查询MySQL实例的慢日志的详细信息。
- 仅支持MySQL。 + 根据跨地域备份同步服务时间点创建实例。。 - 示例: jdc rds describe-slow-log-attributes --instance-id xxx --start-time xxx --end-time xxx + 示例: jdc rds create-instance-by-time-in-cross-region --restore-time xxx --service-id xxx --instance-spec '{"":""}' ''', ) - def describe_slow_log_attributes(self): + def create_instance_by_time_in_cross_region(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeSlowLogAttributesRequest import DescribeSlowLogAttributesRequest + from jdcloud_sdk.services.rds.apis.CreateInstanceByTimeInCrossRegionRequest import CreateInstanceByTimeInCrossRegionRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSlowLogAttributesRequest(params_dict, headers) + req = CreateInstanceByTimeInCrossRegionRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3118,33 +3975,29 @@ def describe_slow_log_attributes(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--start-time'], dict(help="""(string) 慢日志开始时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到当前时间不能大于 7 天,开始时间不能大于结束时间,结束时间不能大于当前时间 """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 慢日志结束时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到当前时间不能大于 7 天,开始时间不能大于结束时间,结束时间不能大于当前时间 """, dest='endTime', required=True)), - (['--db-name'], dict(help="""(string) 查询哪个数据库的慢日志,不填表示返回所有数据库的慢日志 """, dest='dbName', required=False)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,1000)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、30、50、100 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询MySQL实例的慢日志的概要信息。
- 仅支持MySQL ''', + help=''' 获取SQL Server 错误日志及下载信息
- 仅支持SQL Server ''', description=''' - 查询MySQL实例的慢日志的概要信息。
- 仅支持MySQL。 + 获取SQL Server 错误日志及下载信息
- 仅支持SQL Server。 - 示例: jdc rds describe-slow-logs --instance-id xxx --start-time xxx --end-time xxx + 示例: jdc rds describe-error-logs --instance-id xxx ''', ) - def describe_slow_logs(self): + def describe_error_logs(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeSlowLogsRequest import DescribeSlowLogsRequest + from jdcloud_sdk.services.rds.apis.DescribeErrorLogsRequest import DescribeErrorLogsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSlowLogsRequest(params_dict, headers) + req = DescribeErrorLogsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3155,33 +4008,32 @@ def describe_slow_logs(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--db'], dict(help="""(string) 需要查询的数据库名,多个数据库名之间用英文逗号分隔,默认所有数据库 """, dest='db', required=False)), - (['--threshold'], dict(help="""(int) 返回执行时间大于等于threshold的记录,默认10,单位秒 """, dest='threshold', type=int, required=False)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,1000)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为50,取值范围:[1,100],只能为10的倍数 """, dest='pageSize', type=int, required=False)), + (['--engine'], dict(help="""(string) 设置可见的引擎类型,如 MySQL 等 """, dest='engine', required=True)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=False)), + (['--all-admin-privileges'], dict(help="""(bool) true表示展示高权限,默认false """, dest='allAdminPrivileges', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 根据用户定义的查询条件,获取正在执行中的SQL执行的性能信息。用户可以根据这些信息查找与SQL执行相关的性能瓶颈,并进行优化。
- 仅支持SQL Server ''', + help=''' 查看云数据库 RDS 的权限信息 - 仅支持 MySQL,Percona,MariaDB ''', description=''' - 根据用户定义的查询条件,获取正在执行中的SQL执行的性能信息。用户可以根据这些信息查找与SQL执行相关的性能瓶颈,并进行优化。
- 仅支持SQL Server。 + 查看云数据库 RDS 的权限信息 - 仅支持 MySQL,Percona,MariaDB。 - 示例: jdc rds describe-active-query-performance --instance-id xxx + 示例: jdc rds describe-privilege --engine xxx ''', ) - def describe_active_query_performance(self): + def describe_privilege(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeActiveQueryPerformanceRequest import DescribeActiveQueryPerformanceRequest + from jdcloud_sdk.services.rds.apis.DescribePrivilegeRequest import DescribePrivilegeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeActiveQueryPerformanceRequest(params_dict, headers) + req = DescribePrivilegeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3193,33 +4045,33 @@ def describe_active_query_performance(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--start-time'], dict(help="""(string) 慢日志开始时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到当前时间不能大于 7 天,开始时间不能大于结束时间,结束时间不能大于当前时间 """, dest='startTime', required=True)), - (['--end-time'], dict(help="""(string) 慢日志结束时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到当前时间不能大于 7 天,开始时间不能大于结束时间,结束时间不能大于当前时间 """, dest='endTime', required=True)), - (['--db-name'], dict(help="""(string) 查询哪个数据库的慢日志,不填表示返回所有数据库的慢日志 """, dest='dbName', required=False)), + (['--query-type'], dict(help="""(string) 查询类型,不同的查询类型按照相应的字段从高到低返回结果。
支持如下类型:
Missing:缺失索引
Size:索引大小,单位KB
Updates:索引更新次数
Scans:表扫描次数
Used:最少使用
""", dest='queryType', required=True)), + (['--db'], dict(help="""(string) 需要查询的数据库名,多个数据库名之间用英文逗号分隔,默认所有数据库 """, dest='db', required=False)), (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,1000)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、30、50、100 """, dest='pageSize', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为50,取值范围:[1,100],只能为10的倍数,用于查询列表的接口 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询PostgreSQL实例的错误日志的概要信息。
- 仅支持PostgreSQL ''', + help=''' 根据用户定义的查询条件,获取索引性能的统计信息,并提供缺失索引及索引创建建议。用户可以根据这些信息查找与索引相关的性能瓶颈,并进行优化。
- 仅支持SQL Server ''', description=''' - 查询PostgreSQL实例的错误日志的概要信息。
- 仅支持PostgreSQL。 + 根据用户定义的查询条件,获取索引性能的统计信息,并提供缺失索引及索引创建建议。用户可以根据这些信息查找与索引相关的性能瓶颈,并进行优化。
- 仅支持SQL Server。 - 示例: jdc rds describe-error-log --instance-id xxx --start-time xxx --end-time xxx + 示例: jdc rds describe-index-performance --instance-id xxx --query-type xxx ''', ) - def describe_error_log(self): + def describe_index_performance(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeErrorLogRequest import DescribeErrorLogRequest + from jdcloud_sdk.services.rds.apis.DescribeIndexPerformanceRequest import DescribeIndexPerformanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeErrorLogRequest(params_dict, headers) + req = DescribeIndexPerformanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3231,31 +4083,33 @@ def describe_error_log(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--db-name'], dict(help="""(string) 库名称 """, dest='dbName', required=True)), - (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为100,取值范围:[10,100],用于查询列表的接口 """, dest='pageSize', type=int, required=False)), + (['--query-type'], dict(help="""(string) 查询类型,不同的查询类型按照相应的字段从高到低返回结果。
支持如下类型:
ExecutionCount:执行次数
LastRows:上次返回行数
ElapsedTime:平均执行时间
CPUTime:平均CPU时间
LogicalReads:平均逻辑读
LogicalWrites:平均逻辑写
PhysicalReads:平均物理读
""", dest='queryType', required=True)), + (['--threshold'], dict(help="""(int) 只返回查询条件大于等于threshold的记录,默认为0 """, dest='threshold', type=int, required=False)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,1000]。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为50,取值范围:[1,100],只能为10的倍数,用于查询列表的接口 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取当前实例的指定库的表列表信息 - 仅支持 MySQL,Percona,MariaDB ''', + help=''' 根据用户定义的查询条件,获取SQL执行的性能统计信息,例如慢SQL等。用户可以根据这些信息查找与SQL执行相关的性能瓶颈,并进行优化。
- 仅支持SQL Server ''', description=''' - 获取当前实例的指定库的表列表信息 - 仅支持 MySQL,Percona,MariaDB。 + 根据用户定义的查询条件,获取SQL执行的性能统计信息,例如慢SQL等。用户可以根据这些信息查找与SQL执行相关的性能瓶颈,并进行优化。
- 仅支持SQL Server。 - 示例: jdc rds describe-tables --instance-id xxx --db-name xxx + 示例: jdc rds describe-query-performance --instance-id xxx --query-type xxx ''', ) - def describe_tables(self): + def describe_query_performance(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeTablesRequest import DescribeTablesRequest + from jdcloud_sdk.services.rds.apis.DescribeQueryPerformanceRequest import DescribeQueryPerformanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeTablesRequest(params_dict, headers) + req = DescribeQueryPerformanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3267,28 +4121,36 @@ def describe_tables(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--start-time'], dict(help="""(string) 慢日志开始时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到当前时间不能大于 7 天, 开始时间不能大于结束时间,结束时间不能大于当前时间 """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 慢日志结束时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到当前时间不能大于 7 天, 开始时间不能大于结束时间,结束时间不能大于当前时间 """, dest='endTime', required=True)), + (['--db-name'], dict(help="""(string) 查询哪个数据库的慢日志,不填表示返回所有数据库的慢日志 """, dest='dbName', required=False)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,1000)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、30、50、100 """, dest='pageSize', type=int, required=False)), + (['--sorts'], dict(help="""(array: sort) 慢日志明细的排序规则,不指定时按上报日志的时间戳降序返回所有的日志 """, dest='sorts', required=False)), + (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看当前实例是否开启TDE ''', + help=''' 查询MySQL实例的慢日志的详细信息。
- 仅支持MySQL ''', description=''' - 查看当前实例是否开启TDE。 + 查询MySQL实例的慢日志的详细信息。
- 仅支持MySQL。 - 示例: jdc rds describe-tde --instance-id xxx + 示例: jdc rds describe-slow-log-attributes --instance-id xxx --start-time xxx --end-time xxx ''', ) - def describe_tde(self): + def describe_slow_log_attributes(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeTdeRequest import DescribeTdeRequest + from jdcloud_sdk.services.rds.apis.DescribeSlowLogAttributesRequest import DescribeSlowLogAttributesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeTdeRequest(params_dict, headers) + req = DescribeSlowLogAttributesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3300,28 +4162,36 @@ def describe_tde(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--start-time'], dict(help="""(string) 慢日志开始时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到当前时间不能大于 7 天,开始时间不能大于结束时间,结束时间不能大于当前时间 """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 慢日志结束时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到当前时间不能大于 7 天,开始时间不能大于结束时间,结束时间不能大于当前时间 """, dest='endTime', required=True)), + (['--db-name'], dict(help="""(string) 查询哪个数据库的慢日志,不填表示返回所有数据库的慢日志 """, dest='dbName', required=False)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,1000)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、30、50、100 """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), + (['--sorts'], dict(help="""(array: sort) 排序参数,支持rowsExaminedSum、rowsSentSum、lockTimeSum、executionCount、executionTimeSum """, dest='sorts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 开启数据库的TDE功能 ''', + help=''' 查询MySQL实例的慢日志的概要信息。
- 仅支持MySQL ''', description=''' - 开启数据库的TDE功能。 + 查询MySQL实例的慢日志的概要信息。
- 仅支持MySQL。 - 示例: jdc rds enable-tde --instance-id xxx + 示例: jdc rds describe-slow-logs --instance-id xxx --start-time xxx --end-time xxx ''', ) - def enable_tde(self): + def describe_slow_logs(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.EnableTdeRequest import EnableTdeRequest + from jdcloud_sdk.services.rds.apis.DescribeSlowLogsRequest import DescribeSlowLogsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = EnableTdeRequest(params_dict, headers) + req = DescribeSlowLogsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3333,28 +4203,33 @@ def enable_tde(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--db'], dict(help="""(string) 需要查询的数据库名,多个数据库名之间用英文逗号分隔,默认所有数据库 """, dest='db', required=False)), + (['--threshold'], dict(help="""(int) 返回执行时间大于等于threshold的记录,默认10,单位秒 """, dest='threshold', type=int, required=False)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,1000)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为50,取值范围:[1,100],只能为10的倍数 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查看RDS实例当前白名单。白名单是允许访问当前实例的IP/IP段列表,缺省情况下,白名单对本VPC开放。如果用户开启了外网访问的功能,还需要对外网的IP配置白名单。 ''', + help=''' 根据用户定义的查询条件,获取正在执行中的SQL执行的性能信息。用户可以根据这些信息查找与SQL执行相关的性能瓶颈,并进行优化。
- 仅支持SQL Server ''', description=''' - 查看RDS实例当前白名单。白名单是允许访问当前实例的IP/IP段列表,缺省情况下,白名单对本VPC开放。如果用户开启了外网访问的功能,还需要对外网的IP配置白名单。。 + 根据用户定义的查询条件,获取正在执行中的SQL执行的性能信息。用户可以根据这些信息查找与SQL执行相关的性能瓶颈,并进行优化。
- 仅支持SQL Server。 - 示例: jdc rds describe-white-list --instance-id xxx + 示例: jdc rds describe-active-query-performance --instance-id xxx ''', ) - def describe_white_list(self): + def describe_active_query_performance(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.DescribeWhiteListRequest import DescribeWhiteListRequest + from jdcloud_sdk.services.rds.apis.DescribeActiveQueryPerformanceRequest import DescribeActiveQueryPerformanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeWhiteListRequest(params_dict, headers) + req = DescribeActiveQueryPerformanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3366,29 +4241,34 @@ def describe_white_list(self): arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), - (['--ips'], dict(help="""(string) IP或IP段,不同的IP/IP段之间用英文逗号分隔,例如0.0.0.0/0,192.168.0.10 """, dest='ips', required=True)), + (['--start-time'], dict(help="""(string) 慢日志开始时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到当前时间不能大于 7 天,开始时间不能大于结束时间,结束时间不能大于当前时间 """, dest='startTime', required=True)), + (['--end-time'], dict(help="""(string) 慢日志结束时间,格式为:YYYY-MM-DD HH:mm:ss,开始时间到当前时间不能大于 7 天,开始时间不能大于结束时间,结束时间不能大于当前时间 """, dest='endTime', required=True)), + (['--db-name'], dict(help="""(string) 查询哪个数据库的慢日志,不填表示返回所有数据库的慢日志 """, dest='dbName', required=False)), + (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,1000)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为10,取值范围:10、20、30、50、100 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改允许访问实例的IP白名单。白名单是允许访问当前实例的IP/IP段列表,缺省情况下,白名单对本VPC开放。如果用户开启了外网访问的功能,还需要对外网的IP配置白名单。 ''', + help=''' 查询PostgreSQL实例的错误日志的概要信息。
- 仅支持PostgreSQL ''', description=''' - 修改允许访问实例的IP白名单。白名单是允许访问当前实例的IP/IP段列表,缺省情况下,白名单对本VPC开放。如果用户开启了外网访问的功能,还需要对外网的IP配置白名单。。 + 查询PostgreSQL实例的错误日志的概要信息。
- 仅支持PostgreSQL。 - 示例: jdc rds modify-white-list --instance-id xxx --ips xxx + 示例: jdc rds describe-error-log --instance-id xxx --start-time xxx --end-time xxx ''', ) - def modify_white_list(self): + def describe_error_log(self): client_factory = ClientFactory('rds') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.rds.apis.ModifyWhiteListRequest import ModifyWhiteListRequest + from jdcloud_sdk.services.rds.apis.DescribeErrorLogRequest import DescribeErrorLogRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyWhiteListRequest(params_dict, headers) + req = DescribeErrorLogRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -3398,7 +4278,7 @@ def modify_white_list(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-accounts','create-account','describe-account-privilege','delete-account','grant-privilege','revoke-privilege','reset-password','create-super-account','grant-account-privilege','describe-audit','create-audit','delete-audit','describe-audit-options','modify-audit','describe-audit-files','describe-audit-download-url','enable-audit','disable-audit','describe-audit-result','describe-azs','describe-backups','create-backup','delete-backup','describe-backup-download-url','describe-backup-synchronicities','create-backup-synchronicity','delete-backup-synchronicity','create-instance-by-time-in-cross-region','describe-binlogs','describe-binlog-download-url','clear-binlogs','alter-table-with-online-ddl','describe-privilege','describe-databases','create-database','delete-database','restore-database-from-backup','restore-database-from-file','restore-database-from-oss','describe-error-logs','describe-import-files','get-upload-key','set-import-file-shared','delete-import-file','describe-instances','create-instance','describe-instance-attributes','delete-instance','describe-backup-policy','modify-backup-policy','modify-instance-name','failover-instance','reboot-instance','enable-internet-access','disable-internet-access','restore-instance','create-instance-from-backup','modify-instance-spec','create-instance-by-time','create-roinstance','modify-connection-mode','describe-latest-restore-time','modify-parameter-group','exchange-instance-dns','modify-instance-az','describe-ssl','enable-ssl','restore-instance-by-time','enable-intercept','disable-intercept','describe-intercept-result','describe-intercept','describe-logs','update-log-download-urlinternal','describe-log-download-url','describe-parameters','modify-parameters','delete-parameter-group','modify-parameter-group-attribute','describe-parameter-groups','create-parameter-group','describe-parameter-group-parameters','modify-parameter-group-parameters','describe-parameter-modify-records','copy-parameter-group','describe-parameter-group-attached-instances','describe-index-performance','describe-query-performance','describe-slow-log-attributes','describe-slow-logs','describe-active-query-performance','describe-error-log','describe-tables','describe-tde','enable-tde','describe-white-list','modify-white-list',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-binlogs','describe-binlog-download-url','clear-binlogs','describe-accounts','create-account','describe-account-privilege','delete-account','grant-privilege','revoke-privilege','reset-password','create-super-account','grant-account-privilege','describe-accounts-for-ops','create-account-for-ops','modify-account-for-ops','describe-instances','create-instance','describe-instance-attributes','delete-instance','describe-backup-policy','modify-backup-policy','enable-enhanced-backup','describe-backup-space','describe-backup-charge','modify-instance-name','failover-instance','reboot-instance','enable-internet-access','disable-internet-access','restore-instance','create-instance-from-backup','modify-instance-spec','create-instance-by-time','create-roinstance','modify-connection-mode','describe-latest-restore-time','modify-parameter-group','exchange-instance-dns','modify-instance-az','describe-ssl','enable-ssl','disable-ssl','restore-instance-by-time','modify-active-directory','modify-instance-maintain-time','describe-instance-maintain-time','switch-for-modifying-instance-spec','describe-upgrade-versions','describe-upgrade-plan','upgrade-engine-version','describe-import-files','get-upload-key','set-import-file-shared','delete-import-file','describe-logs','update-log-download-urlinternal','describe-log-download-url','describe-databases','create-database','delete-database','restore-database-from-backup','restore-database-from-file','restore-database-from-oss','modify-database-comment','enable-intercept','disable-intercept','describe-intercept-result','describe-intercept','describe-read-write-proxies','create-read-write-proxy','describe-read-write-proxy-attribute','delete-read-write-proxy','enable-read-write-proxy-internet-access','disable-read-write-proxy-internet-access','modify-read-write-proxy','delete-parameter-group','modify-parameter-group-attribute','describe-parameter-groups','create-parameter-group','describe-parameter-group-parameters','modify-parameter-group-parameters','describe-parameter-modify-records','copy-parameter-group','describe-parameter-group-attached-instances','describe-backups','create-backup','delete-backup','describe-backup-download-url','describe-tables','describe-tde','enable-tde','describe-white-list','modify-white-list','describe-audit','create-audit','delete-audit','describe-audit-options','modify-audit','describe-audit-files','describe-audit-download-url','enable-audit','disable-audit','describe-audit-result','describe-azs','alter-table-with-online-ddl','describe-parameters','modify-parameters','describe-backup-synchronicities','create-backup-synchronicity','delete-backup-synchronicity','create-instance-by-time-in-cross-region','describe-error-logs','describe-privilege','describe-index-performance','describe-query-performance','describe-slow-log-attributes','describe-slow-logs','describe-active-query-performance','describe-error-log',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/redis.py b/jdcloud_cli/controllers/services/redis.py index 386418d..d9a95f1 100644 --- a/jdcloud_cli/controllers/services/redis.py +++ b/jdcloud_cli/controllers/services/redis.py @@ -36,6 +36,105 @@ class Meta: stacked_on = 'base' stacked_type = 'nested' + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询缓存Redis实例的规格配置信息 ''', + description=''' + 查询缓存Redis实例的规格配置信息。 + + 示例: jdc redis describe-spec-config + ''', + ) + def describe_spec_config(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeSpecConfigRequest import DescribeSpecConfigRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeSpecConfigRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询支持的规格列表 ''', + description=''' + 查询支持的规格列表。 + + 示例: jdc redis describe-available-resource + ''', + ) + def describe_available_resource(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeAvailableResourceRequest import DescribeAvailableResourceRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAvailableResourceRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询支持的规格列表 ''', + description=''' + 查询支持的规格列表。 + + 示例: jdc redis describe-available-resource2 + ''', + ) + def describe_available_resource2(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeAvailableResource2Request import DescribeAvailableResource2Request + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAvailableResource2Request(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), @@ -44,7 +143,9 @@ class Meta: (['--filters'], dict(help="""(array: filter) 过滤属性:; cacheInstanceId - 实例Id,精确匹配,可选择多个; cacheInstanceName - 实例名称,模糊匹配; cacheInstanceStatus - 实例状态,精确匹配,可选择多个(running:运行中,error:错误,creating:创建中,changing:变配中,configuring:参数修改中,restoring:备份恢复中,deleting:删除中); redisVersion - redis引擎版本,精确匹配,可选择2.8和4.0; instanceType - 实例类型,精确匹配(redis表示主从版,redis_cluster表示集群版); chargeMode - 计费类型,精确匹配(prepaid_by_duration表示包年包月预付费,postpaid_by_duration表示按配置后付费); """, dest='filters', required=False)), (['--sorts'], dict(help="""(array: sort) 排序属性:; createTime - 按创建时间排序(asc表示按时间正序,desc表示按时间倒序); """, dest='sorts', required=False)), (['--tag-filters'], dict(help="""(array: tagFilter) 标签的过滤条件 """, dest='tagFilters', required=False)), + (['--resource-group-ids'], dict(help="""(array: string) NA """, dest='resourceGroupIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -79,6 +180,7 @@ def describe_cache_instances(self): (['--cache-instance'], dict(help="""(cacheInstanceSpec) 实例的创建参数 """, dest='cacheInstance', required=True)), (['--charge'], dict(help="""(chargeSpec) 实例的计费类型 """, dest='charge', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -112,6 +214,7 @@ def create_cache_instance(self): (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -147,6 +250,7 @@ def describe_cache_instance(self): (['--cache-instance-name'], dict(help="""(string) 实例的名称,名称只支持数字、字母、英文下划线、中文,且不少于2字符不超过32字符 """, dest='cacheInstanceName', required=False)), (['--cache-instance-description'], dict(help="""(string) 实例的描述,不能超过256个字符 """, dest='cacheInstanceDescription', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -180,6 +284,7 @@ def modify_cache_instance_attribute(self): (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -215,6 +320,7 @@ def delete_cache_instance(self): (['--cache-instance-class'], dict(help="""(string) 新规格 """, dest='cacheInstanceClass', required=True)), (['--shard-number'], dict(help="""(int) 自定义分片数,只对自定义分片规格实例有效 """, dest='shardNumber', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -249,6 +355,7 @@ def modify_cache_instance_class(self): (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--password'], dict(help="""(string) 密码,为空即为免密,不少于8字符不超过16字符 """, dest='password', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -282,6 +389,7 @@ def reset_cache_instance_password(self): (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -316,6 +424,7 @@ def describe_instance_config(self): (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--instance-config'], dict(help="""(array: configItem) 配置参数名和参数值 """, dest='instanceConfig', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -349,6 +458,7 @@ def modify_instance_config(self): (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -383,6 +493,7 @@ def describe_analysis_time(self): (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--analysis-time'], dict(help="""(string) 自动缓存分析时间,设置为-表示关闭,否则为:HH:mm-HH:mm 时区,例如"01:00-02:00 +0800",表示东八区的1点到2点 """, dest='analysisTime', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -417,6 +528,7 @@ def modify_analysis_time(self): (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--date'], dict(help="""(string) 格式:yyyy-MM-dd,表示查询某一天的缓存分析列表 """, dest='date', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -450,6 +562,7 @@ def describe_cache_analysis_list(self): (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -482,8 +595,9 @@ def create_cache_analysis(self): arguments=[ (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), - (['--task-id'], dict(help="""(string) 查询缓存分析任务详情的任务ID """, dest='taskId', required=True)), + (['--task-id'], dict(help="""(string) 任务ID,即request ID """, dest='taskId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -512,6 +626,75 @@ def describe_cache_analysis_result(self): except Exception as e: print(e) + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询当前客户端IP列表 ''', + description=''' + 查询当前客户端IP列表。 + + 示例: jdc redis describe-client-list --cache-instance-id xxx + ''', + ) + def describe_client_list(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeClientListRequest import DescribeClientListRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeClientListRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--ip'], dict(help="""(string) 客户端IP """, dest='ip', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询指定客户端IP的连接详细信息 ''', + description=''' + 查询指定客户端IP的连接详细信息。 + + 示例: jdc redis describe-client-ip-detail --cache-instance-id xxx --ip xxx + ''', + ) + def describe_client_ip_detail(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeClientIpDetailRequest import DescribeClientIpDetailRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeClientIpDetailRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), @@ -522,6 +705,7 @@ def describe_cache_analysis_result(self): (['--end-time'], dict(help="""(string) 结束时间 """, dest='endTime', required=False)), (['--base-id'], dict(help="""(string) 备份任务ID """, dest='baseId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -557,6 +741,7 @@ def describe_backups(self): (['--file-name'], dict(help="""(string) 备份文件名称,只支持英文数字和下划线的组合,长度不超过32个字符 """, dest='fileName', required=True)), (['--backup-type'], dict(help="""(int) 备份类型:手动备份为1,只能为手动备份 """, dest='backupType', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -564,7 +749,7 @@ def describe_backups(self): description=''' 创建并执行缓存Redis实例的备份任务,只能为手动备份,可设置备份文件名称。 - 示例: jdc redis create-backup --cache-instance-id xxx --file-name xxx --backup-type 0 + 示例: jdc redis create-backup --cache-instance-id xxx --file-name xxx --backup-type 5 ''', ) def create_backup(self): @@ -590,6 +775,7 @@ def create_backup(self): (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -622,9 +808,11 @@ def describe_backup_policy(self): arguments=[ (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), - (['--backup-time'], dict(help="""(string) 设置自动备份时间,格式为:HH:mm-HH:mm 时区,例如"01:00-02:00 +0800",表示东八区的1点到2点,'-'表示关闭自动备份 """, dest='backupTime', required=True)), + (['--auto-backup'], dict(help="""(bool) 是否开启自动备份,true表示开启,false表示关闭 """, dest='autoBackup', type=bool, required=False)), + (['--backup-time'], dict(help="""(string) 设置自动备份时间,格式为:HH:mm-HH:mm 时区,例如"01:00-02:00 +0800",表示东八区的1点到2点 """, dest='backupTime', required=True)), (['--backup-period'], dict(help="""(string) 备份周期,包括:Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday,多个用逗号分隔 """, dest='backupPeriod', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -659,6 +847,7 @@ def modify_backup_policy(self): (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--base-id'], dict(help="""(string) 备份任务ID """, dest='baseId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -693,6 +882,7 @@ def restore_instance(self): (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--base-id'], dict(help="""(string) 备份任务ID """, dest='baseId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -726,6 +916,7 @@ def describe_download_url(self): (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -759,6 +950,7 @@ def describe_cluster_info(self): (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -793,6 +985,7 @@ def describe_ip_white_list(self): (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--ip-white-list'], dict(help="""(array: string) 修改后的IP白名单列表,IP格式为CIDR表示法(x.x.x.x/x),0.0.0.0/0表示任何IP、网络都可以访问 """, dest='ipWhiteList', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -830,7 +1023,9 @@ def modify_ip_white_list(self): (['--start-time'], dict(help="""(string) 开始时间 """, dest='startTime', required=False)), (['--end-time'], dict(help="""(string) 结束时间 """, dest='endTime', required=False)), (['--shard-id'], dict(help="""(string) 分片id """, dest='shardId', required=False)), + (['--shard-addr'], dict(help="""(string) 分片地址 """, dest='shardAddr', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -862,29 +1057,31 @@ def describe_slow_log(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), - (['--redis-version'], dict(help="""(string) 缓存Redis的版本号:目前有2.8和4.0,默认为2.8 """, dest='redisVersion', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--task-type'], dict(help="""(string) 任务类型:resize表示变配,upgrade表示升级 """, dest='taskType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询缓存Redis实例的规格列表 ''', + help=''' 查询正在执行的任务进度列表 ''', description=''' - 查询缓存Redis实例的规格列表。 + 查询正在执行的任务进度列表。 - 示例: jdc redis describe-instance-class + 示例: jdc redis describe-task-progress-list --cache-instance-id xxx ''', ) - def describe_instance_class(self): + def describe_task_progress_list(self): client_factory = ClientFactory('redis') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.redis.apis.DescribeInstanceClassRequest import DescribeInstanceClassRequest + from jdcloud_sdk.services.redis.apis.DescribeTaskProgressListRequest import DescribeTaskProgressListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceClassRequest(params_dict, headers) + req = DescribeTaskProgressListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -895,28 +1092,30 @@ def describe_instance_class(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询账户的缓存Redis配额信息 ''', + help=''' 获取禁用命令列表 ''', description=''' - 查询账户的缓存Redis配额信息。 + 获取禁用命令列表。 - 示例: jdc redis describe-user-quota + 示例: jdc redis get-disable-commands --cache-instance-id xxx ''', ) - def describe_user_quota(self): + def get_disable_commands(self): client_factory = ClientFactory('redis') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.redis.apis.DescribeUserQuotaRequest import DescribeUserQuotaRequest + from jdcloud_sdk.services.redis.apis.GetDisableCommandsRequest import GetDisableCommandsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeUserQuotaRequest(params_dict, headers) + req = GetDisableCommandsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -927,28 +1126,1027 @@ def describe_user_quota(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--disable-commands'], dict(help="""(array: disableCommands) 禁用命令列表 """, dest='disableCommands', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询缓存Redis实例的规格配置信息 ''', + help=''' 禁用redis命令 ''', description=''' - 查询缓存Redis实例的规格配置信息。 + 禁用redis命令。 - 示例: jdc redis describe-spec-config + 示例: jdc redis set-disable-commands --cache-instance-id xxx --disable-commands ['{"":""}'] ''', ) - def describe_spec_config(self): + def set_disable_commands(self): client_factory = ClientFactory('redis') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.redis.apis.DescribeSpecConfigRequest import DescribeSpecConfigRequest + from jdcloud_sdk.services.redis.apis.SetDisableCommandsRequest import SetDisableCommandsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSpecConfigRequest(params_dict, headers) + req = SetDisableCommandsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询账号信息 ''', + description=''' + 查询账号信息。 + + 示例: jdc redis describe-accounts --cache-instance-id xxx + ''', + ) + def describe_accounts(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeAccountsRequest import DescribeAccountsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAccountsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--account-name'], dict(help="""(string) 账号名称 """, dest='accountName', required=True)), + (['--account-password'], dict(help="""(string) 账号密码 """, dest='accountPassword', required=True)), + (['--account-privilege'], dict(help="""(string) 账号权限,默认为读写权限。支持RoleReadOnly(只读权限)、RoleReadWrite(读写权限) """, dest='accountPrivilege', required=False)), + (['--account-description'], dict(help="""(string) 账号描述 """, dest='accountDescription', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建账号 ''', + description=''' + 创建账号。 + + 示例: jdc redis create-account --cache-instance-id xxx --account-name xxx --account-password xxx + ''', + ) + def create_account(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.CreateAccountRequest import CreateAccountRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateAccountRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--account-name'], dict(help="""(string) 账号名称 """, dest='accountName', required=True)), + (['--account-password'], dict(help="""(string) 账号密码 """, dest='accountPassword', required=False)), + (['--account-privilege'], dict(help="""(string) 账号权限。支持RoleReadOnly(只读权限)、RoleReadWrite(读写权限) """, dest='accountPrivilege', required=False)), + (['--account-description'], dict(help="""(string) 账号备注 """, dest='accountDescription', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改账号信息 ''', + description=''' + 修改账号信息。 + + 示例: jdc redis modify-account --cache-instance-id xxx --account-name xxx + ''', + ) + def modify_account(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.ModifyAccountRequest import ModifyAccountRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyAccountRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--account-name'], dict(help="""(string) 账号名称 """, dest='accountName', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除账号 ''', + description=''' + 删除账号。 + + 示例: jdc redis delete-account --cache-instance-id xxx --account-name xxx + ''', + ) + def delete_account(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DeleteAccountRequest import DeleteAccountRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteAccountRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--accounts'], dict(help="""(array: modifyAccount) 要修改的账号列表 """, dest='accounts', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 批量修改账号信息 ''', + description=''' + 批量修改账号信息。 + + 示例: jdc redis modify-accounts --cache-instance-id xxx --accounts ['{"":""}'] + ''', + ) + def modify_accounts(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.ModifyAccountsRequest import ModifyAccountsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyAccountsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--clear-type'], dict(help="""(string) 数据清理任务类型 """, dest='clearType', required=True)), + (['--key-pattern'], dict(help="""(string) 匹配模式, 如: test*、*test、ab*cc*, 当节点为AllData、ExpiredData时可以忽略此参数 """, dest='keyPattern', required=False)), + (['--key-filter'], dict(help="""(array: keyFilter) key的过滤条件, 当节点为AllData、ExpiredData时可以忽略此参数 """, dest='keyFilter', required=False)), + (['--qps-limit'], dict(help="""(int) 数据遍历的速率 """, dest='qpsLimit', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建数据清理任务 ''', + description=''' + 创建数据清理任务。 + + 示例: jdc redis start-clear-data --cache-instance-id xxx --clear-type xxx + ''', + ) + def start_clear_data(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.StartClearDataRequest import StartClearDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = StartClearDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 停止数据清理任务 ''', + description=''' + 停止数据清理任务。 + + 示例: jdc redis stop-clear-data --cache-instance-id xxx + ''', + ) + def stop_clear_data(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.StopClearDataRequest import StopClearDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = StopClearDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询数据清理任务进度 ''', + description=''' + 查询数据清理任务进度。 + + 示例: jdc redis describe-clear-data --cache-instance-id xxx + ''', + ) + def describe_clear_data(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeClearDataRequest import DescribeClearDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeClearDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--date'], dict(help="""(string) 格式:yyyy-MM-dd,表示查询某一天的大key分析列表 """, dest='date', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询大key分析任务列表 ''', + description=''' + 查询大key分析任务列表。 + + 示例: jdc redis describe-big-key-list --cache-instance-id xxx --date xxx + ''', + ) + def describe_big_key_list(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeBigKeyListRequest import DescribeBigKeyListRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeBigKeyListRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--string-size'], dict(help="""(int) String类型阈值 """, dest='stringSize', type=int, required=False)), + (['--list-size'], dict(help="""(int) List类型阈值 """, dest='listSize', type=int, required=False)), + (['--hash-size'], dict(help="""(int) Hash类型阈值 """, dest='hashSize', type=int, required=False)), + (['--set-size'], dict(help="""(int) Set类型阈值 """, dest='setSize', type=int, required=False)), + (['--zset-size'], dict(help="""(int) Zset类型阈值 """, dest='zsetSize', type=int, required=False)), + (['--top'], dict(help="""(int) top值,范围10~1000 """, dest='top', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建大key分析任务 ''', + description=''' + 创建大key分析任务。 + + 示例: jdc redis create-big-key-analysis --cache-instance-id xxx + ''', + ) + def create_big_key_analysis(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.CreateBigKeyAnalysisRequest import CreateBigKeyAnalysisRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateBigKeyAnalysisRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--task-id'], dict(help="""(string) 任务id """, dest='taskId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询大key分析详情 ''', + description=''' + 查询大key分析详情。 + + 示例: jdc redis describe-big-key-detail --cache-instance-id xxx --task-id xxx + ''', + ) + def describe_big_key_detail(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeBigKeyDetailRequest import DescribeBigKeyDetailRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeBigKeyDetailRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取大key自动缓存分析时间 ''', + description=''' + 获取大key自动缓存分析时间。 + + 示例: jdc redis describe-big-key-analysis-time --cache-instance-id xxx + ''', + ) + def describe_big_key_analysis_time(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeBigKeyAnalysisTimeRequest import DescribeBigKeyAnalysisTimeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeBigKeyAnalysisTimeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--analysis-time'], dict(help="""(string) -表示关闭,否则为:HH:mm-HH:mm 时区,例如"01:00-02:00 +0800",表示东八区的1点到2点 """, dest='analysisTime', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置大key自动缓存分析时间 ''', + description=''' + 设置大key自动缓存分析时间。 + + 示例: jdc redis modify-big-key-analysis-time --cache-instance-id xxx --analysis-time xxx + ''', + ) + def modify_big_key_analysis_time(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.ModifyBigKeyAnalysisTimeRequest import ModifyBigKeyAnalysisTimeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyBigKeyAnalysisTimeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 停止缓存分析任务 ''', + description=''' + 停止缓存分析任务。 + + 示例: jdc redis stop-cache-analysis --cache-instance-id xxx + ''', + ) + def stop_cache_analysis(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.StopCacheAnalysisRequest import StopCacheAnalysisRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = StopCacheAnalysisRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询缓存分析阈值 ''', + description=''' + 查询缓存分析阈值。 + + 示例: jdc redis describe-analysis-threshold --cache-instance-id xxx + ''', + ) + def describe_analysis_threshold(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeAnalysisThresholdRequest import DescribeAnalysisThresholdRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAnalysisThresholdRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--string-size'], dict(help="""(int) String类型阈值 """, dest='stringSize', type=int, required=False)), + (['--list-size'], dict(help="""(int) List类型阈值 """, dest='listSize', type=int, required=False)), + (['--hash-size'], dict(help="""(int) Hash类型阈值 """, dest='hashSize', type=int, required=False)), + (['--set-size'], dict(help="""(int) Set类型阈值 """, dest='setSize', type=int, required=False)), + (['--zset-size'], dict(help="""(int) Zset类型阈值 """, dest='zsetSize', type=int, required=False)), + (['--top'], dict(help="""(int) top值,范围10~1000 """, dest='top', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置缓存分析阈值 ''', + description=''' + 设置缓存分析阈值。 + + 示例: jdc redis modify-analysis-threshold --cache-instance-id xxx + ''', + ) + def modify_analysis_threshold(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.ModifyAnalysisThresholdRequest import ModifyAnalysisThresholdRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyAnalysisThresholdRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--string-size'], dict(help="""(int) String类型阈值,最小10240 """, dest='stringSize', type=int, required=False)), + (['--list-size'], dict(help="""(int) List类型阈值,最小1000 """, dest='listSize', type=int, required=False)), + (['--hash-size'], dict(help="""(int) Hash类型阈值,最小1000 """, dest='hashSize', type=int, required=False)), + (['--set-size'], dict(help="""(int) Set类型阈值,最小1000 """, dest='setSize', type=int, required=False)), + (['--zset-size'], dict(help="""(int) Zset类型阈值,最小1000 """, dest='zsetSize', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建大key分析任务 ''', + description=''' + 创建大key分析任务。 + + 示例: jdc redis create-big-key-analysis2 --cache-instance-id xxx + ''', + ) + def create_big_key_analysis2(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.CreateBigKeyAnalysis2Request import CreateBigKeyAnalysis2Request + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateBigKeyAnalysis2Request(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询大key分析任务列表 ''', + description=''' + 查询大key分析任务列表。 + + 示例: jdc redis describe-big-key-list2 --cache-instance-id xxx + ''', + ) + def describe_big_key_list2(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeBigKeyList2Request import DescribeBigKeyList2Request + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeBigKeyList2Request(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--task-id'], dict(help="""(string) 任务id """, dest='taskId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询大key分析详情 ''', + description=''' + 查询大key分析详情。 + + 示例: jdc redis describe-big-key-detail2 --cache-instance-id xxx --task-id xxx + ''', + ) + def describe_big_key_detail2(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeBigKeyDetail2Request import DescribeBigKeyDetail2Request + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeBigKeyDetail2Request(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取大key自动缓存分析时间 ''', + description=''' + 获取大key自动缓存分析时间。 + + 示例: jdc redis describe-big-key-analysis-time2 --cache-instance-id xxx + ''', + ) + def describe_big_key_analysis_time2(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeBigKeyAnalysisTime2Request import DescribeBigKeyAnalysisTime2Request + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeBigKeyAnalysisTime2Request(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--analysis-time'], dict(help="""(string) -表示关闭,否则为:HH:mm-HH:mm 时区,例如"01:00-02:00 +0800",表示东八区的1点到2点 """, dest='analysisTime', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置大key自动缓存分析时间 ''', + description=''' + 设置大key自动缓存分析时间。 + + 示例: jdc redis modify-big-key-analysis-time2 --cache-instance-id xxx --analysis-time xxx + ''', + ) + def modify_big_key_analysis_time2(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.ModifyBigKeyAnalysisTime2Request import ModifyBigKeyAnalysisTime2Request + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyBigKeyAnalysisTime2Request(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询缓存分析阈值 ''', + description=''' + 查询缓存分析阈值。 + + 示例: jdc redis describe-analysis-threshold2 --cache-instance-id xxx + ''', + ) + def describe_analysis_threshold2(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeAnalysisThreshold2Request import DescribeAnalysisThreshold2Request + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAnalysisThreshold2Request(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--string-size'], dict(help="""(int) String类型阈值,最小10240 """, dest='stringSize', type=int, required=False)), + (['--list-size'], dict(help="""(int) List类型阈值,最小1000 """, dest='listSize', type=int, required=False)), + (['--hash-size'], dict(help="""(int) Hash类型阈值,最小1000 """, dest='hashSize', type=int, required=False)), + (['--set-size'], dict(help="""(int) Set类型阈值,最小1000 """, dest='setSize', type=int, required=False)), + (['--zset-size'], dict(help="""(int) Zset类型阈值,最小1000 """, dest='zsetSize', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 设置缓存分析阈值 ''', + description=''' + 设置缓存分析阈值。 + + 示例: jdc redis modify-analysis-threshold2 --cache-instance-id xxx + ''', + ) + def modify_analysis_threshold2(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.ModifyAnalysisThreshold2Request import ModifyAnalysisThreshold2Request + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyAnalysisThreshold2Request(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询热key分析结果 ''', + description=''' + 查询热key分析结果。 + + 示例: jdc redis describe-hot-key-result2 --cache-instance-id xxx + ''', + ) + def describe_hot_key_result2(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeHotKeyResult2Request import DescribeHotKeyResult2Request + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeHotKeyResult2Request(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--cache-instance-id'], dict(help="""(string) 缓存Redis实例ID,是访问实例的唯一标识 """, dest='cacheInstanceId', required=True)), + (['--node-id'], dict(help="""(string) 节点id """, dest='nodeId', required=True)), + (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询热key分析详情 ''', + description=''' + 查询热key分析详情。 + + 示例: jdc redis describe-hot-key-detail2 --cache-instance-id xxx --node-id xxx + ''', + ) + def describe_hot_key_detail2(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeHotKeyDetail2Request import DescribeHotKeyDetail2Request + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeHotKeyDetail2Request(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--redis-version'], dict(help="""(string) 缓存Redis的版本号:目前有2.8和4.0,默认为2.8 """, dest='redisVersion', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询缓存Redis实例的规格列表 ''', + description=''' + 查询缓存Redis实例的规格列表。 + + 示例: jdc redis describe-instance-class + ''', + ) + def describe_instance_class(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeInstanceClassRequest import DescribeInstanceClassRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeInstanceClassRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询支持的地域列表 ''', + description=''' + 查询支持的地域列表。 + + 示例: jdc redis describe-available-region + ''', + ) + def describe_available_region(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeAvailableRegionRequest import DescribeAvailableRegionRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeAvailableRegionRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2 """, dest='regionId', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询账户的缓存Redis配额信息 ''', + description=''' + 查询账户的缓存Redis配额信息。 + + 示例: jdc redis describe-user-quota + ''', + ) + def describe_user_quota(self): + client_factory = ClientFactory('redis') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.redis.apis.DescribeUserQuotaRequest import DescribeUserQuotaRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeUserQuotaRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -958,7 +2156,7 @@ def describe_spec_config(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-cache-instances','create-cache-instance','describe-cache-instance','modify-cache-instance-attribute','delete-cache-instance','modify-cache-instance-class','reset-cache-instance-password','describe-instance-config','modify-instance-config','describe-analysis-time','modify-analysis-time','describe-cache-analysis-list','create-cache-analysis','describe-cache-analysis-result','describe-backups','create-backup','describe-backup-policy','modify-backup-policy','restore-instance','describe-download-url','describe-cluster-info','describe-ip-white-list','modify-ip-white-list','describe-slow-log','describe-instance-class','describe-user-quota','describe-spec-config',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-spec-config','describe-available-resource','describe-available-resource2','describe-cache-instances','create-cache-instance','describe-cache-instance','modify-cache-instance-attribute','delete-cache-instance','modify-cache-instance-class','reset-cache-instance-password','describe-instance-config','modify-instance-config','describe-analysis-time','modify-analysis-time','describe-cache-analysis-list','create-cache-analysis','describe-cache-analysis-result','describe-client-list','describe-client-ip-detail','describe-backups','create-backup','describe-backup-policy','modify-backup-policy','restore-instance','describe-download-url','describe-cluster-info','describe-ip-white-list','modify-ip-white-list','describe-slow-log','describe-task-progress-list','get-disable-commands','set-disable-commands','describe-accounts','create-account','modify-account','delete-account','modify-accounts','start-clear-data','stop-clear-data','describe-clear-data','describe-big-key-list','create-big-key-analysis','describe-big-key-detail','describe-big-key-analysis-time','modify-big-key-analysis-time','stop-cache-analysis','describe-analysis-threshold','modify-analysis-threshold','create-big-key-analysis2','describe-big-key-list2','describe-big-key-detail2','describe-big-key-analysis-time2','modify-big-key-analysis-time2','describe-analysis-threshold2','modify-analysis-threshold2','describe-hot-key-result2','describe-hot-key-detail2','describe-instance-class','describe-available-region','describe-user-quota',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/renewal.py b/jdcloud_cli/controllers/services/renewal.py index b1f7e3c..523e2e9 100644 --- a/jdcloud_cli/controllers/services/renewal.py +++ b/jdcloud_cli/controllers/services/renewal.py @@ -41,6 +41,7 @@ class Meta: (['--region-id'], dict(help="""(string) 地域 """, dest='regionId', required=False)), (['--set-renewal-param'], dict(help="""(setRenewalParam) NA """, dest='setRenewalParam', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -74,6 +75,7 @@ def set_renewal(self): (['--region-id'], dict(help="""(string) 地域 """, dest='regionId', required=False)), (['--query-instance-param'], dict(help="""(queryInstanceParam) NA """, dest='queryInstanceParam', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -107,6 +109,7 @@ def query_instance(self): (['--region-id'], dict(help="""(string) 地域 """, dest='regionId', required=False)), (['--renew-instance-param'], dict(help="""(renewInstanceParam) NA """, dest='renewInstanceParam', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, diff --git a/jdcloud_cli/controllers/services/resourcetag.py b/jdcloud_cli/controllers/services/resourcetag.py index a07b052..f4e6c1c 100644 --- a/jdcloud_cli/controllers/services/resourcetag.py +++ b/jdcloud_cli/controllers/services/resourcetag.py @@ -41,6 +41,7 @@ class Meta: (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--resource-vo'], dict(help="""(resourceReqVo) 资源标签参数对象 """, dest='resourceVo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -74,6 +75,7 @@ def describe_resources(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--tag-keys-vo'], dict(help="""(tagsReqVo) 标签参数 """, dest='tagKeysVo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -102,11 +104,80 @@ def describe_tags(self): except Exception as e: print(e) + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--tag-keys-vo'], dict(help="""(tagKeysReqVo) 标签键参数 """, dest='tagKeysVo', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取标签键 ''', + description=''' + 获取标签键。 + + 示例: jdc resourcetag describe-keys --tag-keys-vo '{"":""}' + ''', + ) + def describe_keys(self): + client_factory = ClientFactory('resourcetag') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.resourcetag.apis.DescribeKeysRequest import DescribeKeysRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeKeysRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--tag-values-vo'], dict(help="""(tagValuesReqVo) 标签值参数 """, dest='tagValuesVo', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取标签值 ''', + description=''' + 获取标签值。 + + 示例: jdc resourcetag describe-values --tag-values-vo '{"":""}' + ''', + ) + def describe_values(self): + client_factory = ClientFactory('resourcetag') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.resourcetag.apis.DescribeValuesRequest import DescribeValuesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeValuesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--tag-resources'], dict(help="""(tagResourcesReqVo) 绑定标签参数 """, dest='tagResources', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -140,6 +211,7 @@ def tag_resources(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--un-tag-resources'], dict(help="""(unTagResourcesReqVo) 解绑标签参数 """, dest='unTagResources', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -173,6 +245,7 @@ def un_tag_resources(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--query-resource'], dict(help="""(queryResourceReqVo) 查找资源id的参数对象 """, dest='queryResource', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -203,7 +276,7 @@ def query_resource(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-resources','describe-tags','tag-resources','un-tag-resources','query-resource',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-resources','describe-tags','describe-keys','describe-values','tag-resources','un-tag-resources','query-resource',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/sms.py b/jdcloud_cli/controllers/services/sms.py index d4313c3..8f25902 100644 --- a/jdcloud_cli/controllers/services/sms.py +++ b/jdcloud_cli/controllers/services/sms.py @@ -44,6 +44,7 @@ class Meta: (['--phone-list'], dict(help="""(array: string) 群发的国内电话号码,群发时一次最多不要超过100个手机号 """, dest='phoneList', required=False)), (['--params'], dict(help="""(array: string) 短信模板变量对应的数据值,Array格式 """, dest='params', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -78,6 +79,7 @@ def batch_send(self): (['--sequence-number'], dict(help="""(string) 发送短信的序列号 """, dest='sequenceNumber', required=True)), (['--phone-list'], dict(help="""(array: string) 需要获取回执的手机号码列表,选填 """, dest='phoneList', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -113,6 +115,7 @@ def status_report(self): (['--data-date'], dict(help="""(string) 查询时间 """, dest='dataDate', required=True)), (['--phone-list'], dict(help="""(array: string) 手机号列表(选填) """, dest='phoneList', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, diff --git a/jdcloud_cli/controllers/services/sop.py b/jdcloud_cli/controllers/services/sop.py index eb80b32..4c1a38b 100644 --- a/jdcloud_cli/controllers/services/sop.py +++ b/jdcloud_cli/controllers/services/sop.py @@ -39,29 +39,30 @@ class Meta: @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--get-security-token-info'], dict(help="""(getSecurityTokenInfo) 获取SecurityToken参数 """, dest='getSecurityTokenInfo', required=True)), + (['--action'], dict(help="""(string) 操作action serviceName:actionName """, dest='action', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取Token ''', + help=''' 获取操作保护设置信息 ''', description=''' - 获取Token。 + 获取操作保护设置信息。 - 示例: jdc sop get-security-token --get-security-token-info '{"":""}' + 示例: jdc sop get-sensitive-op-setting --action xxx ''', ) - def get_security_token(self): + def get_sensitive_op_setting(self): client_factory = ClientFactory('sop') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.sop.apis.GetSecurityTokenRequest import GetSecurityTokenRequest + from jdcloud_sdk.services.sop.apis.GetSensitiveOpSettingRequest import GetSensitiveOpSettingRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetSecurityTokenRequest(params_dict, headers) + req = GetSensitiveOpSettingRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -72,29 +73,30 @@ def get_security_token(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--action'], dict(help="""(string) 操作action serviceName:actionName """, dest='action', required=True)), + (['--get-security-token-info'], dict(help="""(getSecurityTokenInfo) 获取SecurityToken参数 """, dest='getSecurityTokenInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取操作保护设置信息 ''', + help=''' 获取Token ''', description=''' - 获取操作保护设置信息。 + 获取Token。 - 示例: jdc sop get-sensitive-op-setting --action xxx + 示例: jdc sop get-security-token --get-security-token-info '{"":""}' ''', ) - def get_sensitive_op_setting(self): + def get_security_token(self): client_factory = ClientFactory('sop') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.sop.apis.GetSensitiveOpSettingRequest import GetSensitiveOpSettingRequest + from jdcloud_sdk.services.sop.apis.GetSecurityTokenRequest import GetSecurityTokenRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetSensitiveOpSettingRequest(params_dict, headers) + req = GetSecurityTokenRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -104,7 +106,7 @@ def get_sensitive_op_setting(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['get-security-token','get-sensitive-op-setting',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['get-sensitive-op-setting','get-security-token',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/ssl.py b/jdcloud_cli/controllers/services/ssl.py index a948a65..9b20c35 100644 --- a/jdcloud_cli/controllers/services/ssl.py +++ b/jdcloud_cli/controllers/services/ssl.py @@ -43,6 +43,7 @@ class Meta: (['--domain-name'], dict(help="""(string) 域名,支持按照域名检索证书 """, dest='domainName', required=False)), (['--cert-ids'], dict(help="""(string) 证书id/别名 """, dest='certIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -77,6 +78,7 @@ def describe_certs(self): (['--page-number'], dict(help="""(int) 第几页,从1开始计数 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 每页显示的数目 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -109,6 +111,7 @@ def describe_cert(self): arguments=[ (['--cert-id'], dict(help="""(string) 证书 Id """, dest='certId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -144,6 +147,7 @@ def delete_certs(self): (['--cert-file'], dict(help="""(string) 证书 """, dest='certFile', required=True)), (['--alias-name'], dict(help="""(string) 证书别名 """, dest='aliasName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -177,6 +181,7 @@ def upload_cert(self): (['--cert-id'], dict(help="""(string) 证书 Id """, dest='certId', required=True)), (['--server-type'], dict(help="""(string) 证书应用的服务器类型(Nginx Apache Tomcat IIS Other) """, dest='serverType', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -210,6 +215,7 @@ def download_cert(self): (['--cert-id'], dict(help="""(string) 证书Id """, dest='certId', required=True)), (['--cert-name'], dict(help="""(string) 证书名称 """, dest='certName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -244,6 +250,7 @@ def update_cert_name(self): (['--key-file'], dict(help="""(string) 私钥 """, dest='keyFile', required=True)), (['--cert-file'], dict(help="""(string) 证书 """, dest='certFile', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, diff --git a/jdcloud_cli/controllers/services/streambus.py b/jdcloud_cli/controllers/services/streambus.py index 5132a1f..d681c55 100644 --- a/jdcloud_cli/controllers/services/streambus.py +++ b/jdcloud_cli/controllers/services/streambus.py @@ -41,6 +41,7 @@ class Meta: (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--keyword'], dict(help="""(string) NA """, dest='keyword', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -74,6 +75,7 @@ def get_topic_list(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--name'], dict(help="""(string) NA """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -107,6 +109,7 @@ def describe_topic(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--topic-model'], dict(help="""(topicModel) 示例:{"topicModel":{"topic":{"archived":0,"id":"","name":"create","remark":"备注","shardNum":1,"partitionNum":2,"lifecycle":3}}} """, dest='topicModel', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -140,6 +143,7 @@ def add_topic(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--topic-model'], dict(help="""(topicModel) 当更新主题时只需要修改topicModel中的topic中的属性即可;创建归档需要指定target以及归档的目的地(mysql,京东云 Elasticsearch,对象存储,数据计算服务)参数 """, dest='topicModel', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -173,6 +177,7 @@ def update_topic(self): (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--name'], dict(help="""(string) NA """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -206,6 +211,7 @@ def delete_topic(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--topic-id'], dict(help="""(int) 主题id """, dest='topicId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -213,7 +219,7 @@ def delete_topic(self): description=''' 查看指定主题的所有消费组。 - 示例: jdc streambus get-consumer-group-list --topic-id 0 + 示例: jdc streambus get-consumer-group-list --topic-id 5 ''', ) def get_consumer_group_list(self): @@ -239,6 +245,7 @@ def get_consumer_group_list(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--consumer-group-str'], dict(help="""(consumerGroup) 消费组对象 """, dest='consumerGroupStr', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -273,6 +280,7 @@ def create_consumer_group(self): (['--topic-id'], dict(help="""(int) 主题ID """, dest='topicId', type=int, required=True)), (['--consumer-group-id'], dict(help="""(int) 消费组ID """, dest='consumerGroupId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -280,7 +288,7 @@ def create_consumer_group(self): description=''' 删除consumerGroupName。 - 示例: jdc streambus delete-consumer-group --topic-id 0 --consumer-group-id 0 + 示例: jdc streambus delete-consumer-group --topic-id 5 --consumer-group-id 5 ''', ) def delete_consumer_group(self): diff --git a/jdcloud_cli/controllers/services/streamcomputer.py b/jdcloud_cli/controllers/services/streamcomputer.py index b34e763..1a18c89 100644 --- a/jdcloud_cli/controllers/services/streamcomputer.py +++ b/jdcloud_cli/controllers/services/streamcomputer.py @@ -39,30 +39,30 @@ class Meta: @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--job-id'], dict(help="""(int) NA """, dest='jobId', type=int, required=True)), - (['--namespace-id'], dict(help="""(int) NA """, dest='namespaceId', type=int, required=True)), + (['--keyword'], dict(help="""(string) NA """, dest='keyword', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询指定作业详情 ''', + help=''' 查询租户下的应用列表 ''', description=''' - 查询指定作业详情。 + 查询租户下的应用列表。 - 示例: jdc streamcomputer describe-job --job-id 0 --namespace-id 0 + 示例: jdc streamcomputer query-namespaces ''', ) - def describe_job(self): + def query_namespaces(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.DescribeJobRequest import DescribeJobRequest + from jdcloud_sdk.services.streamcomputer.apis.QueryNamespacesRequest import QueryNamespacesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeJobRequest(params_dict, headers) + req = QueryNamespacesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -73,29 +73,30 @@ def describe_job(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--job-str'], dict(help="""(jobStr) 创建作业的详情 """, dest='jobStr', required=True)), + (['--namespace-id'], dict(help="""(int) NA """, dest='namespaceId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加或者更新job ''', + help=''' 查询某个应用详情 ''', description=''' - 添加或者更新job。 + 查询某个应用详情。 - 示例: jdc streamcomputer add-or-update-job --job-str '{"":""}' + 示例: jdc streamcomputer query-namespace-detail --namespace-id 5 ''', ) - def add_or_update_job(self): + def query_namespace_detail(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.AddOrUpdateJobRequest import AddOrUpdateJobRequest + from jdcloud_sdk.services.streamcomputer.apis.QueryNamespaceDetailRequest import QueryNamespaceDetailRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddOrUpdateJobRequest(params_dict, headers) + req = QueryNamespaceDetailRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -106,30 +107,30 @@ def add_or_update_job(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--namespace-id'], dict(help="""(string) NA """, dest='namespaceId', required=True)), - (['--job-id'], dict(help="""(int) NA """, dest='jobId', type=int, required=True)), + (['--namespace-str'], dict(help="""(namespace) NA """, dest='namespaceStr', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除作业 ''', + help=''' 创建namespace ''', description=''' - 删除作业。 + 创建namespace。 - 示例: jdc streamcomputer delete-job --namespace-id xxx --job-id 0 + 示例: jdc streamcomputer create-namespace --namespace-str '{"":""}' ''', ) - def delete_job(self): + def create_namespace(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.DeleteJobRequest import DeleteJobRequest + from jdcloud_sdk.services.streamcomputer.apis.CreateNamespaceRequest import CreateNamespaceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteJobRequest(params_dict, headers) + req = CreateNamespaceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -140,29 +141,30 @@ def delete_job(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--namespace-id'], dict(help="""(string) NA """, dest='namespaceId', required=True)), + (['--namespace-str'], dict(help="""(namespace) NA """, dest='namespaceStr', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询指定应用下的所有job ''', + help=''' 更新namespace ''', description=''' - 查询指定应用下的所有job。 + 更新namespace。 - 示例: jdc streamcomputer get-job-list --namespace-id xxx + 示例: jdc streamcomputer update-namespace --namespace-str '{"":""}' ''', ) - def get_job_list(self): + def update_namespace(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.GetJobListRequest import GetJobListRequest + from jdcloud_sdk.services.streamcomputer.apis.UpdateNamespaceRequest import UpdateNamespaceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetJobListRequest(params_dict, headers) + req = UpdateNamespaceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -173,30 +175,30 @@ def get_job_list(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--namespace-id'], dict(help="""(string) NA """, dest='namespaceId', required=True)), - (['--job-id'], dict(help="""(int) NA """, dest='jobId', type=int, required=True)), + (['--namespace-id'], dict(help="""(int) NA """, dest='namespaceId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 运行job ''', + help=''' 删除namespace,如果旗下关联有其他资源,不允许删除 ''', description=''' - 运行job。 + 删除namespace,如果旗下关联有其他资源,不允许删除。 - 示例: jdc streamcomputer start-job --namespace-id xxx --job-id 0 + 示例: jdc streamcomputer delete-namespace --namespace-id 5 ''', ) - def start_job(self): + def delete_namespace(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.StartJobRequest import StartJobRequest + from jdcloud_sdk.services.streamcomputer.apis.DeleteNamespaceRequest import DeleteNamespaceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartJobRequest(params_dict, headers) + req = DeleteNamespaceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -207,30 +209,30 @@ def start_job(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--namespace-id'], dict(help="""(string) NA """, dest='namespaceId', required=True)), - (['--job-id'], dict(help="""(int) NA """, dest='jobId', type=int, required=True)), + (['--storage-id'], dict(help="""(int) storageId """, dest='storageId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 停止作业运行job ''', + help=''' 查询指定输入 ''', description=''' - 停止作业运行job。 + 查询指定输入。 - 示例: jdc streamcomputer stop-job --namespace-id xxx --job-id 0 + 示例: jdc streamcomputer describe-storage --storage-id 5 ''', ) - def stop_job(self): + def describe_storage(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.StopJobRequest import StopJobRequest + from jdcloud_sdk.services.streamcomputer.apis.DescribeStorageRequest import DescribeStorageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopJobRequest(params_dict, headers) + req = DescribeStorageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -241,29 +243,30 @@ def stop_job(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--keyword'], dict(help="""(string) NA """, dest='keyword', required=False)), + (['--storage-str'], dict(help="""(storage) 创建或者更新storage的详情 """, dest='storageStr', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询租户下的应用列表 ''', + help=''' 创建或者更新storage ''', description=''' - 查询租户下的应用列表。 + 创建或者更新storage。 - 示例: jdc streamcomputer query-namespaces + 示例: jdc streamcomputer add-or-update-storage --storage-str '{"":""}' ''', ) - def query_namespaces(self): + def add_or_update_storage(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.QueryNamespacesRequest import QueryNamespacesRequest + from jdcloud_sdk.services.streamcomputer.apis.AddOrUpdateStorageRequest import AddOrUpdateStorageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryNamespacesRequest(params_dict, headers) + req = AddOrUpdateStorageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -274,29 +277,30 @@ def query_namespaces(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--namespace-id'], dict(help="""(int) NA """, dest='namespaceId', type=int, required=True)), + (['--storage-id'], dict(help="""(int) storageId """, dest='storageId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询某个应用详情 ''', + help=''' 删除指定输入 ''', description=''' - 查询某个应用详情。 + 删除指定输入。 - 示例: jdc streamcomputer query-namespace-detail --namespace-id 0 + 示例: jdc streamcomputer delete-storage --storage-id 5 ''', ) - def query_namespace_detail(self): + def delete_storage(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.QueryNamespaceDetailRequest import QueryNamespaceDetailRequest + from jdcloud_sdk.services.streamcomputer.apis.DeleteStorageRequest import DeleteStorageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryNamespaceDetailRequest(params_dict, headers) + req = DeleteStorageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -307,29 +311,31 @@ def query_namespace_detail(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--namespace-str'], dict(help="""(namespace) NA """, dest='namespaceStr', required=True)), + (['--storage-type'], dict(help="""(string) storage类型 """, dest='storageType', required=True)), + (['--namespace-id'], dict(help="""(string) namespaceId """, dest='namespaceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建namespace ''', + help=''' 创建或者更新storage ''', description=''' - 创建namespace。 + 创建或者更新storage。 - 示例: jdc streamcomputer create-namespace --namespace-str '{"":""}' + 示例: jdc streamcomputer get-storage-list --storage-type xxx --namespace-id xxx ''', ) - def create_namespace(self): + def get_storage_list(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.CreateNamespaceRequest import CreateNamespaceRequest + from jdcloud_sdk.services.streamcomputer.apis.GetStorageListRequest import GetStorageListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateNamespaceRequest(params_dict, headers) + req = GetStorageListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -340,29 +346,31 @@ def create_namespace(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--namespace-str'], dict(help="""(namespace) NA """, dest='namespaceStr', required=True)), + (['--job-id'], dict(help="""(int) NA """, dest='jobId', type=int, required=True)), + (['--namespace-id'], dict(help="""(int) NA """, dest='namespaceId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 更新namespace ''', + help=''' 查询指定作业详情 ''', description=''' - 更新namespace。 + 查询指定作业详情。 - 示例: jdc streamcomputer update-namespace --namespace-str '{"":""}' + 示例: jdc streamcomputer describe-job --job-id 5 --namespace-id 5 ''', ) - def update_namespace(self): + def describe_job(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.UpdateNamespaceRequest import UpdateNamespaceRequest + from jdcloud_sdk.services.streamcomputer.apis.DescribeJobRequest import DescribeJobRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateNamespaceRequest(params_dict, headers) + req = DescribeJobRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -373,29 +381,30 @@ def update_namespace(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--namespace-id'], dict(help="""(int) NA """, dest='namespaceId', type=int, required=True)), + (['--job-str'], dict(help="""(jobStr) 创建作业的详情 """, dest='jobStr', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除namespace,如果旗下关联有其他资源,不允许删除 ''', + help=''' 添加或者更新job ''', description=''' - 删除namespace,如果旗下关联有其他资源,不允许删除。 + 添加或者更新job。 - 示例: jdc streamcomputer delete-namespace --namespace-id 0 + 示例: jdc streamcomputer add-or-update-job --job-str '{"":""}' ''', ) - def delete_namespace(self): + def add_or_update_job(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.DeleteNamespaceRequest import DeleteNamespaceRequest + from jdcloud_sdk.services.streamcomputer.apis.AddOrUpdateJobRequest import AddOrUpdateJobRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteNamespaceRequest(params_dict, headers) + req = AddOrUpdateJobRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -406,29 +415,31 @@ def delete_namespace(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--storage-id'], dict(help="""(int) storageId """, dest='storageId', type=int, required=True)), + (['--namespace-id'], dict(help="""(string) NA """, dest='namespaceId', required=True)), + (['--job-id'], dict(help="""(int) NA """, dest='jobId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询指定输入 ''', + help=''' 删除作业 ''', description=''' - 查询指定输入。 + 删除作业。 - 示例: jdc streamcomputer describe-storage --storage-id 0 + 示例: jdc streamcomputer delete-job --namespace-id xxx --job-id 5 ''', ) - def describe_storage(self): + def delete_job(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.DescribeStorageRequest import DescribeStorageRequest + from jdcloud_sdk.services.streamcomputer.apis.DeleteJobRequest import DeleteJobRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeStorageRequest(params_dict, headers) + req = DeleteJobRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -439,29 +450,30 @@ def describe_storage(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--storage-str'], dict(help="""(storage) 创建或者更新storage的详情 """, dest='storageStr', required=True)), + (['--namespace-id'], dict(help="""(string) NA """, dest='namespaceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建或者更新storage ''', + help=''' 查询指定应用下的所有job ''', description=''' - 创建或者更新storage。 + 查询指定应用下的所有job。 - 示例: jdc streamcomputer add-or-update-storage --storage-str '{"":""}' + 示例: jdc streamcomputer get-job-list --namespace-id xxx ''', ) - def add_or_update_storage(self): + def get_job_list(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.AddOrUpdateStorageRequest import AddOrUpdateStorageRequest + from jdcloud_sdk.services.streamcomputer.apis.GetJobListRequest import GetJobListRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddOrUpdateStorageRequest(params_dict, headers) + req = GetJobListRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -472,29 +484,31 @@ def add_or_update_storage(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--storage-id'], dict(help="""(int) storageId """, dest='storageId', type=int, required=True)), + (['--namespace-id'], dict(help="""(string) NA """, dest='namespaceId', required=True)), + (['--job-id'], dict(help="""(int) NA """, dest='jobId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除指定输入 ''', + help=''' 运行job ''', description=''' - 删除指定输入。 + 运行job。 - 示例: jdc streamcomputer delete-storage --storage-id 0 + 示例: jdc streamcomputer start-job --namespace-id xxx --job-id 5 ''', ) - def delete_storage(self): + def start_job(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.DeleteStorageRequest import DeleteStorageRequest + from jdcloud_sdk.services.streamcomputer.apis.StartJobRequest import StartJobRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteStorageRequest(params_dict, headers) + req = StartJobRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -505,30 +519,31 @@ def delete_storage(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--storage-type'], dict(help="""(string) storage类型 """, dest='storageType', required=True)), - (['--namespace-id'], dict(help="""(string) namespaceId """, dest='namespaceId', required=True)), + (['--namespace-id'], dict(help="""(string) NA """, dest='namespaceId', required=True)), + (['--job-id'], dict(help="""(int) NA """, dest='jobId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建或者更新storage ''', + help=''' 停止作业运行job ''', description=''' - 创建或者更新storage。 + 停止作业运行job。 - 示例: jdc streamcomputer get-storage-list --storage-type xxx --namespace-id xxx + 示例: jdc streamcomputer stop-job --namespace-id xxx --job-id 5 ''', ) - def get_storage_list(self): + def stop_job(self): client_factory = ClientFactory('streamcomputer') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.streamcomputer.apis.GetStorageListRequest import GetStorageListRequest + from jdcloud_sdk.services.streamcomputer.apis.StopJobRequest import StopJobRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetStorageListRequest(params_dict, headers) + req = StopJobRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -538,7 +553,7 @@ def get_storage_list(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-job','add-or-update-job','delete-job','get-job-list','start-job','stop-job','query-namespaces','query-namespace-detail','create-namespace','update-namespace','delete-namespace','describe-storage','add-or-update-storage','delete-storage','get-storage-list',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['query-namespaces','query-namespace-detail','create-namespace','update-namespace','delete-namespace','describe-storage','add-or-update-storage','delete-storage','get-storage-list','describe-job','add-or-update-job','delete-job','get-job-list','start-job','stop-job',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/sts.py b/jdcloud_cli/controllers/services/sts.py index b2c0b17..44eaa8e 100644 --- a/jdcloud_cli/controllers/services/sts.py +++ b/jdcloud_cli/controllers/services/sts.py @@ -40,6 +40,7 @@ class Meta: arguments=[ (['--assume-role-info'], dict(help="""(assumeRoleInfo) 扮演角色参数 """, dest='assumeRoleInfo', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, diff --git a/jdcloud_cli/controllers/services/vm.py b/jdcloud_cli/controllers/services/vm.py index 46d2408..42b8c0c 100644 --- a/jdcloud_cli/controllers/services/vm.py +++ b/jdcloud_cli/controllers/services/vm.py @@ -38,30 +38,33 @@ class Meta: @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--image-id'], dict(help="""(string) 镜像ID """, dest='imageId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;
默认为20;取值范围[10, 100]。 """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) filters 中支持使用以下关键字进行过滤; `name`: 实例模板名称,模糊匹配,支持多个; `instanceTemplateId`: 实例模板ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询镜像详情。; ''', + help=''' ; 查询实例模板列表。; ; 详细操作说明请参考帮助文档:[实例模板](https://docs.jdcloud.com/cn/virtual-machines/instance-template-overview); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 单次查询最大可查询100条实例模板数据。; ''', description=''' - 查询镜像详情。; 。 + ; 查询实例模板列表。; ; 详细操作说明请参考帮助文档:[实例模板](https://docs.jdcloud.com/cn/virtual-machines/instance-template-overview); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 单次查询最大可查询100条实例模板数据。; 。 - 示例: jdc vm describe-image --image-id xxx + 示例: jdc vm describe-instance-templates ''', ) - def describe_image(self): + def describe_instance_templates(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeImageRequest import DescribeImageRequest + from jdcloud_sdk.services.vm.apis.DescribeInstanceTemplatesRequest import DescribeInstanceTemplatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeImageRequest(params_dict, headers) + req = DescribeInstanceTemplatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -71,30 +74,33 @@ def describe_image(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--image-id'], dict(help="""(string) 镜像ID """, dest='imageId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-template-data'], dict(help="""(instanceTemplateSpec) 实例模板配置信息。 """, dest='instanceTemplateData', required=True)), + (['--name'], dict(help="""(string) 实例模板的名称,参考 [公共参数规范](https://docs.jdcloud.com/virtual-machines/api/general_parameters)。 """, dest='name', required=True)), + (['--description'], dict(help="""(string) 实例模板的描述,参考 [公共参数规范](https://docs.jdcloud.com/virtual-machines/api/general_parameters)。 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除一个私有镜像,只允许操作您的个人私有镜像。
; 若镜像已共享给其他用户,需先取消共享才可删除。; ''', + help=''' ; 创建实例模板。; ; 实例模板是创建云主机实例的配置信息模板,包括镜像、实例规格、系统盘及数据盘类型和容量、私有网络及子网配置、安全组及登录信息等。实例模板可用于创建实例及用于配置高可用组(创建高可用组时必须指定实例模板)。使用实例模板创建实例时,无需重新指定实例模板已包括的参数,缩短您的部署时间。; ; 请注意:实例模板一经创建后其属性将不能编辑,如需调整参数请重新创建实例模板替换使用。; ; 详细操作说明请参考帮助文档:[创建实例模板](https://docs.jdcloud.com/cn/virtual-machines/create-instance-template); ; ## 接口说明; - 创建实例模板的限制基本与创建云主机一致,可参考 [创建云主机](https://docs.jdcloud.com/cn/virtual-machines/create-instance)。; - 实例模板中包含创建云主机的大部分配置参数,可以避免每次创建云主机时的重复性配置参数的工作。; - 使用实例模板创建云主机时,如果再次指定了某些参数,并且与实例模板中的参数相冲突,那么新指定的参数会替换模板中的参数,以新指定的参数为准。; - 使用实例模板创建云主机时,如果再次指定了镜像ID,并且与模板中的镜像ID不一致,那么模板中的 `systemDisk` 和 `dataDisks` 配置会失效,以新指定的镜像为准。; - 如果使用高可用组(Ag)创建云主机,那么Ag所关联的模板中的参数都不可以被调整,只能以模板为准。; ''', description=''' - 删除一个私有镜像,只允许操作您的个人私有镜像。
; 若镜像已共享给其他用户,需先取消共享才可删除。; 。 + ; 创建实例模板。; ; 实例模板是创建云主机实例的配置信息模板,包括镜像、实例规格、系统盘及数据盘类型和容量、私有网络及子网配置、安全组及登录信息等。实例模板可用于创建实例及用于配置高可用组(创建高可用组时必须指定实例模板)。使用实例模板创建实例时,无需重新指定实例模板已包括的参数,缩短您的部署时间。; ; 请注意:实例模板一经创建后其属性将不能编辑,如需调整参数请重新创建实例模板替换使用。; ; 详细操作说明请参考帮助文档:[创建实例模板](https://docs.jdcloud.com/cn/virtual-machines/create-instance-template); ; ## 接口说明; - 创建实例模板的限制基本与创建云主机一致,可参考 [创建云主机](https://docs.jdcloud.com/cn/virtual-machines/create-instance)。; - 实例模板中包含创建云主机的大部分配置参数,可以避免每次创建云主机时的重复性配置参数的工作。; - 使用实例模板创建云主机时,如果再次指定了某些参数,并且与实例模板中的参数相冲突,那么新指定的参数会替换模板中的参数,以新指定的参数为准。; - 使用实例模板创建云主机时,如果再次指定了镜像ID,并且与模板中的镜像ID不一致,那么模板中的 `systemDisk` 和 `dataDisks` 配置会失效,以新指定的镜像为准。; - 如果使用高可用组(Ag)创建云主机,那么Ag所关联的模板中的参数都不可以被调整,只能以模板为准。; 。 - 示例: jdc vm delete-image --image-id xxx + 示例: jdc vm create-instance-template --instance-template-data '{"":""}' --name xxx ''', ) - def delete_image(self): + def create_instance_template(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DeleteImageRequest import DeleteImageRequest + from jdcloud_sdk.services.vm.apis.CreateInstanceTemplateRequest import CreateInstanceTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteImageRequest(params_dict, headers) + req = CreateInstanceTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -104,39 +110,31 @@ def delete_image(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--image-source'], dict(help="""(string) 镜像来源,如果没有指定ids参数,此参数必传;取值范围:public、shared、thirdparty、private、community """, dest='imageSource', required=False)), - (['--service-code'], dict(help="""(string) 产品线标识,非必传,不传的时候返回全部产品线镜像 """, dest='serviceCode', required=False)), - (['--offline'], dict(help="""(bool) 是否下线,默认值为false;imageSource为public或者thirdparty时,此参数才有意义,其它情况下此参数无效;指定镜像ID查询时,此参数无效 """, dest='offline', required=False)), - (['--platform'], dict(help="""(string) 操作系统平台,取值范围:Windows Server、CentOS、Ubuntu """, dest='platform', required=False)), - (['--ids'], dict(help="""(array: string) 镜像ID列表,如果指定了此参数,其它参数可为空 """, dest='ids', required=False)), - (['--root-device-type'], dict(help="""(string) 镜像支持的系统盘类型,[localDisk,cloudDisk] """, dest='rootDeviceType', required=False)), - (['--launch-permission'], dict(help="""(string) 镜像的使用权限[all, specifiedUsers,ownerOnly],可选参数,仅当imageSource取值private时有效 """, dest='launchPermission', required=False)), - (['--status'], dict(help="""(string) 参考镜像状态 """, dest='status', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-template-id'], dict(help="""(string) 实例模板ID。 """, dest='instanceTemplateId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询镜像信息列表。
; 通过此接口可以查询到京东云官方镜像、第三方镜像、私有镜像、或其他用户共享给您的镜像。
; 此接口支持分页查询,默认每页20条。; ''', + help=''' ; 查询实例模板详情。; ; 详细操作说明请参考帮助文档:[实例模板](https://docs.jdcloud.com/cn/virtual-machines/instance-template-overview); ; ## 接口说明; - 该接口与查询实例模板列表返回的信息一致。; - 只需要查询单个实例模板详细信息的时候可以调用该接口。; ''', description=''' - 查询镜像信息列表。
; 通过此接口可以查询到京东云官方镜像、第三方镜像、私有镜像、或其他用户共享给您的镜像。
; 此接口支持分页查询,默认每页20条。; 。 + ; 查询实例模板详情。; ; 详细操作说明请参考帮助文档:[实例模板](https://docs.jdcloud.com/cn/virtual-machines/instance-template-overview); ; ## 接口说明; - 该接口与查询实例模板列表返回的信息一致。; - 只需要查询单个实例模板详细信息的时候可以调用该接口。; 。 - 示例: jdc vm describe-images + 示例: jdc vm describe-instance-template --instance-template-id xxx ''', ) - def describe_images(self): + def describe_instance_template(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeImagesRequest import DescribeImagesRequest + from jdcloud_sdk.services.vm.apis.DescribeInstanceTemplateRequest import DescribeInstanceTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeImagesRequest(params_dict, headers) + req = DescribeInstanceTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -146,30 +144,34 @@ def describe_images(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--image-id'], dict(help="""(string) 镜像ID """, dest='imageId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-template-id'], dict(help="""(string) 实例模板ID。 """, dest='instanceTemplateId', required=True)), + (['--name'], dict(help="""(string) 实例模板的名称,参考 [公共参数规范](https://docs.jdcloud.com/virtual-machines/api/general_parameters)。 """, dest='name', required=False)), + (['--description'], dict(help="""(string) 实例模板的描述,参考 [公共参数规范](https://docs.jdcloud.com/virtual-machines/api/general_parameters)。 """, dest='description', required=False)), + (['--instance-template-data'], dict(help="""(updateInstanceTemplateSpec) 实例模板配置信息。 """, dest='instanceTemplateData', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询镜像的实例规格限制。
; 通过此接口可以查看镜像不支持的实例规格。只有官方镜像、第三方镜像有实例规格的限制,个人的私有镜像没有此限制。; ''', + help=''' ; 修改实例模板属性。; ; 详细操作说明请参考帮助文档:[实例模板](https://docs.jdcloud.com/cn/virtual-machines/instance-template-overview); ; ## 接口说明; - 名称、描述、实例模板配置信息至少要传一项。; - 参数时,对应的参数不做更改。; ''', description=''' - 查询镜像的实例规格限制。
; 通过此接口可以查看镜像不支持的实例规格。只有官方镜像、第三方镜像有实例规格的限制,个人的私有镜像没有此限制。; 。 + ; 修改实例模板属性。; ; 详细操作说明请参考帮助文档:[实例模板](https://docs.jdcloud.com/cn/virtual-machines/instance-template-overview); ; ## 接口说明; - 名称、描述、实例模板配置信息至少要传一项。; - 参数时,对应的参数不做更改。; 。 - 示例: jdc vm describe-image-constraints --image-id xxx + 示例: jdc vm update-instance-template --instance-template-id xxx ''', ) - def describe_image_constraints(self): + def update_instance_template(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeImageConstraintsRequest import DescribeImageConstraintsRequest + from jdcloud_sdk.services.vm.apis.UpdateInstanceTemplateRequest import UpdateInstanceTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeImageConstraintsRequest(params_dict, headers) + req = UpdateInstanceTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -179,30 +181,31 @@ def describe_image_constraints(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--ids'], dict(help="""(array: string) 镜像ID列表 """, dest='ids', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-template-id'], dict(help="""(string) 实例模板ID。 """, dest='instanceTemplateId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量查询镜像的实例规格限制。
; 通过此接口可以查看镜像不支持的实例规格。只有官方镜像、第三方镜像有实例规格的限制,个人的私有镜像没有此限制。; ''', + help=''' ; 删除单个实例模板。; ; 详细操作说明请参考帮助文档:[删除实例模板](https://docs.jdcloud.com/cn/virtual-machines/delete-instance-template); ; ## 接口说明; - 关联了高可用组的实例模板不可以删除。; ''', description=''' - 批量查询镜像的实例规格限制。
; 通过此接口可以查看镜像不支持的实例规格。只有官方镜像、第三方镜像有实例规格的限制,个人的私有镜像没有此限制。; 。 + ; 删除单个实例模板。; ; 详细操作说明请参考帮助文档:[删除实例模板](https://docs.jdcloud.com/cn/virtual-machines/delete-instance-template); ; ## 接口说明; - 关联了高可用组的实例模板不可以删除。; 。 - 示例: jdc vm describe-image-constraints-batch + 示例: jdc vm delete-instance-template --instance-template-id xxx ''', ) - def describe_image_constraints_batch(self): + def delete_instance_template(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeImageConstraintsBatchRequest import DescribeImageConstraintsBatchRequest + from jdcloud_sdk.services.vm.apis.DeleteInstanceTemplateRequest import DeleteInstanceTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeImageConstraintsBatchRequest(params_dict, headers) + req = DeleteInstanceTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -212,31 +215,31 @@ def describe_image_constraints_batch(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--image-id'], dict(help="""(string) 镜像ID """, dest='imageId', required=True)), - (['--pins'], dict(help="""(array: string) 需要共享的帐户 """, dest='pins', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-template-id'], dict(help="""(string) 实例模板ID。 """, dest='instanceTemplateId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 共享镜像,只允许操作您的个人私有镜像,单个镜像最多可共享给20个京东云帐户。
; 整机镜像目前不支持共享。; ''', + help=''' ; 校验实例模板的有效性。; ; 详细操作说明请参考帮助文档:[实例模板](https://docs.jdcloud.com/cn/virtual-machines/instance-template-overview); ; ## 接口说明; - 调用该接口可以校验实例模板是否有效,例如某些关联资源可能已经被删除了,此刻实例模板可能已经失效了。; ''', description=''' - 共享镜像,只允许操作您的个人私有镜像,单个镜像最多可共享给20个京东云帐户。
; 整机镜像目前不支持共享。; 。 + ; 校验实例模板的有效性。; ; 详细操作说明请参考帮助文档:[实例模板](https://docs.jdcloud.com/cn/virtual-machines/instance-template-overview); ; ## 接口说明; - 调用该接口可以校验实例模板是否有效,例如某些关联资源可能已经被删除了,此刻实例模板可能已经失效了。; 。 - 示例: jdc vm share-image --image-id xxx + 示例: jdc vm verify-instance-template --instance-template-id xxx ''', ) - def share_image(self): + def verify_instance_template(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.ShareImageRequest import ShareImageRequest + from jdcloud_sdk.services.vm.apis.VerifyInstanceTemplateRequest import VerifyInstanceTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ShareImageRequest(params_dict, headers) + req = VerifyInstanceTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -246,31 +249,31 @@ def share_image(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--image-id'], dict(help="""(string) 镜像ID """, dest='imageId', required=True)), - (['--pins'], dict(help="""(array: string) 需要取消的帐户 """, dest='pins', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--filters'], dict(help="""(array: filter) filters 中支持使用以下关键字进行过滤; `instanceTemplateId`: 实例模板ID,精确匹配,最多支持10个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 取消共享镜像,只允许操作您的个人私有镜像。; ''', + help=''' ; 查询实例模板上的自定义元数据。; ; 详细操作说明请参考帮助文档:[实例模板](https://docs.jdcloud.com/cn/virtual-machines/instance-template-overview); ; ## 接口说明; - 一般情况下由于自定义元数据比较大,所以限制每次最多查询10个实例模板。; ''', description=''' - 取消共享镜像,只允许操作您的个人私有镜像。; 。 + ; 查询实例模板上的自定义元数据。; ; 详细操作说明请参考帮助文档:[实例模板](https://docs.jdcloud.com/cn/virtual-machines/instance-template-overview); ; ## 接口说明; - 一般情况下由于自定义元数据比较大,所以限制每次最多查询10个实例模板。; 。 - 示例: jdc vm un-share-image --image-id xxx + 示例: jdc vm describe-instance-templates-customdata ''', ) - def un_share_image(self): + def describe_instance_templates_customdata(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.UnShareImageRequest import UnShareImageRequest + from jdcloud_sdk.services.vm.apis.DescribeInstanceTemplatesCustomdataRequest import DescribeInstanceTemplatesCustomdataRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UnShareImageRequest(params_dict, headers) + req = DescribeInstanceTemplatesCustomdataRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -280,30 +283,33 @@ def un_share_image(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--image-id'], dict(help="""(string) 镜像ID """, dest='imageId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;
默认为20;取值范围[10, 100]。 """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) filters 中支持使用以下关键字进行过滤; `keyNames`: 密钥对名称,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 发布社区镜像,只允许操作您的个人私有镜像。发布为社区镜像后会撤销共享关系。
; ''', + help=''' ; 批量查询密钥对。; ; 详细操作说明请参考帮助文档:[密钥概述](https://docs.jdcloud.com/cn/virtual-machines/keypair-overview); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 单次查询最大可查询100条密钥数据。; ''', description=''' - 发布社区镜像,只允许操作您的个人私有镜像。发布为社区镜像后会撤销共享关系。
; 。 + ; 批量查询密钥对。; ; 详细操作说明请参考帮助文档:[密钥概述](https://docs.jdcloud.com/cn/virtual-machines/keypair-overview); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 单次查询最大可查询100条密钥数据。; 。 - 示例: jdc vm release-image --image-id xxx + 示例: jdc vm describe-keypairs ''', ) - def release_image(self): + def describe_keypairs(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.ReleaseImageRequest import ReleaseImageRequest + from jdcloud_sdk.services.vm.apis.DescribeKeypairsRequest import DescribeKeypairsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ReleaseImageRequest(params_dict, headers) + req = DescribeKeypairsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -313,30 +319,31 @@ def release_image(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--image-id'], dict(help="""(string) 镜像ID """, dest='imageId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--key-name'], dict(help="""(string) 密钥对名称,需要全局唯一。; 只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。; """, dest='keyName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 撤销社区镜像,只允许操作您的个人私有镜像。; ''', + help=''' ; 创建密钥。; ; 公钥和私钥都由京东云生成,公钥保存在京东云,私钥返回给用户,由用户保存。; ; 详细操作说明请参考帮助文档:[创建密钥](https://docs.jdcloud.com/cn/virtual-machines/create-keypair); ; ## 接口说明; - 调用该接口创建密钥后,公钥部分存储在京东云,并返回未加密的 `PEM` 编码的 `PKCS#8` 格式私钥,您只有一次机会保存您的私钥。请妥善保管。; ''', description=''' - 撤销社区镜像,只允许操作您的个人私有镜像。; 。 + ; 创建密钥。; ; 公钥和私钥都由京东云生成,公钥保存在京东云,私钥返回给用户,由用户保存。; ; 详细操作说明请参考帮助文档:[创建密钥](https://docs.jdcloud.com/cn/virtual-machines/create-keypair); ; ## 接口说明; - 调用该接口创建密钥后,公钥部分存储在京东云,并返回未加密的 `PEM` 编码的 `PKCS#8` 格式私钥,您只有一次机会保存您的私钥。请妥善保管。; 。 - 示例: jdc vm un-release-image --image-id xxx + 示例: jdc vm create-keypair --key-name xxx ''', ) - def un_release_image(self): + def create_keypair(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.UnReleaseImageRequest import UnReleaseImageRequest + from jdcloud_sdk.services.vm.apis.CreateKeypairRequest import CreateKeypairRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UnReleaseImageRequest(params_dict, headers) + req = CreateKeypairRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -346,30 +353,32 @@ def un_release_image(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--image-id'], dict(help="""(string) 镜像ID """, dest='imageId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--key-name'], dict(help="""(string) 密钥对名称,需要全局唯一。; 只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。; """, dest='keyName', required=True)), + (['--public-key'], dict(help="""(string) 密钥对的公钥部分。 """, dest='publicKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询镜像共享帐户列表,只允许操作您的个人私有镜像。; ''', + help=''' ; 导入密钥。; ; 与创建密钥不同的是,导入的密钥是由用户生成的。生成之后将公钥部分导入到京东云。; ; 详细操作说明请参考帮助文档:[创建密钥](https://docs.jdcloud.com/cn/virtual-machines/create-keypair); ; ## 接口说明; - 调用该接口导入由其他工具生成的密钥对的公钥部分。; ''', description=''' - 查询镜像共享帐户列表,只允许操作您的个人私有镜像。; 。 + ; 导入密钥。; ; 与创建密钥不同的是,导入的密钥是由用户生成的。生成之后将公钥部分导入到京东云。; ; 详细操作说明请参考帮助文档:[创建密钥](https://docs.jdcloud.com/cn/virtual-machines/create-keypair); ; ## 接口说明; - 调用该接口导入由其他工具生成的密钥对的公钥部分。; 。 - 示例: jdc vm describe-image-members --image-id xxx + 示例: jdc vm import-keypair --key-name xxx --public-key xxx ''', ) - def describe_image_members(self): + def import_keypair(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeImageMembersRequest import DescribeImageMembersRequest + from jdcloud_sdk.services.vm.apis.ImportKeypairRequest import ImportKeypairRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeImageMembersRequest(params_dict, headers) + req = ImportKeypairRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -379,31 +388,31 @@ def describe_image_members(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--source-image-ids'], dict(help="""(array: string) 源镜像ID """, dest='sourceImageIds', required=False)), - (['--destination-region'], dict(help="""(string) 目标区域 """, dest='destinationRegion', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--key-name'], dict(help="""(string) 密钥名称。 """, dest='keyName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 镜像跨区复制,将私有镜像复制到其它地域下,只允许操作您的个人私有镜像。
; 只支持rootDeviceType为cloudDisk的云硬盘系统盘镜像操作。; ''', + help=''' ; 删除密钥。; ; 详细操作说明请参考帮助文档:[删除密钥](https://docs.jdcloud.com/cn/virtual-machines/delete-keypair); ; ## 接口说明; - 密钥删除后,使用该密钥的实例仍可正常使用与之匹配的本地私钥登录,且密钥仍会显示在实例详情中。; - 密钥删除后,与之关联的实例模板将变为不可用,并且与该实例模板关联的高可用组也会变为不可用。; ''', description=''' - 镜像跨区复制,将私有镜像复制到其它地域下,只允许操作您的个人私有镜像。
; 只支持rootDeviceType为cloudDisk的云硬盘系统盘镜像操作。; 。 + ; 删除密钥。; ; 详细操作说明请参考帮助文档:[删除密钥](https://docs.jdcloud.com/cn/virtual-machines/delete-keypair); ; ## 接口说明; - 密钥删除后,使用该密钥的实例仍可正常使用与之匹配的本地私钥登录,且密钥仍会显示在实例详情中。; - 密钥删除后,与之关联的实例模板将变为不可用,并且与该实例模板关联的高可用组也会变为不可用。; 。 - 示例: jdc vm copy-images --destination-region xxx + 示例: jdc vm delete-keypair --key-name xxx ''', ) - def copy_images(self): + def delete_keypair(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.CopyImagesRequest import CopyImagesRequest + from jdcloud_sdk.services.vm.apis.DeleteKeypairRequest import DeleteKeypairRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CopyImagesRequest(params_dict, headers) + req = DeleteKeypairRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -413,32 +422,33 @@ def copy_images(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--image-id'], dict(help="""(string) 镜像ID """, dest='imageId', required=True)), - (['--name'], dict(help="""(string) 名称,参考公共参数规范。 """, dest='name', required=False)), - (['--description'], dict(help="""(string) 描述,参考公共参数规范。 """, dest='description', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--key-name'], dict(help="""(string) 密钥名称。 """, dest='keyName', required=True)), + (['--instance-ids'], dict(help="""(array: string) 要绑定的云主机Id列表。 """, dest='instanceIds', required=False)), + (['--pass-word-auth'], dict(help="""(string) 绑定密钥后,根据此参数决定是否允许使用密码登录。可选范围:; `yes`:允许SSH密码登录。; `no`:禁止SSH密码登录。; """, dest='passWordAuth', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改镜像信息,包括名称、描述;只允许操作您的个人私有镜像。; ''', + help=''' ; 为云主机实例绑定密钥。; ; 详细操作说明请参考帮助文档:[绑定密钥](https://docs.jdcloud.com/cn/virtual-machines/bind-keypair); ; ## 接口说明; - 只支持为 linux 云主机实例绑定密钥。; - 每台云主机实例只支持绑定一个密钥。如果云主机绑定的密钥被删除了,那么该云主机还可以再次绑定密钥。; ''', description=''' - 修改镜像信息,包括名称、描述;只允许操作您的个人私有镜像。; 。 + ; 为云主机实例绑定密钥。; ; 详细操作说明请参考帮助文档:[绑定密钥](https://docs.jdcloud.com/cn/virtual-machines/bind-keypair); ; ## 接口说明; - 只支持为 linux 云主机实例绑定密钥。; - 每台云主机实例只支持绑定一个密钥。如果云主机绑定的密钥被删除了,那么该云主机还可以再次绑定密钥。; 。 - 示例: jdc vm modify-image-attribute --image-id xxx + 示例: jdc vm attach-keypair --key-name xxx --pass-word-auth xxx ''', ) - def modify_image_attribute(self): + def attach_keypair(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.ModifyImageAttributeRequest import ModifyImageAttributeRequest + from jdcloud_sdk.services.vm.apis.AttachKeypairRequest import AttachKeypairRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyImageAttributeRequest(params_dict, headers) + req = AttachKeypairRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -448,40 +458,32 @@ def modify_image_attribute(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--architecture'], dict(help="""(string) 系统架构,可选值:x86_64,i386 """, dest='architecture', required=True)), - (['--os-type'], dict(help="""(string) 操作系统,可选值:windows,linux """, dest='osType', required=True)), - (['--platform'], dict(help="""(string) 平台名称,可选值:CentOS,Ubuntu,Windows Server,Other Linux,Other Windows """, dest='platform', required=True)), - (['--disk-format'], dict(help="""(string) 磁盘格式,可选值:qcow2,vhd,vmdk,raw """, dest='diskFormat', required=True)), - (['--system-disk-size-gb'], dict(help="""(int) 以此镜像需要制作的系统盘的默认大小,单位GB。最小值40,最大值500,要求值是10的整数倍 """, dest='systemDiskSizeGB', type=int, required=True)), - (['--image-url'], dict(help="""(string) 要导入镜像的对象存储外链地址 """, dest='imageUrl', required=True)), - (['--os-version'], dict(help="""(string) 镜像的操作系统版本 """, dest='osVersion', required=False)), - (['--image-name'], dict(help="""(string) 导入镜像的自定义名称 """, dest='imageName', required=True)), - (['--description'], dict(help="""(string) 导入镜像的描述信息 """, dest='description', required=False)), - (['--force-import'], dict(help="""(bool) 是否强制导入。强制导入则忽略镜像的合规性检测 """, dest='forceImport', required=False)), - (['--client-token'], dict(help="""(string) 用户导入镜像的幂等性保证。每次创建请传入不同的值,如果传值与某次的clientToken相同,则返还该次的请求结果 """, dest='clientToken', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--key-name'], dict(help="""(string) 密钥名称。 """, dest='keyName', required=True)), + (['--instance-ids'], dict(help="""(array: string) 要解绑的云主机实例ID列表。 """, dest='instanceIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 导入镜像,将外部镜像导入到京东云中; ''', + help=''' ; 为云主机实例解绑密钥。; ; 详细操作说明请参考帮助文档:[绑定密钥](https://docs.jdcloud.com/cn/virtual-machines/bind-keypair); ; ## 接口说明; - 调用该接口解绑云主机实例中的密钥。; ''', description=''' - 导入镜像,将外部镜像导入到京东云中; 。 + ; 为云主机实例解绑密钥。; ; 详细操作说明请参考帮助文档:[绑定密钥](https://docs.jdcloud.com/cn/virtual-machines/bind-keypair); ; ## 接口说明; - 调用该接口解绑云主机实例中的密钥。; 。 - 示例: jdc vm import-image --architecture xxx --os-type xxx --platform xxx --disk-format xxx --system-disk-size-gb 0 --image-url xxx --image-name xxx + 示例: jdc vm detach-keypair --key-name xxx ''', ) - def import_image(self): + def detach_keypair(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.ImportImageRequest import ImportImageRequest + from jdcloud_sdk.services.vm.apis.DetachKeypairRequest import DetachKeypairRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ImportImageRequest(params_dict, headers) + req = DetachKeypairRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -491,34 +493,31 @@ def import_image(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--image-id'], dict(help="""(string) 镜像ID """, dest='imageId', required=True)), - (['--role-name'], dict(help="""(string) 用户创建的服务角色名称 """, dest='roleName', required=True)), - (['--oss-url'], dict(help="""(string) 存储导出镜像文件的oss bucket的域名,请填写以 https:// 开头的完整url """, dest='ossUrl', required=True)), - (['--oss-prefix'], dict(help="""(string) 导出镜像文件名前缀,仅支持英文字母和数字,不能超过32个字符 """, dest='ossPrefix', required=False)), - (['--client-token'], dict(help="""(string) 用户导出镜像的幂等性保证。每次导出请传入不同的值,如果传值与某次的clientToken相同,则返还同一个请求结果,不能超过64个字符 """, dest='clientToken', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--image-id'], dict(help="""(string) 镜像ID。 """, dest='imageId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 导出镜像,将京东云私有镜像导出至京东云以外环境; ''', + help=''' ; 查询镜像详情。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 该接口与查询镜像信息列表返回的信息一致。; - 只需要查询单个镜像信息的时候可以调用该接口。; ''', description=''' - 导出镜像,将京东云私有镜像导出至京东云以外环境; 。 + ; 查询镜像详情。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 该接口与查询镜像信息列表返回的信息一致。; - 只需要查询单个镜像信息的时候可以调用该接口。; 。 - 示例: jdc vm export-image --image-id xxx --role-name xxx --oss-url xxx + 示例: jdc vm describe-image --image-id xxx ''', ) - def export_image(self): + def describe_image(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.ExportImageRequest import ExportImageRequest + from jdcloud_sdk.services.vm.apis.DescribeImageRequest import DescribeImageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ExportImageRequest(params_dict, headers) + req = DescribeImageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -528,36 +527,32 @@ def export_image(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--task-action'], dict(help="""(string) 任务种类。可选值:ImportImage, ExportImage """, dest='taskAction', required=True)), - (['--task-ids'], dict(help="""(array: int) 任务id """, dest='taskIds', type=int, required=False)), - (['--task-status'], dict(help="""(string) 任务状态。可选值:pending,running,failed,finished """, dest='taskStatus', required=False)), - (['--start-time'], dict(help="""(string) 任务开始时间 """, dest='startTime', required=False)), - (['--end-time'], dict(help="""(string) 任务结束时间 """, dest='endTime', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--image-id'], dict(help="""(string) 镜像ID。 """, dest='imageId', required=True)), + (['--delete-snapshot'], dict(help="""(bool) 删除镜像时是否删除关联的快照。默认为 `false`;如果指定为 `true`, 将会删除镜像关联的快照。; """, dest='deleteSnapshot', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询镜像导入导出任务详情; ''', + help=''' ; 删除一个私有镜像。; ; 详细操作说明请参考帮助文档:[删除私有镜像](https://docs.jdcloud.com/cn/virtual-machines/delete-private-image); ; ## 接口说明; - 已共享的私有镜像在取消共享关系前不可以删除,如私有镜像已共享给其他用户,请取消共享后再进行删除。; - 本地系统盘镜像在有基于其创建的云主机时,将无法删除。; - 只能操作私有镜像。; - 私有镜像没有正在处理中的任务时才可以删除。; ''', description=''' - 查询镜像导入导出任务详情; 。 + ; 删除一个私有镜像。; ; 详细操作说明请参考帮助文档:[删除私有镜像](https://docs.jdcloud.com/cn/virtual-machines/delete-private-image); ; ## 接口说明; - 已共享的私有镜像在取消共享关系前不可以删除,如私有镜像已共享给其他用户,请取消共享后再进行删除。; - 本地系统盘镜像在有基于其创建的云主机时,将无法删除。; - 只能操作私有镜像。; - 私有镜像没有正在处理中的任务时才可以删除。; 。 - 示例: jdc vm image-tasks --task-action xxx + 示例: jdc vm delete-image --image-id xxx ''', ) - def image_tasks(self): + def delete_image(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.ImageTasksRequest import ImageTasksRequest + from jdcloud_sdk.services.vm.apis.DeleteImageRequest import DeleteImageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ImageTasksRequest(params_dict, headers) + req = DeleteImageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -567,32 +562,42 @@ def image_tasks(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) instanceId - 云主机ID,精确匹配,支持多个; privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个; az - 可用区,精确匹配,支持多个; vpcId - 私有网络ID,精确匹配,支持多个; status - 云主机状态,精确匹配,支持多个,参考云主机状态; name - 云主机名称,模糊匹配,支持单个; imageId - 镜像ID,精确匹配,支持多个; networkInterfaceId - 弹性网卡ID,精确匹配,支持多个; subnetId - 子网ID,精确匹配,支持多个; agId - 使用可用组id,支持单个; faultDomain - 错误域,支持多个; dedicatedHostId - 专有宿主机ID,精确匹配,支持多个; dedicatedPoolId - 专有宿主机池ID,精确匹配,支持多个; instanceType - 实例规格,精确匹配,支持多个; elasticIpAddress - 公网IP地址,精确匹配,支持单个; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--image-source'], dict(help="""(string) 镜像来源,如果没有指定 `ids` 参数,此参数必传。取值范围:; `public`:官方镜像。; `thirdparty`:镜像市场镜像。; `private`:用户自己的私有镜像。; `shared`:其他用户分享的镜像。; `community`:社区镜像。; """, dest='imageSource', required=False)), + (['--offline'], dict(help="""(bool) 查询已经下线的镜像时使用。; 只有查询 `官方镜像` 或者 `镜像市场镜像` 时,此参数才有意义,其它情况下此参数无效。; 指定 `ids` 查询时,此参数无效。; """, dest='offline', type=bool, required=False)), + (['--platform'], dict(help="""(string) 根据镜像的操作系统发行版查询。; 取值范围:`Ubuntu、CentOS、Windows Server`。; """, dest='platform', required=False)), + (['--ids'], dict(help="""(array: string) 指定镜像ID查询,如果指定了此参数,其它参数可以不传。; """, dest='ids', required=False)), + (['--image-name'], dict(help="""(string) 根据镜像名称模糊查询。 """, dest='imageName', required=False)), + (['--root-device-type'], dict(help="""(string) 根据镜像支持的系统盘类型查询。支持范围:`localDisk` 本地系统盘镜像;`cloudDisk` 云盘系统盘镜像。 """, dest='rootDeviceType', required=False)), + (['--launch-permission'], dict(help="""(string) 根据镜像的使用权限查询,可选参数,仅当 `imageSource` 为 `private` 时有效。取值范围:; `all`:没有限制,所有人均可以使用。; `specifiedUsers`:只有共享用户可以使用。; `ownerOnly`:镜像拥有者自己可以使用。; """, dest='launchPermission', required=False)), + (['--status'], dict(help="""(string) 根据镜像状态查询。参考 [镜像状态](https://docs.jdcloud.com/virtual-machines/api/image_status) """, dest='status', required=False)), + (['--service-code'], dict(help="""(string) 已废弃。 """, dest='serviceCode', required=False)), + (['--architecture'], dict(help="""(string) CPU架构。支持范围:`x86_64`、`arm64`。 """, dest='architecture', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;
默认为20;取值范围[10, 100]。 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量查询云主机的详细信息
; 此接口支持分页查询,默认每页20条。; ''', + help=''' ; 查询镜像信息列表。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 通过此接口可以查询到京东云官方镜像、第三方镜像、镜像市场、私有镜像、或其他用户共享给您的镜像。; - 请求参数即过滤条件,每个条件之间的关系为逻辑与(AND)的关系。; - 如果使用子帐号查询,只会查询到该子帐号有权限的镜像。关于资源权限请参考 [IAM概述](https://docs.jdcloud.com/cn/iam/product-overview)。; - 单次查询最大可查询100条镜像信息。; - 尽量一次调用接口查询多条数据,不建议使用该批量查询接口一次查询一条数据,如果使用不当导致查询过于密集,可能导致网关触发限流。; - 由于该接口为 `GET` 方式请求,最终参数会转换为 `URL` 上的参数,但是 `HTTP` 协议下的 `GET` 请求参数长度是有大小限制的,使用者需要注意参数超长的问题。; ''', description=''' - 批量查询云主机的详细信息
; 此接口支持分页查询,默认每页20条。; 。 + ; 查询镜像信息列表。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 通过此接口可以查询到京东云官方镜像、第三方镜像、镜像市场、私有镜像、或其他用户共享给您的镜像。; - 请求参数即过滤条件,每个条件之间的关系为逻辑与(AND)的关系。; - 如果使用子帐号查询,只会查询到该子帐号有权限的镜像。关于资源权限请参考 [IAM概述](https://docs.jdcloud.com/cn/iam/product-overview)。; - 单次查询最大可查询100条镜像信息。; - 尽量一次调用接口查询多条数据,不建议使用该批量查询接口一次查询一条数据,如果使用不当导致查询过于密集,可能导致网关触发限流。; - 由于该接口为 `GET` 方式请求,最终参数会转换为 `URL` 上的参数,但是 `HTTP` 协议下的 `GET` 请求参数长度是有大小限制的,使用者需要注意参数超长的问题。; 。 - 示例: jdc vm describe-instances + 示例: jdc vm describe-images ''', ) - def describe_instances(self): + def describe_images(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeInstancesRequest import DescribeInstancesRequest + from jdcloud_sdk.services.vm.apis.DescribeImagesRequest import DescribeImagesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstancesRequest(params_dict, headers) + req = DescribeImagesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -602,32 +607,31 @@ def describe_instances(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-spec'], dict(help="""(instanceSpec) 描述云主机配置; """, dest='instanceSpec', required=True)), - (['--max-count'], dict(help="""(int) 购买云主机的数量;取值范围:[1,100],默认为1。; """, dest='maxCount', type=int, required=False)), - (['--client-token'], dict(help="""(string) 用于保证请求的幂等性。由客户端生成,长度不能超过64个字符。; """, dest='clientToken', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--image-id'], dict(help="""(string) 镜像ID。 """, dest='imageId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一台或多台指定配置的云主机,创建模式分为三种:1.普通方式、2.使用高可用组、3.使用启动模板。三种方式创建云主机时参数的必传与非必传是不同的,具体请参考参数详细说明
; - 创建云主机需要通过实名认证; - 实例规格; - 可查询DescribeInstanceTypes接口获得指定地域或可用区的规格信息。; - 不能使用已下线、或已售馨的规格ID; - 镜像; - Windows Server所有镜像CPU不可选超过64核CPU。; - 可查询DescribeImages接口获得指定地域的镜像信息。; - 选择的镜像必须支持选择的实例规格。可查询DescribeImageConstraints接口获得指定镜像的实例规格限制信息。
; - 网络配置; - 指定主网卡配置信息; - 必须指定subnetId; - 可以指定elasticIp规格来约束创建的弹性IP,带宽取值范围[1-200]Mbps,步进1Mbps; - 可以指定主网卡的内网主IP(primaryIpAddress),此时maxCount只能为1; - 安全组securityGroup需与子网Subnet在同一个私有网络VPC内; - 一台云主机创建时必须至少指定一个安全组,至多指定5个安全组,如果没有指定安全组,默认使用默认安全组; - 主网卡deviceIndex设置为1; - 存储; - 系统盘; - 磁盘分类,系统盘支持local或cloud; - 磁盘大小; - local:不能指定大小,默认为40GB; - cloud:取值范围: 40-500GB,并且不能小于镜像的最小系统盘大小,如果没有指定,默认以镜像中的系统盘大小为准; - 自动删除; - 如果是local类型,默认自动删除,不可修改; - 如果是cloud类型的按配置计费的云硬盘,默认为True,可修改; - 如果是cloud类型的包年包月的云硬盘,默认为False,不可修改; - 数据盘; - 磁盘分类,数据盘仅支持cloud; - 云硬盘类型可以选择ssd、premium-hdd、hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - premium-hdd:范围[20,3000]GB,步长为10G; - ssd:范围[20,1000]GB,步长为10G; - hdd.std1、ssd.gp1、ssd.io1: 范围[20-16000]GB,步长为10GB; - 自动删除; - 默认自动删除,如果是包年包月的云硬盘,此参数不生效; - 可以从快照创建磁盘; - iops; - 仅当云盘类型为ssd.io1时,可指定iops值,范围为【200, min(32000,size * 50 )】,步长为10,若不指定则按此公式计算默认值; - local类型系统的云主机可以挂载8块云硬盘; - cloud类型系统的云主机可以挂载7块云硬盘; - 计费; - 弹性IP的计费模式,如果选择按用量类型可以单独设置,其它计费模式都以主机为准; - 云硬盘的计费模式以主机为准; - 其他; - 创建完成后,主机状态为running; - 仅Linux系统云主机可以指定密钥; - maxCount为最大努力,不保证一定能达到maxCount; - 虚机的az会覆盖磁盘的az属性; - 密码; - 参考公共参数规范; ''', + help=''' ; 查询单个镜像的实例规格限制。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 该接口与批量查询镜像的实例规格限制返回的信息一致。; - 通过此接口可以查询镜像的实例规格限制信息。; - 只有官方镜像、第三方镜像有实例规格的限制,用户的私有镜像没有此限制。; ''', description=''' - 创建一台或多台指定配置的云主机,创建模式分为三种:1.普通方式、2.使用高可用组、3.使用启动模板。三种方式创建云主机时参数的必传与非必传是不同的,具体请参考参数详细说明
; - 创建云主机需要通过实名认证; - 实例规格; - 可查询DescribeInstanceTypes接口获得指定地域或可用区的规格信息。; - 不能使用已下线、或已售馨的规格ID; - 镜像; - Windows Server所有镜像CPU不可选超过64核CPU。; - 可查询DescribeImages接口获得指定地域的镜像信息。; - 选择的镜像必须支持选择的实例规格。可查询DescribeImageConstraints接口获得指定镜像的实例规格限制信息。
; - 网络配置; - 指定主网卡配置信息; - 必须指定subnetId; - 可以指定elasticIp规格来约束创建的弹性IP,带宽取值范围[1-200]Mbps,步进1Mbps; - 可以指定主网卡的内网主IP(primaryIpAddress),此时maxCount只能为1; - 安全组securityGroup需与子网Subnet在同一个私有网络VPC内; - 一台云主机创建时必须至少指定一个安全组,至多指定5个安全组,如果没有指定安全组,默认使用默认安全组; - 主网卡deviceIndex设置为1; - 存储; - 系统盘; - 磁盘分类,系统盘支持local或cloud; - 磁盘大小; - local:不能指定大小,默认为40GB; - cloud:取值范围: 40-500GB,并且不能小于镜像的最小系统盘大小,如果没有指定,默认以镜像中的系统盘大小为准; - 自动删除; - 如果是local类型,默认自动删除,不可修改; - 如果是cloud类型的按配置计费的云硬盘,默认为True,可修改; - 如果是cloud类型的包年包月的云硬盘,默认为False,不可修改; - 数据盘; - 磁盘分类,数据盘仅支持cloud; - 云硬盘类型可以选择ssd、premium-hdd、hdd.std1、ssd.gp1、ssd.io1; - 磁盘大小; - premium-hdd:范围[20,3000]GB,步长为10G; - ssd:范围[20,1000]GB,步长为10G; - hdd.std1、ssd.gp1、ssd.io1: 范围[20-16000]GB,步长为10GB; - 自动删除; - 默认自动删除,如果是包年包月的云硬盘,此参数不生效; - 可以从快照创建磁盘; - iops; - 仅当云盘类型为ssd.io1时,可指定iops值,范围为【200, min(32000,size * 50 )】,步长为10,若不指定则按此公式计算默认值; - local类型系统的云主机可以挂载8块云硬盘; - cloud类型系统的云主机可以挂载7块云硬盘; - 计费; - 弹性IP的计费模式,如果选择按用量类型可以单独设置,其它计费模式都以主机为准; - 云硬盘的计费模式以主机为准; - 其他; - 创建完成后,主机状态为running; - 仅Linux系统云主机可以指定密钥; - maxCount为最大努力,不保证一定能达到maxCount; - 虚机的az会覆盖磁盘的az属性; - 密码; - 参考公共参数规范; 。 + ; 查询单个镜像的实例规格限制。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 该接口与批量查询镜像的实例规格限制返回的信息一致。; - 通过此接口可以查询镜像的实例规格限制信息。; - 只有官方镜像、第三方镜像有实例规格的限制,用户的私有镜像没有此限制。; 。 - 示例: jdc vm create-instances --instance-spec '{"":""}' + 示例: jdc vm describe-image-constraints --image-id xxx ''', ) - def create_instances(self): + def describe_image_constraints(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.CreateInstancesRequest import CreateInstancesRequest + from jdcloud_sdk.services.vm.apis.DescribeImageConstraintsRequest import DescribeImageConstraintsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateInstancesRequest(params_dict, headers) + req = DescribeImageConstraintsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -637,33 +641,238 @@ def create_instances(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), - (['--filters'], dict(help="""(array: filter) instanceId - 云主机ID,精确匹配,支持多个; privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个; az - 可用区,精确匹配,支持多个; vpcId - 私有网络ID,精确匹配,支持多个; status - 云主机状态,精确匹配,支持多个,参考云主机状态; name - 云主机名称,模糊匹配,支持单个; imageId - 镜像ID,精确匹配,支持多个; networkInterfaceId - 弹性网卡ID,精确匹配,支持多个; subnetId - 子网ID,精确匹配,支持多个; agId - 使用可用组id,支持单个; faultDomain - 错误域,支持多个; dedicatedHostId - 专有宿主机ID,精确匹配,支持多个; dedicatedPoolId - 专有宿主机池ID,精确匹配,支持多个; instanceType - 实例规格,精确匹配,支持多个; elasticIpAddress - 公网IP地址,精确匹配,支持单个; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--ids'], dict(help="""(array: string) 要查询的镜像ID列表,只支持官方镜像和第三方镜像。 """, dest='ids', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量查询云主机信息的轻量接口,不返回云盘、网络、计费、标签等信息。如果不需要关联资源属性,尽量选择使用该接口。
; 此接口支持分页查询,默认每页20条。; ''', + help=''' ; 批量查询镜像的实例规格限制。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 通过此接口可以查询镜像的实例规格限制信息。; - 只有官方镜像、第三方镜像有实例规格的限制,用户的私有镜像没有此限制。; ''', description=''' - 批量查询云主机信息的轻量接口,不返回云盘、网络、计费、标签等信息。如果不需要关联资源属性,尽量选择使用该接口。
; 此接口支持分页查询,默认每页20条。; 。 + ; 批量查询镜像的实例规格限制。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 通过此接口可以查询镜像的实例规格限制信息。; - 只有官方镜像、第三方镜像有实例规格的限制,用户的私有镜像没有此限制。; 。 - 示例: jdc vm describe-brief-instances + 示例: jdc vm describe-image-constraints-batch ''', ) - def describe_brief_instances(self): + def describe_image_constraints_batch(self): + client_factory = ClientFactory('vm') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vm.apis.DescribeImageConstraintsBatchRequest import DescribeImageConstraintsBatchRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeImageConstraintsBatchRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--image-id'], dict(help="""(string) 镜像ID。 """, dest='imageId', required=True)), + (['--pins'], dict(help="""(array: string) 共享的目标京东云帐户列表。 """, dest='pins', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' ; 共享私有镜像。; ; 详细操作说明请参考帮助文档:[共享私有镜像](https://docs.jdcloud.com/cn/virtual-machines/share-image); ; ## 接口说明; - 只允许共享用户的私有镜像。; - 单个镜像最多可以共享给20个京东云帐户、不可以共享给自己。; - 带有加密快照的打包镜像无法共享。; ''', + description=''' + ; 共享私有镜像。; ; 详细操作说明请参考帮助文档:[共享私有镜像](https://docs.jdcloud.com/cn/virtual-machines/share-image); ; ## 接口说明; - 只允许共享用户的私有镜像。; - 单个镜像最多可以共享给20个京东云帐户、不可以共享给自己。; - 带有加密快照的打包镜像无法共享。; 。 + + 示例: jdc vm share-image --image-id xxx + ''', + ) + def share_image(self): + client_factory = ClientFactory('vm') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vm.apis.ShareImageRequest import ShareImageRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ShareImageRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--image-id'], dict(help="""(string) 镜像ID。 """, dest='imageId', required=True)), + (['--pins'], dict(help="""(array: string) 需要取消的京东云帐户列表。 """, dest='pins', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' ; 取消共享私有镜像。; ; 详细操作说明请参考帮助文档:[取消共享私有镜像](https://docs.jdcloud.com/cn/virtual-machines/cancel-share-image); ; ## 接口说明; - 只允许操作用户的私有镜像。; - 原被共享用户将无法再使用该镜像创建云主机实例,同时使用该镜像创建的云主机实例也无法重置为原始系统状态。; ''', + description=''' + ; 取消共享私有镜像。; ; 详细操作说明请参考帮助文档:[取消共享私有镜像](https://docs.jdcloud.com/cn/virtual-machines/cancel-share-image); ; ## 接口说明; - 只允许操作用户的私有镜像。; - 原被共享用户将无法再使用该镜像创建云主机实例,同时使用该镜像创建的云主机实例也无法重置为原始系统状态。; 。 + + 示例: jdc vm un-share-image --image-id xxx + ''', + ) + def un_share_image(self): + client_factory = ClientFactory('vm') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vm.apis.UnShareImageRequest import UnShareImageRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UnShareImageRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--image-id'], dict(help="""(string) 镜像ID。 """, dest='imageId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' ; 发布社区镜像。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 只允许发布用户的私有镜像。; - 仅支持云盘系统盘的私有镜像。; - 带有加密快照的打包镜像无法发布为社区镜像。; - 发布为社区镜像后会撤销共享关系。; ''', + description=''' + ; 发布社区镜像。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 只允许发布用户的私有镜像。; - 仅支持云盘系统盘的私有镜像。; - 带有加密快照的打包镜像无法发布为社区镜像。; - 发布为社区镜像后会撤销共享关系。; 。 + + 示例: jdc vm release-image --image-id xxx + ''', + ) + def release_image(self): + client_factory = ClientFactory('vm') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vm.apis.ReleaseImageRequest import ReleaseImageRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ReleaseImageRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--image-id'], dict(help="""(string) 镜像ID。 """, dest='imageId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' ; 撤销社区镜像。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 只允许撤销用户的私有镜像。; ''', + description=''' + ; 撤销社区镜像。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 只允许撤销用户的私有镜像。; 。 + + 示例: jdc vm un-release-image --image-id xxx + ''', + ) + def un_release_image(self): + client_factory = ClientFactory('vm') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vm.apis.UnReleaseImageRequest import UnReleaseImageRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UnReleaseImageRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--image-id'], dict(help="""(string) 镜像ID。 """, dest='imageId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' ; 查询私有镜像共享给哪些京东云帐户。; ; 详细操作说明请参考帮助文档:[共享私有镜像](https://docs.jdcloud.com/cn/virtual-machines/share-image); ; ## 接口说明; - 只允许查询用户的私有镜像。; ''', + description=''' + ; 查询私有镜像共享给哪些京东云帐户。; ; 详细操作说明请参考帮助文档:[共享私有镜像](https://docs.jdcloud.com/cn/virtual-machines/share-image); ; ## 接口说明; - 只允许查询用户的私有镜像。; 。 + + 示例: jdc vm describe-image-members --image-id xxx + ''', + ) + def describe_image_members(self): + client_factory = ClientFactory('vm') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vm.apis.DescribeImageMembersRequest import DescribeImageMembersRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeImageMembersRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--source-image-ids'], dict(help="""(array: string) 要复制的私有镜像ID列表,最多支持10个。 """, dest='sourceImageIds', required=False)), + (['--destination-region'], dict(help="""(string) 目标地域。 """, dest='destinationRegion', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' ; 镜像跨地域复制。; ; 详细操作说明请参考帮助文档:[镜像复制](https://docs.jdcloud.com/cn/virtual-machines/copy-image); ; ## 接口说明; - 调用该接口将私有镜像复制到其它地域下。; - 只支持云盘系统盘的镜像。; - 不支持带有加密快照的镜像。; ''', + description=''' + ; 镜像跨地域复制。; ; 详细操作说明请参考帮助文档:[镜像复制](https://docs.jdcloud.com/cn/virtual-machines/copy-image); ; ## 接口说明; - 调用该接口将私有镜像复制到其它地域下。; - 只支持云盘系统盘的镜像。; - 不支持带有加密快照的镜像。; 。 + + 示例: jdc vm copy-images --destination-region xxx + ''', + ) + def copy_images(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeBriefInstancesRequest import DescribeBriefInstancesRequest + from jdcloud_sdk.services.vm.apis.CopyImagesRequest import CopyImagesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeBriefInstancesRequest(params_dict, headers) + req = CopyImagesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -673,30 +882,33 @@ def describe_brief_instances(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--image-id'], dict(help="""(string) 镜像ID。 """, dest='imageId', required=True)), + (['--name'], dict(help="""(string) 镜像名称。参考 [公共参数规范](https://docs.jdcloud.com/virtual-machines/api/general_parameters)。 """, dest='name', required=False)), + (['--description'], dict(help="""(string) 镜像描述。参考 [公共参数规范](https://docs.jdcloud.com/virtual-machines/api/general_parameters)。 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询一台云主机的详细信息; ''', + help=''' ; 修改镜像属性。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 只支持修改镜像名称或描述。; ''', description=''' - 查询一台云主机的详细信息; 。 + ; 修改镜像属性。; ; 详细操作说明请参考帮助文档:[镜像概述](https://docs.jdcloud.com/cn/virtual-machines/image-overview); ; ## 接口说明; - 只支持修改镜像名称或描述。; 。 - 示例: jdc vm describe-instance --instance-id xxx + 示例: jdc vm modify-image-attribute --image-id xxx ''', ) - def describe_instance(self): + def modify_image_attribute(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeInstanceRequest import DescribeInstanceRequest + from jdcloud_sdk.services.vm.apis.ModifyImageAttributeRequest import ModifyImageAttributeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceRequest(params_dict, headers) + req = ModifyImageAttributeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -706,30 +918,41 @@ def describe_instance(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--architecture'], dict(help="""(string) 镜像架构。取值范围:`x86_64、arm64`。 """, dest='architecture', required=True)), + (['--os-type'], dict(help="""(string) 镜像的操作系统类型。取值范围:`windows、linux`。 """, dest='osType', required=True)), + (['--platform'], dict(help="""(string) 镜像的操作系统平台名称。; 取值范围:`Ubuntu、CentOS、Windows Server、Other Linux、Other Windows`。; """, dest='platform', required=True)), + (['--disk-format'], dict(help="""(string) 磁盘格式,取值范围:`qcow2、vhd、vmdk、raw`。 """, dest='diskFormat', required=True)), + (['--system-disk-size-gb'], dict(help="""(int) 以此镜像需要制作的系统盘的默认大小,单位GB。最小值40,最大值500,要求值是10的整数倍。 """, dest='systemDiskSizeGB', type=int, required=True)), + (['--image-url'], dict(help="""(string) 要导入镜像的对象存储外链地址。 """, dest='imageUrl', required=True)), + (['--os-version'], dict(help="""(string) 镜像的操作系统版本。 """, dest='osVersion', required=False)), + (['--image-name'], dict(help="""(string) 导入镜像的自定义名称。参考 [公共参数规范](https://docs.jdcloud.com/virtual-machines/api/general_parameters)。 """, dest='imageName', required=True)), + (['--description'], dict(help="""(string) 导入镜像的描述信息。参考 [公共参数规范](https://docs.jdcloud.com/virtual-machines/api/general_parameters)。 """, dest='description', required=False)), + (['--force-import'], dict(help="""(bool) 是否强制导入。强制导入会忽略镜像的合规性检测。默认为false。 """, dest='forceImport', type=bool, required=False)), + (['--client-token'], dict(help="""(string) 用户导出镜像的幂等性保证。每次导出请传入不同的值,如果传值与某次的clientToken相同,则返还同一个请求结果,不能超过64个字符。 """, dest='clientToken', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除按配置计费、或包年包月已到期的单个云主机。不能删除没有计费信息的云主机。
; 云主机状态必须为运行running、停止stopped、错误error,同时云主机没有正在进行中的任务才可删除。
; 如果主机中挂载的数据盘为按配置计费的云硬盘且AutoDelete属性为true,那么数据盘会随主机一起删除。; [MFA enabled] ''', + help=''' ; 导入私有镜像。; ; 详细操作说明请参考帮助文档:[导入私有镜像](https://docs.jdcloud.com/cn/virtual-machines/import-private-image); ; ## 接口说明; - 当前仅支持导入系统盘镜像。; - 导入后的镜像将以 `云硬盘系统盘镜像` 格式作为私有镜像使用,同时会自动生成一个与导入镜像关联的快照。; ''', description=''' - 删除按配置计费、或包年包月已到期的单个云主机。不能删除没有计费信息的云主机。
; 云主机状态必须为运行running、停止stopped、错误error,同时云主机没有正在进行中的任务才可删除。
; 如果主机中挂载的数据盘为按配置计费的云硬盘且AutoDelete属性为true,那么数据盘会随主机一起删除。; [MFA enabled]。 + ; 导入私有镜像。; ; 详细操作说明请参考帮助文档:[导入私有镜像](https://docs.jdcloud.com/cn/virtual-machines/import-private-image); ; ## 接口说明; - 当前仅支持导入系统盘镜像。; - 导入后的镜像将以 `云硬盘系统盘镜像` 格式作为私有镜像使用,同时会自动生成一个与导入镜像关联的快照。; 。 - 示例: jdc vm delete-instance --instance-id xxx + 示例: jdc vm import-image --architecture xxx --os-type xxx --platform xxx --disk-format xxx --system-disk-size-gb 5 --image-url xxx --image-name xxx ''', ) - def delete_instance(self): + def import_image(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DeleteInstanceRequest import DeleteInstanceRequest + from jdcloud_sdk.services.vm.apis.ImportImageRequest import ImportImageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteInstanceRequest(params_dict, headers) + req = ImportImageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -739,32 +962,35 @@ def delete_instance(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) instanceId - 云主机ID,精确匹配,支持多个; privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个; vpcId - 私有网络ID,精确匹配,支持多个; status - 云主机状态,精确匹配,支持多个,参考云主机状态; name - 云主机名称,模糊匹配,支持单个; imageId - 镜像ID,精确匹配,支持多个; networkInterfaceId - 弹性网卡ID,精确匹配,支持多个; subnetId - 子网ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--image-id'], dict(help="""(string) 镜像ID。 """, dest='imageId', required=True)), + (['--role-name'], dict(help="""(string) 用户创建的服务角色名称。 """, dest='roleName', required=True)), + (['--oss-url'], dict(help="""(string) 存储导出镜像文件的 `oss bucket` 的域名,请填写以 https:// 开头的完整url。 """, dest='ossUrl', required=True)), + (['--oss-prefix'], dict(help="""(string) 导出镜像文件名前缀,仅支持英文字母和数字,不能超过32个字符。 """, dest='ossPrefix', required=False)), + (['--client-token'], dict(help="""(string) 用户导出镜像的幂等性保证。每次导出请传入不同的值,如果传值与某次的clientToken相同,则返还同一个请求结果,不能超过64个字符。 """, dest='clientToken', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量查询云主机状态 ''', + help=''' ; 导出私有镜像。; ; 将京东云私有镜像导出至京东云以外环境。; ; 详细操作说明请参考帮助文档:[导出私有镜像](https://docs.jdcloud.com/cn/virtual-machines/export-private-image); ; ## 接口说明; - 调用此接口将私有镜像导出到京东云对象存储空间中。; - 仅支持系统盘镜像导出,即使镜像有关联的数据盘快照,也仅会导出系统盘镜像文件。; - 导出的镜像文件格式为QCOW2。; - `Windows Server` 操作系统的镜像不支持导出(若镜像来源为导入镜像,则无此限制)。; - 镜像必须为 `云硬盘系统盘` 镜像,如您的镜像是 `本地盘系统盘` 镜像,可以通过镜像类型转换功能转换为云盘系统盘镜像后再导出。; ''', description=''' - 批量查询云主机状态。 + ; 导出私有镜像。; ; 将京东云私有镜像导出至京东云以外环境。; ; 详细操作说明请参考帮助文档:[导出私有镜像](https://docs.jdcloud.com/cn/virtual-machines/export-private-image); ; ## 接口说明; - 调用此接口将私有镜像导出到京东云对象存储空间中。; - 仅支持系统盘镜像导出,即使镜像有关联的数据盘快照,也仅会导出系统盘镜像文件。; - 导出的镜像文件格式为QCOW2。; - `Windows Server` 操作系统的镜像不支持导出(若镜像来源为导入镜像,则无此限制)。; - 镜像必须为 `云硬盘系统盘` 镜像,如您的镜像是 `本地盘系统盘` 镜像,可以通过镜像类型转换功能转换为云盘系统盘镜像后再导出。; 。 - 示例: jdc vm describe-instance-status + 示例: jdc vm export-image --image-id xxx --role-name xxx --oss-url xxx ''', ) - def describe_instance_status(self): + def export_image(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeInstanceStatusRequest import DescribeInstanceStatusRequest + from jdcloud_sdk.services.vm.apis.ExportImageRequest import ExportImageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceStatusRequest(params_dict, headers) + req = ExportImageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -774,32 +1000,37 @@ def describe_instance_status(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) instanceId - 云主机ID,精确匹配,支持多个; privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个; vpcId - 私有网络ID,精确匹配,支持多个; status - 云主机状态,精确匹配,支持多个,参考云主机状态; name - 云主机名称,模糊匹配,支持单个; imageId - 镜像ID,精确匹配,支持多个; networkInterfaceId - 弹性网卡ID,精确匹配,支持多个; subnetId - 子网ID,精确匹配,支持多个; chargeOnStopped - 停机不计费标志,keepCharging、stopCharging 或者 notApplicable; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--task-action'], dict(help="""(string) 任务操作类型。支持范围:`ImportImage、ExportImage`。 """, dest='taskAction', required=False)), + (['--task-ids'], dict(help="""(array: string) 任务id列表。 """, dest='taskIds', required=False)), + (['--task-status'], dict(help="""(string) 任务状态。支持范围:`pending、running、failed、finished`。 """, dest='taskStatus', required=False)), + (['--start-time'], dict(help="""(string) 任务开始时间 """, dest='startTime', required=False)), + (['--end-time'], dict(help="""(string) 任务结束时间 """, dest='endTime', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;取值范围[10, 100]。 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量查询云主机内网IP地址,查询的是主网卡内网主IP地址。 ''', + help=''' ; 查询镜像任务详情。; ; 将京东云私有镜像导出至京东云以外环境。; ; 详细操作说明请参考帮助文档:; [导入私有镜像](https://docs.jdcloud.com/cn/virtual-machines/import-private-image); [导出私有镜像](https://docs.jdcloud.com/cn/virtual-machines/export-private-image); ; ## 接口说明; - 调用该接口可查询镜像导入或导出的任务详情。; ''', description=''' - 批量查询云主机内网IP地址,查询的是主网卡内网主IP地址。。 + ; 查询镜像任务详情。; ; 将京东云私有镜像导出至京东云以外环境。; ; 详细操作说明请参考帮助文档:; [导入私有镜像](https://docs.jdcloud.com/cn/virtual-machines/import-private-image); [导出私有镜像](https://docs.jdcloud.com/cn/virtual-machines/export-private-image); ; ## 接口说明; - 调用该接口可查询镜像导入或导出的任务详情。; 。 - 示例: jdc vm describe-instance-private-ip-address + 示例: jdc vm image-tasks ''', ) - def describe_instance_private_ip_address(self): + def image_tasks(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeInstancePrivateIpAddressRequest import DescribeInstancePrivateIpAddressRequest + from jdcloud_sdk.services.vm.apis.ImageTasksRequest import ImageTasksRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstancePrivateIpAddressRequest(params_dict, headers) + req = ImageTasksRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -809,31 +1040,32 @@ def describe_instance_private_ip_address(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--charge-on-stopped'], dict(help="""(string) 关机模式,只支持云盘做系统盘的按配置计费云主机keepCharging:关机后继续计费;stopCharging:关机后停止计费。 """, dest='chargeOnStopped', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--filters'], dict(help="""(array: filter) filters 中支持使用以下关键字进行过滤; `resourceTypes`: 资源类型,支持多个,可选范围:`instance、instance_cpu、instance_memory、instance_local_disk、keypair、image、instanceTemplate、imageShare`; """, dest='filters', required=False)), + (['--image-id'], dict(help="""(string) 私有镜像Id。; 查询镜像共享 `imageShare` 的配额时,此参数必传。; """, dest='imageId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 停止单个云主机,只能停止running状态的云主机,云主机没有正在进行中的任务才可停止; ''', + help=''' ; 查询资源配额。; ; ## 接口说明; - 调用该接口可查询 `云主机`、`云主机的CPU`、`云主机的内存`、`云主机的本地盘`、`镜像`、`密钥`、`实例模板`、`镜像共享` 的配额。; ''', description=''' - 停止单个云主机,只能停止running状态的云主机,云主机没有正在进行中的任务才可停止; 。 + ; 查询资源配额。; ; ## 接口说明; - 调用该接口可查询 `云主机`、`云主机的CPU`、`云主机的内存`、`云主机的本地盘`、`镜像`、`密钥`、`实例模板`、`镜像共享` 的配额。; 。 - 示例: jdc vm stop-instance --instance-id xxx + 示例: jdc vm describe-quotas ''', ) - def stop_instance(self): + def describe_quotas(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.StopInstanceRequest import StopInstanceRequest + from jdcloud_sdk.services.vm.apis.DescribeQuotasRequest import DescribeQuotasRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StopInstanceRequest(params_dict, headers) + req = DescribeQuotasRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -843,30 +1075,34 @@ def stop_instance(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;
默认为20;取值范围[10, 100]。 """, dest='pageSize', type=int, required=False)), + (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件。 """, dest='tags', required=False)), + (['--filters'], dict(help="""(array: filter) filters 中支持使用以下关键字进行过滤; `instanceId`: 云主机ID,精确匹配,支持多个; `privateIpAddress`: 云主机挂载的网卡内网主IP地址,模糊匹配,支持多个; `az`: 可用区,精确匹配,支持多个; `vpcId`: 私有网络ID,精确匹配,支持多个; `status`: 云主机状态,精确匹配,支持多个,参考 [云主机状态](https://docs.jdcloud.com/virtual-machines/api/vm_status); `name`: 云主机名称,模糊匹配,支持单个; `imageId`: 镜像ID,精确匹配,支持多个; `networkInterfaceId`: 弹性网卡ID,精确匹配,支持多个; `subnetId`: 子网ID,精确匹配,支持多个; `agId`: 使用可用组id,支持单个; `faultDomain`: 错误域,支持多个; `dedicatedHostId`: 专有宿主机ID,精确匹配,支持多个; `dedicatedPoolId`: 专有宿主机池ID,精确匹配,支持多个; `instanceType`: 实例规格,精确匹配,支持多个,可通过查询 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes) 接口获得实例规格; `elasticIpAddress`: 公网IP地址,精确匹配,支持单个。该条件会将公网IP转换成 `networkInterfaceId` 进行查询,所以与 `networkInterfaceId` 为或者的关系。; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 启动单个云主机,只能启动stopped状态的云主机,云主机没有正在进行中的任务才可启动。
; 只能启动正常计费状态的云主机,若已欠费停服或到期停服则不支持启动。; ''', + help=''' ; 查询一台或多台云主机实例的详细信息。; ; 详细操作说明请参考帮助文档:[查找实例](https://docs.jdcloud.com/cn/virtual-machines/search-instance); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 如果使用子帐号查询,只会查询到该子帐号有权限的云主机实例。关于资源权限请参考 [IAM概述](https://docs.jdcloud.com/cn/iam/product-overview)。; - 单次查询最大可查询100条云主机实例数据。; - 尽量一次调用接口查询多条数据,不建议使用该批量查询接口一次查询一条数据,如果使用不当导致查询过于密集,可能导致网关触发限流。; - 由于该接口为 `GET` 方式请求,最终参数会转换为 `URL` 上的参数,但是 `HTTP` 协议下的 `GET` 请求参数长度是有大小限制的,使用者需要注意参数超长的问题。; ''', description=''' - 启动单个云主机,只能启动stopped状态的云主机,云主机没有正在进行中的任务才可启动。
; 只能启动正常计费状态的云主机,若已欠费停服或到期停服则不支持启动。; 。 + ; 查询一台或多台云主机实例的详细信息。; ; 详细操作说明请参考帮助文档:[查找实例](https://docs.jdcloud.com/cn/virtual-machines/search-instance); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 如果使用子帐号查询,只会查询到该子帐号有权限的云主机实例。关于资源权限请参考 [IAM概述](https://docs.jdcloud.com/cn/iam/product-overview)。; - 单次查询最大可查询100条云主机实例数据。; - 尽量一次调用接口查询多条数据,不建议使用该批量查询接口一次查询一条数据,如果使用不当导致查询过于密集,可能导致网关触发限流。; - 由于该接口为 `GET` 方式请求,最终参数会转换为 `URL` 上的参数,但是 `HTTP` 协议下的 `GET` 请求参数长度是有大小限制的,使用者需要注意参数超长的问题。; 。 - 示例: jdc vm start-instance --instance-id xxx + 示例: jdc vm describe-instances ''', ) - def start_instance(self): + def describe_instances(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.StartInstanceRequest import StartInstanceRequest + from jdcloud_sdk.services.vm.apis.DescribeInstancesRequest import DescribeInstancesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = StartInstanceRequest(params_dict, headers) + req = DescribeInstancesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -876,30 +1112,33 @@ def start_instance(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-spec'], dict(help="""(instanceSpec) 实例配置。; """, dest='instanceSpec', required=True)), + (['--max-count'], dict(help="""(int) 创建实例的数量,不能超过用户配额。; 取值范围:[1,100];默认值:1。; 如果在弹性网卡中指定了内网IP地址,那么单次创建 `maxCount` 只能是 1。; """, dest='maxCount', type=int, required=False)), + (['--client-token'], dict(help="""(string) 用于保证请求的幂等性。由客户端生成,并确保不同请求中该参数唯一,长度不能超过64个字符。; """, dest='clientToken', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 重启单个云主机,只能重启running状态的云主机,云主机没有正在进行中的任务才可重启。; ''', + help=''' ; 创建一台或多台指定配置的云主机实例。; ; 实例有三种创建方式,不同方式下传参详见下方的请求[参数说明](createInstance#requestparameters),也可参考请求[示例](createInstance#examples)。; ; 1、自定义创建:按配置要求逐一指定参数创建;; 2、使用实例模板创建:[实例模板](https://docs.jdcloud.com/virtual-machines/instance-template-overview)是实例配置信息的预配置,通过实例模板可快速创建实例,省去逐一配置参数的步骤。指定实例模板创建时,如不额外指定模板包含的参数将以模板为准创建实例,模板中未包含的参数,如可用区、内网IPv4地址、名称等仍需指定;; 3、基于高可用组创建:[高可用组](https://docs.jdcloud.com/availability-group/product-overview)是一种高可用部署解决方案,提供了组内实例在数据中心内横跨多个故障域均衡部署的机制。高可用组须搭配实例模板使用,基于高可用组创建的实例将在其指定的可用区内以实例模板配置按一定分散机制创建实例。此创建方式下,实例创建参数除内网IPv4地址、名称等外均以实例模板为准且不支持再次指定。; ; 详细操作说明请参考帮助文档:[创建实例](https://docs.jdcloud.com/cn/virtual-machines/create-instance); ; ## 接口说明; - 创建实例前,请参考 [创建前准备](https://docs.jdcloud.com/virtual-machines/account-preparation-linux) 完成实名认证、支付方式确认、计费类型选择等准备工作。; - 创建实例的配置说明和选择指导,请参考 [配置项说明](https://docs.jdcloud.com/cn/virtual-machines/select-configuration-linux)。; - 各地域下实例及关联资源(云硬盘、弹性公网IP)的可创建数量受配额限制,创建前请通过 [DescribeQuotas](https://docs.jdcloud.com/cn/virtual-machines/api/describequotas?content=API) 确认配额,如须提升请[提交工单](https://ticket.jdcloud.com/applyorder/submit)或联系京东云客服。; - 不同地域及可用区下售卖的实例规格有差异,可通过 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes?content=API) 查询在售规格及规格详细信息。; - 通过本接口创建包年包月实例时将自动从账户扣款(代金券优先),如需使用第三方支付方式请通过控制台创建。; - 单次请求最多支持创建 `100` 台实例。; - 本接口为异步接口,请求下发成功后会返回RequestId和实例ID,此时实例处于 `Pending`(创建中)状态。如创建成功则实例自动变为 `Running`(运行中)状态;如创建失败则短暂处于 `Error`(错误)状态,随后将自动删除(创建失败的实例不会收费且会自动释放占用的配额)。实例状态可以通过 [describeInstanceStatus](https://docs.jdcloud.com/virtual-machines/api/describeinstancestatus?content=API) 接口查询。; - 批量创建多台实例时系统将尽可能完成目标创建数量,但受底层资源、配额等因素影响,可能存在部分成功部分失败的情况,还请关注最终完成数量,如有失败情况请尝试重新申请或联系客服。; ''', description=''' - 重启单个云主机,只能重启running状态的云主机,云主机没有正在进行中的任务才可重启。; 。 + ; 创建一台或多台指定配置的云主机实例。; ; 实例有三种创建方式,不同方式下传参详见下方的请求[参数说明](createInstance#requestparameters),也可参考请求[示例](createInstance#examples)。; ; 1、自定义创建:按配置要求逐一指定参数创建;; 2、使用实例模板创建:[实例模板](https://docs.jdcloud.com/virtual-machines/instance-template-overview)是实例配置信息的预配置,通过实例模板可快速创建实例,省去逐一配置参数的步骤。指定实例模板创建时,如不额外指定模板包含的参数将以模板为准创建实例,模板中未包含的参数,如可用区、内网IPv4地址、名称等仍需指定;; 3、基于高可用组创建:[高可用组](https://docs.jdcloud.com/availability-group/product-overview)是一种高可用部署解决方案,提供了组内实例在数据中心内横跨多个故障域均衡部署的机制。高可用组须搭配实例模板使用,基于高可用组创建的实例将在其指定的可用区内以实例模板配置按一定分散机制创建实例。此创建方式下,实例创建参数除内网IPv4地址、名称等外均以实例模板为准且不支持再次指定。; ; 详细操作说明请参考帮助文档:[创建实例](https://docs.jdcloud.com/cn/virtual-machines/create-instance); ; ## 接口说明; - 创建实例前,请参考 [创建前准备](https://docs.jdcloud.com/virtual-machines/account-preparation-linux) 完成实名认证、支付方式确认、计费类型选择等准备工作。; - 创建实例的配置说明和选择指导,请参考 [配置项说明](https://docs.jdcloud.com/cn/virtual-machines/select-configuration-linux)。; - 各地域下实例及关联资源(云硬盘、弹性公网IP)的可创建数量受配额限制,创建前请通过 [DescribeQuotas](https://docs.jdcloud.com/cn/virtual-machines/api/describequotas?content=API) 确认配额,如须提升请[提交工单](https://ticket.jdcloud.com/applyorder/submit)或联系京东云客服。; - 不同地域及可用区下售卖的实例规格有差异,可通过 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes?content=API) 查询在售规格及规格详细信息。; - 通过本接口创建包年包月实例时将自动从账户扣款(代金券优先),如需使用第三方支付方式请通过控制台创建。; - 单次请求最多支持创建 `100` 台实例。; - 本接口为异步接口,请求下发成功后会返回RequestId和实例ID,此时实例处于 `Pending`(创建中)状态。如创建成功则实例自动变为 `Running`(运行中)状态;如创建失败则短暂处于 `Error`(错误)状态,随后将自动删除(创建失败的实例不会收费且会自动释放占用的配额)。实例状态可以通过 [describeInstanceStatus](https://docs.jdcloud.com/virtual-machines/api/describeinstancestatus?content=API) 接口查询。; - 批量创建多台实例时系统将尽可能完成目标创建数量,但受底层资源、配额等因素影响,可能存在部分成功部分失败的情况,还请关注最终完成数量,如有失败情况请尝试重新申请或联系客服。; 。 - 示例: jdc vm reboot-instance --instance-id xxx + 示例: jdc vm create-instances --instance-spec '{"":""}' ''', ) - def reboot_instance(self): + def create_instances(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.RebootInstanceRequest import RebootInstanceRequest + from jdcloud_sdk.services.vm.apis.CreateInstancesRequest import CreateInstancesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RebootInstanceRequest(params_dict, headers) + req = CreateInstancesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -909,32 +1148,34 @@ def reboot_instance(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--network-interface-id'], dict(help="""(string) 弹性网卡ID """, dest='networkInterfaceId', required=True)), - (['--auto-delete'], dict(help="""(bool) 随云主机删除而自动删除,默认为False """, dest='autoDelete', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;
默认为20;取值范围[10, 100]。 """, dest='pageSize', type=int, required=False)), + (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), + (['--filters'], dict(help="""(array: filter) filters 中支持使用以下关键字进行过滤; `instanceId`: 云主机ID,精确匹配,支持多个; `privateIpAddress`: 云主机挂载的网卡内网主IP地址,模糊匹配,支持多个; `az`: 可用区,精确匹配,支持多个; `vpcId`: 私有网络ID,精确匹配,支持多个; `status`: 云主机状态,精确匹配,支持多个,参考 [云主机状态](https://docs.jdcloud.com/virtual-machines/api/vm_status); `name`: 云主机名称,模糊匹配,支持单个; `imageId`: 镜像ID,精确匹配,支持多个; `networkInterfaceId`: 弹性网卡ID,精确匹配,支持多个; `subnetId`: 子网ID,精确匹配,支持多个; `agId`: 使用可用组id,支持单个; `faultDomain`: 错误域,支持多个; `dedicatedHostId`: 专有宿主机ID,精确匹配,支持多个; `dedicatedPoolId`: 专有宿主机池ID,精确匹配,支持多个; `instanceType`: 实例规格,精确匹配,支持多个,可通过查询 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes) 接口获得实例规格; `elasticIpAddress`: 公网IP地址,精确匹配,支持单个。该条件会将公网IP转换成 `networkInterfaceId` 进行查询,所以与 `networkInterfaceId` 为或者的关系。; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 云主机绑定一块弹性网卡。
; 云主机状态必须为runningstopped状态,并且没有正在进行中的任务才可操作。
; 弹性网卡上如果绑定了弹性公网IP,那么其所在az需要与云主机的az保持一致,或者为全可用区型弹性公网IP,才可挂载该网卡。
; 云主机挂载弹性网卡的数量,不能超过实例规格的限制。可查询DescribeInstanceTypes接口获得指定规格可挂载弹性网卡的数量上限。
; 弹性网卡与云主机必须在相同vpc下。; ''', + help=''' ; 查询一台或多台云主机实例的详细信息。该接口为轻量级接口,不返回云盘、网络、计费、标签等关联信息。如果不需要关联资源属性,尽量选择使用该接口。; ; 详细操作说明请参考帮助文档:[查找实例](https://docs.jdcloud.com/cn/virtual-machines/search-instance); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 如果使用子帐号查询,只会查询到该子帐号有权限的云主机实例。关于资源权限请参考 [IAM概述](https://docs.jdcloud.com/cn/iam/product-overview)。; - 单次查询最大可查询100条云主机实例数据。; - 尽量一次调用接口查询多条数据,不建议使用该批量查询接口一次查询一条数据,如果使用不当导致查询过于密集,可能导致网关触发限流。; - 由于该接口为 `GET` 方式请求,最终参数会转换为 `URL` 上的参数,但是 `HTTP` 协议下的 `GET` 请求参数长度是有大小限制的,使用者需要注意参数超长的问题。; ''', description=''' - 云主机绑定一块弹性网卡。
; 云主机状态必须为runningstopped状态,并且没有正在进行中的任务才可操作。
; 弹性网卡上如果绑定了弹性公网IP,那么其所在az需要与云主机的az保持一致,或者为全可用区型弹性公网IP,才可挂载该网卡。
; 云主机挂载弹性网卡的数量,不能超过实例规格的限制。可查询DescribeInstanceTypes接口获得指定规格可挂载弹性网卡的数量上限。
; 弹性网卡与云主机必须在相同vpc下。; 。 + ; 查询一台或多台云主机实例的详细信息。该接口为轻量级接口,不返回云盘、网络、计费、标签等关联信息。如果不需要关联资源属性,尽量选择使用该接口。; ; 详细操作说明请参考帮助文档:[查找实例](https://docs.jdcloud.com/cn/virtual-machines/search-instance); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 如果使用子帐号查询,只会查询到该子帐号有权限的云主机实例。关于资源权限请参考 [IAM概述](https://docs.jdcloud.com/cn/iam/product-overview)。; - 单次查询最大可查询100条云主机实例数据。; - 尽量一次调用接口查询多条数据,不建议使用该批量查询接口一次查询一条数据,如果使用不当导致查询过于密集,可能导致网关触发限流。; - 由于该接口为 `GET` 方式请求,最终参数会转换为 `URL` 上的参数,但是 `HTTP` 协议下的 `GET` 请求参数长度是有大小限制的,使用者需要注意参数超长的问题。; 。 - 示例: jdc vm attach-network-interface --instance-id xxx --network-interface-id xxx + 示例: jdc vm describe-brief-instances ''', ) - def attach_network_interface(self): + def describe_brief_instances(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.AttachNetworkInterfaceRequest import AttachNetworkInterfaceRequest + from jdcloud_sdk.services.vm.apis.DescribeBriefInstancesRequest import DescribeBriefInstancesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AttachNetworkInterfaceRequest(params_dict, headers) + req = DescribeBriefInstancesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -944,31 +1185,31 @@ def attach_network_interface(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--network-interface-id'], dict(help="""(string) 弹性网卡ID """, dest='networkInterfaceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 云主机缷载一块弹性网卡。
; 云主机状态必须为runningstopped状态,并且没有正在进行中的任务才可操作。
; 不能缷载主网卡。; ''', + help=''' ; 查询一台云主机实例的详细信息。; ; 详细操作说明请参考帮助文档:[查找实例](https://docs.jdcloud.com/cn/virtual-machines/search-instance); ; ## 接口说明; - 该接口与查询云主机列表返回的信息一致。; - 只需要查询单个云主机实例详细信息的时候可以调用该接口。; ''', description=''' - 云主机缷载一块弹性网卡。
; 云主机状态必须为runningstopped状态,并且没有正在进行中的任务才可操作。
; 不能缷载主网卡。; 。 + ; 查询一台云主机实例的详细信息。; ; 详细操作说明请参考帮助文档:[查找实例](https://docs.jdcloud.com/cn/virtual-machines/search-instance); ; ## 接口说明; - 该接口与查询云主机列表返回的信息一致。; - 只需要查询单个云主机实例详细信息的时候可以调用该接口。; 。 - 示例: jdc vm detach-network-interface --instance-id xxx --network-interface-id xxx + 示例: jdc vm describe-instance --instance-id xxx ''', ) - def detach_network_interface(self): + def describe_instance(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DetachNetworkInterfaceRequest import DetachNetworkInterfaceRequest + from jdcloud_sdk.services.vm.apis.DescribeInstanceRequest import DescribeInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DetachNetworkInterfaceRequest(params_dict, headers) + req = DescribeInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -978,31 +1219,31 @@ def detach_network_interface(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--networks'], dict(help="""(array: instanceNetworkAttribute) 弹性网卡列表 """, dest='networks', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改虚机弹性网卡属性,包括是否随云主机一起删除。
; 不能修改主网卡。; ''', + help=''' ; 删除一台云主机实例。; ; 详细操作说明请参考帮助文档:[删除实例](https://docs.jdcloud.com/cn/virtual-machines/delete-instance); ; ## 接口说明; - 不可以删除包年包月未到期的云主机。如果云主机为包年包月已到期的,并且用户处于白名单中,也不允许删除。; - 不可以删除没有计费信息的云主机,该情况只限于创建过程中出现了异常。; - 云主机状态必须为运行 `running`、停止 `stopped`、错误 `error`、状态,同时云主机没有正在进行中的任务才可以删除。; - 如果云主机中挂载的数据盘为按配置计费的云硬盘且 `AutoDelete` 属性为 `true`,那么数据盘会随云主机一起删除。; - 云主机中绑定的弹性公网IP不会随云主机一起删除,如果不需要保留,需要单独进行删除,需要使用者注意。; - 如出现不能删除的情况请 [提交工单](https://ticket.jdcloud.com/applyorder/submit) 或联系京东云客服。; [MFA enabled] ''', description=''' - 修改虚机弹性网卡属性,包括是否随云主机一起删除。
; 不能修改主网卡。; 。 + ; 删除一台云主机实例。; ; 详细操作说明请参考帮助文档:[删除实例](https://docs.jdcloud.com/cn/virtual-machines/delete-instance); ; ## 接口说明; - 不可以删除包年包月未到期的云主机。如果云主机为包年包月已到期的,并且用户处于白名单中,也不允许删除。; - 不可以删除没有计费信息的云主机,该情况只限于创建过程中出现了异常。; - 云主机状态必须为运行 `running`、停止 `stopped`、错误 `error`、状态,同时云主机没有正在进行中的任务才可以删除。; - 如果云主机中挂载的数据盘为按配置计费的云硬盘且 `AutoDelete` 属性为 `true`,那么数据盘会随云主机一起删除。; - 云主机中绑定的弹性公网IP不会随云主机一起删除,如果不需要保留,需要单独进行删除,需要使用者注意。; - 如出现不能删除的情况请 [提交工单](https://ticket.jdcloud.com/applyorder/submit) 或联系京东云客服。; [MFA enabled]。 - 示例: jdc vm modify-instance-network-attribute --instance-id xxx + 示例: jdc vm delete-instance --instance-id xxx ''', ) - def modify_instance_network_attribute(self): + def delete_instance(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.ModifyInstanceNetworkAttributeRequest import ModifyInstanceNetworkAttributeRequest + from jdcloud_sdk.services.vm.apis.DeleteInstanceRequest import DeleteInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyInstanceNetworkAttributeRequest(params_dict, headers) + req = DeleteInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1012,31 +1253,33 @@ def modify_instance_network_attribute(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--elastic-ip-id'], dict(help="""(string) 弹性公网IP的ID """, dest='elasticIpId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;
默认为20;取值范围[10, 100]。 """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) filters 中支持使用以下关键字进行过滤; `instanceId`: 云主机ID,精确匹配,支持多个; `privateIpAddress`: 主网卡内网主IP地址,模糊匹配,支持多个; `vpcId`: 私有网络ID,精确匹配,支持多个; `status`: 云主机状态,精确匹配,支持多个,参考 [云主机状态](https://docs.jdcloud.com/virtual-machines/api/vm_status); `name`: 云主机名称,模糊匹配,支持单个; `imageId`: 镜像ID,精确匹配,支持多个; `agId`: 使用可用组id,支持单个; `faultDomain`: 错误域,支持多个; `networkInterfaceId`: 弹性网卡ID,精确匹配,支持多个; `subnetId`: 子网ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 为云主机主网卡的主内网IP绑定弹性公网IP。
; 一台云主机的主网卡的主内网IP只能绑定一个弹性公网IP,若已绑定弹性公网IP,操作绑定会返回错误。
; ''', + help=''' ; 查询一台或多台云主机实例的状态。; ; 云主机实例的状态说明请参考帮助文档:[云主机状态](https://docs.jdcloud.com/cn/virtual-machines/api/vm_status); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 单次查询最大可查询100条云主机状态。; - 尽量一次调用接口查询多条数据,不建议使用该批量查询接口一次查询一条数据,如果使用不当导致查询过于密集,可能导致网关触发限流。; - 由于该接口为 `GET` 方式请求,最终参数会转换为 `URL` 上的参数,但是 `HTTP` 协议下的 `GET` 请求参数长度是有大小限制的,使用者需要注意参数超长的问题。; ''', description=''' - 为云主机主网卡的主内网IP绑定弹性公网IP。
; 一台云主机的主网卡的主内网IP只能绑定一个弹性公网IP,若已绑定弹性公网IP,操作绑定会返回错误。
; 。 + ; 查询一台或多台云主机实例的状态。; ; 云主机实例的状态说明请参考帮助文档:[云主机状态](https://docs.jdcloud.com/cn/virtual-machines/api/vm_status); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 单次查询最大可查询100条云主机状态。; - 尽量一次调用接口查询多条数据,不建议使用该批量查询接口一次查询一条数据,如果使用不当导致查询过于密集,可能导致网关触发限流。; - 由于该接口为 `GET` 方式请求,最终参数会转换为 `URL` 上的参数,但是 `HTTP` 协议下的 `GET` 请求参数长度是有大小限制的,使用者需要注意参数超长的问题。; 。 - 示例: jdc vm associate-elastic-ip --instance-id xxx --elastic-ip-id xxx + 示例: jdc vm describe-instance-status ''', ) - def associate_elastic_ip(self): + def describe_instance_status(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.AssociateElasticIpRequest import AssociateElasticIpRequest + from jdcloud_sdk.services.vm.apis.DescribeInstanceStatusRequest import DescribeInstanceStatusRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AssociateElasticIpRequest(params_dict, headers) + req = DescribeInstanceStatusRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1046,31 +1289,33 @@ def associate_elastic_ip(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--elastic-ip-id'], dict(help="""(string) 弹性公网IP的ID """, dest='elasticIpId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;
默认为20;取值范围[10, 100]。 """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) filters 中支持使用以下关键字进行过滤; `instanceId`: 云主机ID,精确匹配,支持多个; `privateIpAddress`: 主网卡内网主IP地址,模糊匹配,支持多个; `vpcId`: 私有网络ID,精确匹配,支持多个; `status`: 云主机状态,精确匹配,支持多个,参考 [云主机状态](https://docs.jdcloud.com/virtual-machines/api/vm_status); `name`: 云主机名称,模糊匹配,支持单个; `imageId`: 镜像ID,精确匹配,支持多个; `agId`: 使用可用组id,支持单个; `faultDomain`: 错误域,支持多个; `networkInterfaceId`: 弹性网卡ID,精确匹配,支持多个; `subnetId`: 子网ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 云主机解绑弹性公网IP,解绑的是主网卡、内网主IP对应的弹性公网IP。; ''', + help=''' ; 查询一台或多台云主机实例的主网卡内网主IP地址。; ; 弹性网卡说明请参考帮助文档:[弹性网卡](https://docs.jdcloud.com/cn/virtual-machines/attach-eni); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 单次查询最大可查询100条云主机实例数据。; - 尽量一次调用接口查询多条数据,不建议使用该批量查询接口一次查询一条数据,如果使用不当导致查询过于密集,可能导致网关触发限流。; - 由于该接口为 `GET` 方式请求,最终参数会转换为 `URL` 上的参数,但是 `HTTP` 协议下的 `GET` 请求参数长度是有大小限制的,使用者需要注意参数超长的问题。; ''', description=''' - 云主机解绑弹性公网IP,解绑的是主网卡、内网主IP对应的弹性公网IP。; 。 + ; 查询一台或多台云主机实例的主网卡内网主IP地址。; ; 弹性网卡说明请参考帮助文档:[弹性网卡](https://docs.jdcloud.com/cn/virtual-machines/attach-eni); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 单次查询最大可查询100条云主机实例数据。; - 尽量一次调用接口查询多条数据,不建议使用该批量查询接口一次查询一条数据,如果使用不当导致查询过于密集,可能导致网关触发限流。; - 由于该接口为 `GET` 方式请求,最终参数会转换为 `URL` 上的参数,但是 `HTTP` 协议下的 `GET` 请求参数长度是有大小限制的,使用者需要注意参数超长的问题。; 。 - 示例: jdc vm disassociate-elastic-ip --instance-id xxx --elastic-ip-id xxx + 示例: jdc vm describe-instance-private-ip-address ''', ) - def disassociate_elastic_ip(self): + def describe_instance_private_ip_address(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DisassociateElasticIpRequest import DisassociateElasticIpRequest + from jdcloud_sdk.services.vm.apis.DescribeInstancePrivateIpAddressRequest import DescribeInstancePrivateIpAddressRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisassociateElasticIpRequest(params_dict, headers) + req = DescribeInstancePrivateIpAddressRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1080,33 +1325,32 @@ def disassociate_elastic_ip(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--name'], dict(help="""(string) 镜像名称,参考公共参数规范。 """, dest='name', required=True)), - (['--description'], dict(help="""(string) 镜像描述,参考公共参数规范。 """, dest='description', required=False)), - (['--data-disks'], dict(help="""(array: instanceDiskAttachmentSpec) 数据盘列表,可以在实例已挂载数据盘的基础上,额外增加新的快照、空盘、或排除云主机中的数据盘。 """, dest='dataDisks', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--charge-on-stopped'], dict(help="""(string) 停机不计费模式。; 该参数仅对按配置计费且系统盘为云硬盘的实例生效,并且不是专有宿主机中的实例。; 配置停机不计费且停机后,实例部分将停止计费,且释放实例自身包含的资源(CPU/内存/GPU/本地数据盘)。; 可选值:; `keepCharging`:停机后保持计费,不释放资源。; `stopCharging`:停机后停止计费,释放实例资源。默认值为空。; """, dest='chargeOnStopped', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 为云主机创建私有镜像。云主机状态必须为stopped
; 云主机没有正在进行中的任务才可制作镜像。
; 制作镜像以备份系统盘为基础,在此之上可选择全部或部分挂载数据盘制作整机镜像(如不做任何更改将默认制作整机镜像),制作镜像过程会为所挂载云硬盘创建快照并与镜像关联。
; 调用接口后,需要等待镜像状态变为ready后,才能正常使用镜像。; ''', + help=''' ; 停止云主机实例。; ; 详细操作说明请参考帮助文档:[停止实例](https://docs.jdcloud.com/cn/virtual-machines/stop-instance); ; ## 接口说明; - 实例状态必须为运行 `running` 状态,同时实例没有正在进行中的任务时才可停止。; - 如果云主机实例属性 `chargeOnStopped` 的值为 `stopCharging`,实例关机之后,实例部分将停止计费,且释放实例自身包含的资源(CPU/内存/GPU/本地数据盘)。需要使用者注意的是,实例一旦释放自身资源,再次启动时有可能因为库存资源不足而导致无法启动。; - `chargeOnStopped` 该参数仅对按配置计费且系统盘为云硬盘的实例生效,并且不是专有宿主机中的实例。; ''', description=''' - 为云主机创建私有镜像。云主机状态必须为stopped
; 云主机没有正在进行中的任务才可制作镜像。
; 制作镜像以备份系统盘为基础,在此之上可选择全部或部分挂载数据盘制作整机镜像(如不做任何更改将默认制作整机镜像),制作镜像过程会为所挂载云硬盘创建快照并与镜像关联。
; 调用接口后,需要等待镜像状态变为ready后,才能正常使用镜像。; 。 + ; 停止云主机实例。; ; 详细操作说明请参考帮助文档:[停止实例](https://docs.jdcloud.com/cn/virtual-machines/stop-instance); ; ## 接口说明; - 实例状态必须为运行 `running` 状态,同时实例没有正在进行中的任务时才可停止。; - 如果云主机实例属性 `chargeOnStopped` 的值为 `stopCharging`,实例关机之后,实例部分将停止计费,且释放实例自身包含的资源(CPU/内存/GPU/本地数据盘)。需要使用者注意的是,实例一旦释放自身资源,再次启动时有可能因为库存资源不足而导致无法启动。; - `chargeOnStopped` 该参数仅对按配置计费且系统盘为云硬盘的实例生效,并且不是专有宿主机中的实例。; 。 - 示例: jdc vm create-image --instance-id xxx --name xxx + 示例: jdc vm stop-instance --instance-id xxx ''', ) - def create_image(self): + def stop_instance(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.CreateImageRequest import CreateImageRequest + from jdcloud_sdk.services.vm.apis.StopInstanceRequest import StopInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateImageRequest(params_dict, headers) + req = StopInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1116,33 +1360,31 @@ def create_image(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--disk-id'], dict(help="""(string) 云硬盘ID """, dest='diskId', required=True)), - (['--device-name'], dict(help="""(string) 设备名[vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi,vmj,vdk,vdl,vdm],挂载系统盘时必传,且需传vda """, dest='deviceName', required=False)), - (['--auto-delete'], dict(help="""(bool) 随云主机删除自动删除此云硬盘,默认为False。仅按配置计费云硬盘支持修改此参数,包年包月云硬盘不可修改。 """, dest='autoDelete', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 为一台云主机挂载一块云硬盘,云主机和云硬盘没有正在进行中的的任务时才可挂载。
; 云主机状态必须是runningstopped状态。
; 本地盘(local类型)做系统盘的云主机可挂载8块云硬盘,云硬盘(cloud类型)做系统盘的云主机可挂载除系统盘外7块云硬盘。; ''', + help=''' ; 启动云主机实例。; ; 详细操作说明请参考帮助文档:[启动实例](https://docs.jdcloud.com/cn/virtual-machines/start-instance); ; ## 接口说明; - 实例状态必须为停止 `stopped` 状态,同时实例没有正在进行中的任务时才可以启动。; - 如果实例为停机不计费模式,启动时有可能因为库存资源不足而导致无法启动。; - 如果云主机实例已欠费或已到期,则无法启动。; - 如果实例系统盘是云硬盘,启动之前请确保系统盘处于正常挂载状态。; ''', description=''' - 为一台云主机挂载一块云硬盘,云主机和云硬盘没有正在进行中的的任务时才可挂载。
; 云主机状态必须是runningstopped状态。
; 本地盘(local类型)做系统盘的云主机可挂载8块云硬盘,云硬盘(cloud类型)做系统盘的云主机可挂载除系统盘外7块云硬盘。; 。 + ; 启动云主机实例。; ; 详细操作说明请参考帮助文档:[启动实例](https://docs.jdcloud.com/cn/virtual-machines/start-instance); ; ## 接口说明; - 实例状态必须为停止 `stopped` 状态,同时实例没有正在进行中的任务时才可以启动。; - 如果实例为停机不计费模式,启动时有可能因为库存资源不足而导致无法启动。; - 如果云主机实例已欠费或已到期,则无法启动。; - 如果实例系统盘是云硬盘,启动之前请确保系统盘处于正常挂载状态。; 。 - 示例: jdc vm attach-disk --instance-id xxx --disk-id xxx + 示例: jdc vm start-instance --instance-id xxx ''', ) - def attach_disk(self): + def start_instance(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.AttachDiskRequest import AttachDiskRequest + from jdcloud_sdk.services.vm.apis.StartInstanceRequest import StartInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AttachDiskRequest(params_dict, headers) + req = StartInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1152,32 +1394,31 @@ def attach_disk(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--disk-id'], dict(help="""(string) 云硬盘ID """, dest='diskId', required=True)), - (['--force'], dict(help="""(bool) 强制缷载,默认False。如果此参数传值为True,代表数据盘的IO会被强制断掉。 """, dest='force', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 云主机缷载云硬盘,云主机和云硬盘没有正在进行中的任务时才可缷载。
; ''', + help=''' ; 重启云主机实例。; ; 详细操作说明请参考帮助文档:[重启实例](https://docs.jdcloud.com/cn/virtual-machines/reboot-instance); ; ## 接口说明; - 实例状态必须为运行 `running` 状态,同时实例没有正在进行中的任务时才可以重启。; - 如果云主机实例已欠费或已到期,则无法重启。; ''', description=''' - 云主机缷载云硬盘,云主机和云硬盘没有正在进行中的任务时才可缷载。
; 。 + ; 重启云主机实例。; ; 详细操作说明请参考帮助文档:[重启实例](https://docs.jdcloud.com/cn/virtual-machines/reboot-instance); ; ## 接口说明; - 实例状态必须为运行 `running` 状态,同时实例没有正在进行中的任务时才可以重启。; - 如果云主机实例已欠费或已到期,则无法重启。; 。 - 示例: jdc vm detach-disk --instance-id xxx --disk-id xxx + 示例: jdc vm reboot-instance --instance-id xxx ''', ) - def detach_disk(self): + def reboot_instance(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DetachDiskRequest import DetachDiskRequest + from jdcloud_sdk.services.vm.apis.RebootInstanceRequest import RebootInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DetachDiskRequest(params_dict, headers) + req = RebootInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1187,31 +1428,33 @@ def detach_disk(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--data-disks'], dict(help="""(array: instanceDiskAttribute) 云硬盘列表 """, dest='dataDisks', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--network-interface-id'], dict(help="""(string) 弹性网卡ID。 """, dest='networkInterfaceId', required=True)), + (['--auto-delete'], dict(help="""(bool) 随云主机实例自动删除,默认为False。; 受管网卡或授信网卡默认为False并且不支持修改。; """, dest='autoDelete', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改云主机挂载的数据盘属性,包括是否随主机删除。
; 仅按配置计费云硬盘支持设置随实例删除属性;包年包月计费云硬盘该属性不生效,实例删除时云硬盘将保留。
; ''', + help=''' ; 为云主机绑定弹性网卡。; ; 详细操作说明请参考帮助文档:[绑定弹性网卡](https://docs.jdcloud.com/cn/virtual-machines/attach-eni); ; ## 接口说明; - 实例状态必须为 `running` 或 `stopped` 状态,同时实例没有正在进行中的任务时才可以操作。; - 实例中的主网卡是不可以解绑和绑定的,绑定弹性网卡只支持绑定辅助网卡。; - 目标弹性网卡上如果绑定了弹性公网IP,那么其所在的可用区需要与云主机的可用区保持一致,或者弹性公网IP是全可用区类型的,才允许绑定该弹性网卡。; - 弹性网卡与云主机必须在相同vpc下。; - 对于受管网卡,授权中不能含有 `instance-attach` 用户才可以挂载。; - 对于授信网卡,授权中必须含有 `instance-attach` 用户才可以挂载。; - 实例挂载弹性网卡的数量,不能超过实例规格的限制。可查询 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes) 接口获得指定规格可挂载弹性网卡的数量上限。; ''', description=''' - 修改云主机挂载的数据盘属性,包括是否随主机删除。
; 仅按配置计费云硬盘支持设置随实例删除属性;包年包月计费云硬盘该属性不生效,实例删除时云硬盘将保留。
; 。 + ; 为云主机绑定弹性网卡。; ; 详细操作说明请参考帮助文档:[绑定弹性网卡](https://docs.jdcloud.com/cn/virtual-machines/attach-eni); ; ## 接口说明; - 实例状态必须为 `running` 或 `stopped` 状态,同时实例没有正在进行中的任务时才可以操作。; - 实例中的主网卡是不可以解绑和绑定的,绑定弹性网卡只支持绑定辅助网卡。; - 目标弹性网卡上如果绑定了弹性公网IP,那么其所在的可用区需要与云主机的可用区保持一致,或者弹性公网IP是全可用区类型的,才允许绑定该弹性网卡。; - 弹性网卡与云主机必须在相同vpc下。; - 对于受管网卡,授权中不能含有 `instance-attach` 用户才可以挂载。; - 对于授信网卡,授权中必须含有 `instance-attach` 用户才可以挂载。; - 实例挂载弹性网卡的数量,不能超过实例规格的限制。可查询 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes) 接口获得指定规格可挂载弹性网卡的数量上限。; 。 - 示例: jdc vm modify-instance-disk-attribute --instance-id xxx + 示例: jdc vm attach-network-interface --instance-id xxx --network-interface-id xxx ''', ) - def modify_instance_disk_attribute(self): + def attach_network_interface(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.ModifyInstanceDiskAttributeRequest import ModifyInstanceDiskAttributeRequest + from jdcloud_sdk.services.vm.apis.AttachNetworkInterfaceRequest import AttachNetworkInterfaceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyInstanceDiskAttributeRequest(params_dict, headers) + req = AttachNetworkInterfaceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1221,32 +1464,32 @@ def modify_instance_disk_attribute(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--name'], dict(help="""(string) 名称,参考公共参数规范。 """, dest='name', required=False)), - (['--description'], dict(help="""(string) 描述,参考公共参数规范。 """, dest='description', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--network-interface-id'], dict(help="""(string) 弹性网卡ID """, dest='networkInterfaceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改云主机部分信息,包括名称、描述。; ''', + help=''' ; 为云主机解绑弹性网卡。; ; 详细操作说明请参考帮助文档:[解绑弹性网卡](https://docs.jdcloud.com/cn/virtual-machines/detach-eni); ; ## 接口说明; - 实例状态必须为 `running` 或 `stopped` 状态,同时实例没有正在进行中的任务时才可以操作。; - 实例中的主网卡是不可以解绑和绑定的,解绑弹性网卡只支持解绑辅助网卡。; ''', description=''' - 修改云主机部分信息,包括名称、描述。; 。 + ; 为云主机解绑弹性网卡。; ; 详细操作说明请参考帮助文档:[解绑弹性网卡](https://docs.jdcloud.com/cn/virtual-machines/detach-eni); ; ## 接口说明; - 实例状态必须为 `running` 或 `stopped` 状态,同时实例没有正在进行中的任务时才可以操作。; - 实例中的主网卡是不可以解绑和绑定的,解绑弹性网卡只支持解绑辅助网卡。; 。 - 示例: jdc vm modify-instance-attribute --instance-id xxx + 示例: jdc vm detach-network-interface --instance-id xxx --network-interface-id xxx ''', ) - def modify_instance_attribute(self): + def detach_network_interface(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.ModifyInstanceAttributeRequest import ModifyInstanceAttributeRequest + from jdcloud_sdk.services.vm.apis.DetachNetworkInterfaceRequest import DetachNetworkInterfaceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyInstanceAttributeRequest(params_dict, headers) + req = DetachNetworkInterfaceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1256,31 +1499,32 @@ def modify_instance_attribute(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--password'], dict(help="""(string) 密码,参考公共参数规范。 """, dest='password', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--networks'], dict(help="""(array: instanceNetworkAttribute) 弹性网卡列表。 """, dest='networks', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改云主机密码,主机没有正在进行中的任务时才可操作。
; 修改密码后,需要重启云主机后生效。; ''', + help=''' ; 修改云主机弹性网卡属性。; ; 详细操作说明请参考帮助文档:[配置弹性网卡删除属性](https://docs.jdcloud.com/cn/virtual-machines/configurate-eni-delete-attributes); ; ## 接口说明; - 当前只支持修改随云主机实例删除的属性。; - 不支持修改主网卡。; ''', description=''' - 修改云主机密码,主机没有正在进行中的任务时才可操作。
; 修改密码后,需要重启云主机后生效。; 。 + ; 修改云主机弹性网卡属性。; ; 详细操作说明请参考帮助文档:[配置弹性网卡删除属性](https://docs.jdcloud.com/cn/virtual-machines/configurate-eni-delete-attributes); ; ## 接口说明; - 当前只支持修改随云主机实例删除的属性。; - 不支持修改主网卡。; 。 - 示例: jdc vm modify-instance-password --instance-id xxx --password xxx + 示例: jdc vm modify-instance-network-attribute --instance-id xxx --networks ['{"":""}'] ''', ) - def modify_instance_password(self): + def modify_instance_network_attribute(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.ModifyInstancePasswordRequest import ModifyInstancePasswordRequest + from jdcloud_sdk.services.vm.apis.ModifyInstanceNetworkAttributeRequest import ModifyInstanceNetworkAttributeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyInstancePasswordRequest(params_dict, headers) + req = ModifyInstanceNetworkAttributeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1290,30 +1534,32 @@ def modify_instance_password(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--elastic-ip-id'], dict(help="""(string) 弹性公网IP的ID。 """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取云主机vnc,用于连接管理云主机。
; vnc地址的有效期为1个小时,调用接口获取vnc地址后如果1个小时内没有使用,vnc地址自动失效,再次使用需要重新获取。; ''', + help=''' ; 为云主机绑定弹性公网IP。; ; 详细操作说明请参考帮助文档:[绑定弹性公网IP](https://docs.jdcloud.com/cn/virtual-machines/associate-elastic-ip); ; ## 接口说明; - 该接口只支持在实例的主网卡的主内网IP上绑定弹性公网IP。; - 一台云主机的主网卡的主内网IP只能绑定一个弹性公网IP,若已绑定弹性公网IP,操作绑定会返回错误。; - 弹性公网IP所在的可用区需要与云主机的可用区保持一致,或者弹性公网IP是全可用区类型的,才允许绑定操作。; ''', description=''' - 获取云主机vnc,用于连接管理云主机。
; vnc地址的有效期为1个小时,调用接口获取vnc地址后如果1个小时内没有使用,vnc地址自动失效,再次使用需要重新获取。; 。 + ; 为云主机绑定弹性公网IP。; ; 详细操作说明请参考帮助文档:[绑定弹性公网IP](https://docs.jdcloud.com/cn/virtual-machines/associate-elastic-ip); ; ## 接口说明; - 该接口只支持在实例的主网卡的主内网IP上绑定弹性公网IP。; - 一台云主机的主网卡的主内网IP只能绑定一个弹性公网IP,若已绑定弹性公网IP,操作绑定会返回错误。; - 弹性公网IP所在的可用区需要与云主机的可用区保持一致,或者弹性公网IP是全可用区类型的,才允许绑定操作。; 。 - 示例: jdc vm describe-instance-vnc-url --instance-id xxx + 示例: jdc vm associate-elastic-ip --instance-id xxx --elastic-ip-id xxx ''', ) - def describe_instance_vnc_url(self): + def associate_elastic_ip(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeInstanceVncUrlRequest import DescribeInstanceVncUrlRequest + from jdcloud_sdk.services.vm.apis.AssociateElasticIpRequest import AssociateElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceVncUrlRequest(params_dict, headers) + req = AssociateElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1323,32 +1569,32 @@ def describe_instance_vnc_url(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--instance-type'], dict(help="""(string) 实例规格,可查询DescribeInstanceTypes接口获得指定地域或可用区的规格信息。 """, dest='instanceType', required=True)), - (['--force'], dict(help="""(bool) 是否强制调配,默认为false;如果指定为true, 将会清除本地数据盘。 """, dest='force', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--elastic-ip-id'], dict(help="""(string) 弹性公网IP的ID。 """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 云主机变更实例规格
; 云主机的状态必须为stopped状态。
; 以下情况的云主机,不允许在一代与二代实例规格间互相调整,例:不允许g.n1与g.n2之间互相调配
; 1、16年创建的云硬盘做系统盘的云主机
; 2、本地盘(local类型)做系统盘的云主机。
; 3、使用高可用组(Ag)创建的云主机。
; 如果当前主机中的弹性网卡数量,大于新实例规格允许的弹性网卡数量,会返回错误。可查询DescribeInstanceTypes接口获得指定地域及可用区下的实例规格信息。
; 当前主机所使用的镜像,需要支持要变更的目标实例规格,否则返回错误。可查询DescribeImageConstraints接口获得指定镜像的实例规格限制信息。
; 云主机欠费或到期时,无法更改实例规格。; ''', + help=''' ; 为云主机解绑弹性公网IP。; ; 详细操作说明请参考帮助文档:[解绑弹性公网IP](https://docs.jdcloud.com/cn/virtual-machines/disassociate-elastic-ip); ; ## 接口说明; - 该接口只支持解绑实例的主网卡的主内网IP上的弹性公网IP。; ''', description=''' - 云主机变更实例规格
; 云主机的状态必须为stopped状态。
; 以下情况的云主机,不允许在一代与二代实例规格间互相调整,例:不允许g.n1与g.n2之间互相调配
; 1、16年创建的云硬盘做系统盘的云主机
; 2、本地盘(local类型)做系统盘的云主机。
; 3、使用高可用组(Ag)创建的云主机。
; 如果当前主机中的弹性网卡数量,大于新实例规格允许的弹性网卡数量,会返回错误。可查询DescribeInstanceTypes接口获得指定地域及可用区下的实例规格信息。
; 当前主机所使用的镜像,需要支持要变更的目标实例规格,否则返回错误。可查询DescribeImageConstraints接口获得指定镜像的实例规格限制信息。
; 云主机欠费或到期时,无法更改实例规格。; 。 + ; 为云主机解绑弹性公网IP。; ; 详细操作说明请参考帮助文档:[解绑弹性公网IP](https://docs.jdcloud.com/cn/virtual-machines/disassociate-elastic-ip); ; ## 接口说明; - 该接口只支持解绑实例的主网卡的主内网IP上的弹性公网IP。; 。 - 示例: jdc vm resize-instance --instance-id xxx --instance-type xxx + 示例: jdc vm disassociate-elastic-ip --instance-id xxx --elastic-ip-id xxx ''', ) - def resize_instance(self): + def disassociate_elastic_ip(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.ResizeInstanceRequest import ResizeInstanceRequest + from jdcloud_sdk.services.vm.apis.DisassociateElasticIpRequest import DisassociateElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ResizeInstanceRequest(params_dict, headers) + req = DisassociateElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1358,33 +1604,34 @@ def resize_instance(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-id'], dict(help="""(string) 云主机ID """, dest='instanceId', required=True)), - (['--password'], dict(help="""(string) 云主机密码,参考公共参数规范。 """, dest='password', required=True)), - (['--image-id'], dict(help="""(string) 镜像ID。可查询DescribeImages接口获得指定地域的镜像信息。 """, dest='imageId', required=False)), - (['--key-names'], dict(help="""(array: string) 密钥对名称;当前只支持一个。仅Linux系统支持指定。 """, dest='keyNames', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--name'], dict(help="""(string) 镜像名称,长度为2\~32个字符,只允许中文、数字、大小写字母、英文下划线(\_)、连字符(-)及点(.)。; """, dest='name', required=True)), + (['--description'], dict(help="""(string) 镜像描述。256字符以内。; """, dest='description', required=False)), + (['--data-disks'], dict(help="""(array: instanceDiskAttachmentSpec) 数据盘列表。; 在不指定该参数的情况下,制作镜像的过程中会将该实例中的所有云盘数据盘制作快照,并与系统盘一起,制作成打包镜像。; 如果不希望将实例中的某个云盘数据盘制作快照,可使用 `noDevice` 的方式排除,例如:`deviceName=vdb`、`noDevice=true` 就不会将 `vdb` 制作快照。; 如果希望在打包镜像中插入一块新盘,该盘不在实例中,可通过指定新的 `deviceName` 的方式实现,例如:`deviceName=vdx` 将会在打包镜像中插入一块盘符为 `vdx` 的新盘,支持新盘使用或不使用快照都可以。; 如果使用 `deviceName` 指定了与实例中相同的盘符,那么实例中对应的云盘数据盘也不会制作快照,并使用新指定的参数进行替换。; """, dest='dataDisks', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 云主机使用指定镜像重置云主机系统
; 云主机的状态必须为stopped状态。
; 若不指定镜像ID,默认使用当前主机的原镜像重置系统。
; 云主机系统盘类型必须与待更换镜像支持的系统盘类型保持一致,若当前云主机系统盘为local类型,则更换镜像的系统盘类型必须为loaclDisk类型;同理,若当前云主机系统盘为cloud类型,则更换镜像的系统盘类型必须为cloudDisk类型。可查询DescribeImages接口获得指定地域的镜像信息。
; 指定的镜像必须能够支持当前主机的实例规格(instanceType),否则会返回错误。可查询DescribeImageConstraints接口获得指定镜像支持的系统盘类型信息。; ''', + help=''' ; 为云主机制作私有镜像。; ; 详细操作说明请参考帮助文档:[基于实例创建私有镜像](https://docs.jdcloud.com/cn/virtual-machines/create-private-image); ; ## 接口说明; - 云主机实例没有正在进行中的任务时才可制作镜像。; - 本地系统盘的实例,仅支持关机(已停止)状态下制作私有镜像。; - 云盘系统盘的实例,支持开机(运行中)/关机(已停止)状态下制作私有镜像。; - 调用接口后,需要等待镜像状态变为 `ready` 后,才能正常使用镜像。; - 若当前实例系统盘为本地盘,则创建完成后的私有镜像为本地盘系统盘镜像;若当前实例系统盘为云硬盘,则创建完成后的私有镜像为云硬盘系统盘镜像。您可通过镜像类型转换 [convertImage](https://docs.jdcloud.com/Image/api/convertimage) 将本地盘系统盘镜像转换为云硬盘系统盘镜像后使用。; - 默认情况下,制作的镜像中包括数据盘中的云硬盘(制作快照),但是不包含本地数据盘。; - 如果需要变更打包镜像中的一些数据盘、或排除一些数据盘不需要制作快照,可通过 `dataDisks` 中的参数进行控制。; ''', description=''' - 云主机使用指定镜像重置云主机系统
; 云主机的状态必须为stopped状态。
; 若不指定镜像ID,默认使用当前主机的原镜像重置系统。
; 云主机系统盘类型必须与待更换镜像支持的系统盘类型保持一致,若当前云主机系统盘为local类型,则更换镜像的系统盘类型必须为loaclDisk类型;同理,若当前云主机系统盘为cloud类型,则更换镜像的系统盘类型必须为cloudDisk类型。可查询DescribeImages接口获得指定地域的镜像信息。
; 指定的镜像必须能够支持当前主机的实例规格(instanceType),否则会返回错误。可查询DescribeImageConstraints接口获得指定镜像支持的系统盘类型信息。; 。 + ; 为云主机制作私有镜像。; ; 详细操作说明请参考帮助文档:[基于实例创建私有镜像](https://docs.jdcloud.com/cn/virtual-machines/create-private-image); ; ## 接口说明; - 云主机实例没有正在进行中的任务时才可制作镜像。; - 本地系统盘的实例,仅支持关机(已停止)状态下制作私有镜像。; - 云盘系统盘的实例,支持开机(运行中)/关机(已停止)状态下制作私有镜像。; - 调用接口后,需要等待镜像状态变为 `ready` 后,才能正常使用镜像。; - 若当前实例系统盘为本地盘,则创建完成后的私有镜像为本地盘系统盘镜像;若当前实例系统盘为云硬盘,则创建完成后的私有镜像为云硬盘系统盘镜像。您可通过镜像类型转换 [convertImage](https://docs.jdcloud.com/Image/api/convertimage) 将本地盘系统盘镜像转换为云硬盘系统盘镜像后使用。; - 默认情况下,制作的镜像中包括数据盘中的云硬盘(制作快照),但是不包含本地数据盘。; - 如果需要变更打包镜像中的一些数据盘、或排除一些数据盘不需要制作快照,可通过 `dataDisks` 中的参数进行控制。; 。 - 示例: jdc vm rebuild-instance --instance-id xxx --password xxx + 示例: jdc vm create-image --instance-id xxx --name xxx ''', ) - def rebuild_instance(self): + def create_image(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.RebuildInstanceRequest import RebuildInstanceRequest + from jdcloud_sdk.services.vm.apis.CreateImageRequest import CreateImageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RebuildInstanceRequest(params_dict, headers) + req = CreateImageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1394,32 +1641,34 @@ def rebuild_instance(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) name - 启动模板名称,模糊匹配,支持多个; instanceTemplateId - 启动模板ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--disk-id'], dict(help="""(string) 云硬盘ID。 """, dest='diskId', required=True)), + (['--device-name'], dict(help="""(string) 磁盘逻辑挂载点。; **系统盘**:必须指定并且只能是vda。; **数据盘**:取值范围:`[vdb~vdbm]`。; """, dest='deviceName', required=False)), + (['--auto-delete'], dict(help="""(bool) 是否随实例一起删除,即删除实例时是否自动删除此磁盘。此参数仅对按配置计费的非多点挂载云硬盘生效。; 可选值:; `true`:随实例删除。; `false`(默认值):不随实例删除。; """, dest='autoDelete', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询启动模板列表; ''', + help=''' ; 为一台云主机挂载云硬盘。; ; 详细操作说明请参考帮助文档:[挂载云硬盘](https://docs.jdcloud.com/cn/virtual-machines/attach-cloud-disk); ; ## 接口说明; - 云主机和云硬盘都没有正在进行中的的任务时才可以操作。; - 云主机状态必须是 `running` 或 `stopped` 状态。操作系统盘时必须先停止实例。; - 实例挂载云硬盘的数量,不能超过实例规格的限制。可查询 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes) 接口获得指定规格可挂载云硬盘的数量上限。; - 云硬盘作为系统盘时,容量不能小于40GB,并且不能超过500GB。; - 待挂载的云硬盘与云主机实例必须在同一个可用区下。; - 共享型云硬盘最多可挂载16个云主机实例,并且只能用作数据盘,不能用于系统盘。非共享型云盘最多只能挂载一个云主机实例。; ''', description=''' - 查询启动模板列表; 。 + ; 为一台云主机挂载云硬盘。; ; 详细操作说明请参考帮助文档:[挂载云硬盘](https://docs.jdcloud.com/cn/virtual-machines/attach-cloud-disk); ; ## 接口说明; - 云主机和云硬盘都没有正在进行中的的任务时才可以操作。; - 云主机状态必须是 `running` 或 `stopped` 状态。操作系统盘时必须先停止实例。; - 实例挂载云硬盘的数量,不能超过实例规格的限制。可查询 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes) 接口获得指定规格可挂载云硬盘的数量上限。; - 云硬盘作为系统盘时,容量不能小于40GB,并且不能超过500GB。; - 待挂载的云硬盘与云主机实例必须在同一个可用区下。; - 共享型云硬盘最多可挂载16个云主机实例,并且只能用作数据盘,不能用于系统盘。非共享型云盘最多只能挂载一个云主机实例。; 。 - 示例: jdc vm describe-instance-templates + 示例: jdc vm attach-disk --instance-id xxx --disk-id xxx ''', ) - def describe_instance_templates(self): + def attach_disk(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeInstanceTemplatesRequest import DescribeInstanceTemplatesRequest + from jdcloud_sdk.services.vm.apis.AttachDiskRequest import AttachDiskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceTemplatesRequest(params_dict, headers) + req = AttachDiskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1429,32 +1678,33 @@ def describe_instance_templates(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-template-data'], dict(help="""(instanceTemplateSpec) 启动模板的数据 """, dest='instanceTemplateData', required=True)), - (['--name'], dict(help="""(string) 启动模板的名称,参考公共参数规范。 """, dest='name', required=True)), - (['--description'], dict(help="""(string) 启动模板的描述,参考公共参数规范。 """, dest='description', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--disk-id'], dict(help="""(string) 云硬盘ID。 """, dest='diskId', required=True)), + (['--force'], dict(help="""(bool) 是否强制缷载,默认False。; 如果此参数传值为True,数据盘的IO会被强制断掉。; """, dest='force', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个指定参数的启动模板,启动模板中包含创建云主机时的大部分配置参数,避免每次创建云主机时的重复性工作。
; 如果是使用启动模板创建云主机,如果指定了某些参数与模板中的参数相冲突,那么新指定的参数会替换模板中的参数。
; 如果是使用启动模板创建云主机,如果指定了镜像ID与模板中的镜像ID不一致,那么模板中的dataDisks参数会失效。
; 如果使用高可用组(Ag)创建云主机,那么Ag所关联的模板中的参数都不可以被调整,只能以模板为准。; ''', + help=''' ; 为一台云主机缷载云硬盘; ; 详细操作说明请参考帮助文档:[缷载云硬盘](https://docs.jdcloud.com/cn/virtual-machines/detach-cloud-disk); ; ## 接口说明; - 云主机和云硬盘都没有正在进行中的的任务时才可以操作。; - 云主机状态必须是 `running` 或 `stopped` 状态。操作系统盘时必须先停止实例。; ''', description=''' - 创建一个指定参数的启动模板,启动模板中包含创建云主机时的大部分配置参数,避免每次创建云主机时的重复性工作。
; 如果是使用启动模板创建云主机,如果指定了某些参数与模板中的参数相冲突,那么新指定的参数会替换模板中的参数。
; 如果是使用启动模板创建云主机,如果指定了镜像ID与模板中的镜像ID不一致,那么模板中的dataDisks参数会失效。
; 如果使用高可用组(Ag)创建云主机,那么Ag所关联的模板中的参数都不可以被调整,只能以模板为准。; 。 + ; 为一台云主机缷载云硬盘; ; 详细操作说明请参考帮助文档:[缷载云硬盘](https://docs.jdcloud.com/cn/virtual-machines/detach-cloud-disk); ; ## 接口说明; - 云主机和云硬盘都没有正在进行中的的任务时才可以操作。; - 云主机状态必须是 `running` 或 `stopped` 状态。操作系统盘时必须先停止实例。; 。 - 示例: jdc vm create-instance-template --instance-template-data '{"":""}' --name xxx + 示例: jdc vm detach-disk --instance-id xxx --disk-id xxx ''', ) - def create_instance_template(self): + def detach_disk(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.CreateInstanceTemplateRequest import CreateInstanceTemplateRequest + from jdcloud_sdk.services.vm.apis.DetachDiskRequest import DetachDiskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateInstanceTemplateRequest(params_dict, headers) + req = DetachDiskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1464,30 +1714,32 @@ def create_instance_template(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-template-id'], dict(help="""(string) 启动模板ID """, dest='instanceTemplateId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--data-disks'], dict(help="""(array: instanceDiskAttribute) 云硬盘列表。 """, dest='dataDisks', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询启动模板详情; ''', + help=''' ; 修改一台云主机中的云硬盘属性。; ; 详细操作说明请参考帮助文档:[配置云硬盘删除属性](https://docs.jdcloud.com/cn/virtual-machines/configurate-delete-attributes); ; ## 接口说明; - 该接口当前只能修改实例中的云硬盘随实例删除属性。; - 仅按配置计费、并且非共享型的云硬盘支持修改。; - 包年包月计费的云硬盘该属性不生效,实例删除时云硬盘将保留。; ''', description=''' - 查询启动模板详情; 。 + ; 修改一台云主机中的云硬盘属性。; ; 详细操作说明请参考帮助文档:[配置云硬盘删除属性](https://docs.jdcloud.com/cn/virtual-machines/configurate-delete-attributes); ; ## 接口说明; - 该接口当前只能修改实例中的云硬盘随实例删除属性。; - 仅按配置计费、并且非共享型的云硬盘支持修改。; - 包年包月计费的云硬盘该属性不生效,实例删除时云硬盘将保留。; 。 - 示例: jdc vm describe-instance-template --instance-template-id xxx + 示例: jdc vm modify-instance-disk-attribute --instance-id xxx ''', ) - def describe_instance_template(self): + def modify_instance_disk_attribute(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeInstanceTemplateRequest import DescribeInstanceTemplateRequest + from jdcloud_sdk.services.vm.apis.ModifyInstanceDiskAttributeRequest import ModifyInstanceDiskAttributeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceTemplateRequest(params_dict, headers) + req = ModifyInstanceDiskAttributeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1497,32 +1749,36 @@ def describe_instance_template(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-template-id'], dict(help="""(string) 启动模板ID """, dest='instanceTemplateId', required=True)), - (['--description'], dict(help="""(string) 模板描述,参考公共参数规范。 """, dest='description', required=False)), - (['--name'], dict(help="""(string) 模板名称,参考公共参数规范。 """, dest='name', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--name'], dict(help="""(string) 实例名称。长度为2\~128个字符,只允许中文、数字、大小写字母、英文下划线(\_)、连字符(-)及点(.),不能以(.)作为首尾。; """, dest='name', required=False)), + (['--description'], dict(help="""(string) 实例描述。256字符以内。; """, dest='description', required=False)), + (['--hostname'], dict(help="""(string) 实例hostname。; **Windows系统**:长度为2\~15个字符,允许大小写字母、数字或连字符(-),不能以连字符(-)开头或结尾,不能连续使用连字符(-),也不能全部使用数字。不支持点号(.)。; **Linux系统**:长度为2-64个字符,允许支持多个点号,点之间为一段,每段允许使用大小写字母、数字或连字符(-),但不能连续使用点号(.)或连字符(-),不能以点号(.)或连字符(-)开头或结尾。; """, dest='hostname', required=False)), + (['--metadata'], dict(help="""(array: metadata) 用户自定义元数据。; 以 `key-value` 键值对形式指定,可在实例系统内通过元数据服务查询获取。最多支持40对键值对,且 `key` 不超过256字符,`value` 不超过16KB,不区分大小写。; 注意:`key` 不要以连字符(-)结尾,否则此 `key` 不生效。; """, dest='metadata', required=False)), + (['--userdata'], dict(help="""(array: userdata) 自定义脚本。; 目前仅支持启动脚本,即 `launch-script`,须Base64编码且编码前数据长度不能超过16KB。; **linux系统**:支持bash和python,编码前须分别以 `#!/bin/bash` 和 `#!/usr/bin/env python` 作为内容首行。; **Windows系统**:支持 `bat` 和 `powershell` ,编码前须分别以 `` 作为内容首、尾行。; """, dest='userdata', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改一个启动模板的信息,包括名称、描述; ''', + help=''' ; 修改一台云主机的属性。; ; 详细操作说明请参考帮助文档:; [修改实例名称](https://docs.jdcloud.com/cn/virtual-machines/modify-instance-name); [自定义数据](https://docs.jdcloud.com/cn/virtual-machines/userdata); [实例元数据](https://docs.jdcloud.com/cn/virtual-machines/instance-metadata); ; ## 接口说明; - 支持修改实例的名称、描述、hostname、自定义数据、实例元数据。; ''', description=''' - 修改一个启动模板的信息,包括名称、描述; 。 + ; 修改一台云主机的属性。; ; 详细操作说明请参考帮助文档:; [修改实例名称](https://docs.jdcloud.com/cn/virtual-machines/modify-instance-name); [自定义数据](https://docs.jdcloud.com/cn/virtual-machines/userdata); [实例元数据](https://docs.jdcloud.com/cn/virtual-machines/instance-metadata); ; ## 接口说明; - 支持修改实例的名称、描述、hostname、自定义数据、实例元数据。; 。 - 示例: jdc vm update-instance-template --instance-template-id xxx + 示例: jdc vm modify-instance-attribute --instance-id xxx ''', ) - def update_instance_template(self): + def modify_instance_attribute(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.UpdateInstanceTemplateRequest import UpdateInstanceTemplateRequest + from jdcloud_sdk.services.vm.apis.ModifyInstanceAttributeRequest import ModifyInstanceAttributeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateInstanceTemplateRequest(params_dict, headers) + req = ModifyInstanceAttributeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1532,30 +1788,35 @@ def update_instance_template(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-template-id'], dict(help="""(string) 启动模板ID """, dest='instanceTemplateId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--subnet-id'], dict(help="""(string) 子网Id。 """, dest='subnetId', required=True)), + (['--assign-ipv6'], dict(help="""(bool) `true`: 分配IPV6地址。; `false`: 不分配IPV6地址。; """, dest='assignIpv6', type=bool, required=False)), + (['--private-ip-address'], dict(help="""(string) Ipv4地址。; 不变更 `vpc` 及子网时必须指定Ipv4地址; """, dest='privateIpAddress', required=False)), + (['--security-groups'], dict(help="""(array: string) 安全组列表。; 更换 `vpc` 时必须指定新的安全组。; 不更换 `vpc` 时不可以指定安全组。; """, dest='securityGroups', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除一个启动模板; ''', + help=''' ; 修改一台云主机的子网或内网IP地址。; ; 详细操作说明请参考帮助文档:[修改网络配置](https://docs.jdcloud.com/cn/virtual-machines/modify-vpc-attribute); ; ## 接口说明; - 调该接口之前实例必须处于停止 `stopped` 状态。; - 修改VPC及子网; - 内网IPv4:可指定或由系统分配。; - IPv6:如新子网支持IPv6,可选是否分配,如分配仅支持系统分配。; - 安全组:须指定新VPC下的安全组。; - 不修改VPC,仅修改子网; - 内网IPv4:可指定或由系统分配。; - IPv6:如新子网支持IPv6,可选是否分配,如分配仅支持系统分配。; - 安全组:不支持绑定新安全组。; - 不修改VPC及子网,仅更换内网IP; - 内网IPv4:须指定IP地址。; - IPv6:不支持修改。; - 安全组:不支持绑定新安全组。; - 一些限制及注意事项:; - 已加入负载均衡-后端服务器组中的实例不允许修改。; - 绑定弹性网卡的实例不支持修改VPC,仅支持在同VPC下修改子网和内网IP。; - 主网卡分配了辅助内网IP的实例不支持修改VPC和子网,仅支持在同子网下修改内网IP。; - 如实例在高可用组内,则不允许修改VPC,仅可在同VPC内修改子网或内网IPv4地址。; - 仅在更换VPC时传入安全组ID才有效,且安全组须隶属于目标VPC。; - 如指定内网IPv4,须确保IP地址在子网网段内且未被占用;如不指定则随机分配,须确保子网可用IP充足。; ''', description=''' - 删除一个启动模板; 。 + ; 修改一台云主机的子网或内网IP地址。; ; 详细操作说明请参考帮助文档:[修改网络配置](https://docs.jdcloud.com/cn/virtual-machines/modify-vpc-attribute); ; ## 接口说明; - 调该接口之前实例必须处于停止 `stopped` 状态。; - 修改VPC及子网; - 内网IPv4:可指定或由系统分配。; - IPv6:如新子网支持IPv6,可选是否分配,如分配仅支持系统分配。; - 安全组:须指定新VPC下的安全组。; - 不修改VPC,仅修改子网; - 内网IPv4:可指定或由系统分配。; - IPv6:如新子网支持IPv6,可选是否分配,如分配仅支持系统分配。; - 安全组:不支持绑定新安全组。; - 不修改VPC及子网,仅更换内网IP; - 内网IPv4:须指定IP地址。; - IPv6:不支持修改。; - 安全组:不支持绑定新安全组。; - 一些限制及注意事项:; - 已加入负载均衡-后端服务器组中的实例不允许修改。; - 绑定弹性网卡的实例不支持修改VPC,仅支持在同VPC下修改子网和内网IP。; - 主网卡分配了辅助内网IP的实例不支持修改VPC和子网,仅支持在同子网下修改内网IP。; - 如实例在高可用组内,则不允许修改VPC,仅可在同VPC内修改子网或内网IPv4地址。; - 仅在更换VPC时传入安全组ID才有效,且安全组须隶属于目标VPC。; - 如指定内网IPv4,须确保IP地址在子网网段内且未被占用;如不指定则随机分配,须确保子网可用IP充足。; 。 - 示例: jdc vm delete-instance-template --instance-template-id xxx + 示例: jdc vm modify-instance-vpc-attribute --instance-id xxx --subnet-id xxx ''', ) - def delete_instance_template(self): + def modify_instance_vpc_attribute(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DeleteInstanceTemplateRequest import DeleteInstanceTemplateRequest + from jdcloud_sdk.services.vm.apis.ModifyInstanceVpcAttributeRequest import ModifyInstanceVpcAttributeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteInstanceTemplateRequest(params_dict, headers) + req = ModifyInstanceVpcAttributeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1565,30 +1826,32 @@ def delete_instance_template(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-template-id'], dict(help="""(string) 启动模板ID """, dest='instanceTemplateId', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--password'], dict(help="""(string) 实例密码。; 可用于SSH登录和VNC登录。; 长度为8\~30个字符,必须同时包含大、小写英文字母、数字和特殊符号中的三类字符。特殊符号包括:`\(\)\`~!@#$%^&\*\_-+=\|{}\[ ]:";'<>,.?/,`。; 更多密码输入要求请参见 [公共参数规范](https://docs.jdcloud.com/virtual-machines/api/general_parameters)。; """, dest='password', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 校验启动模板的有效性; ''', + help=''' ; 修改云主机密码。; ; 详细操作说明请参考帮助文档:[重置密码](https://docs.jdcloud.com/cn/virtual-machines/reset-password); ; ## 接口说明; - 实例没有正在进行中的任务时才可操作。; - 重置密码后,需要重启云主机后生效。; ''', description=''' - 校验启动模板的有效性; 。 + ; 修改云主机密码。; ; 详细操作说明请参考帮助文档:[重置密码](https://docs.jdcloud.com/cn/virtual-machines/reset-password); ; ## 接口说明; - 实例没有正在进行中的任务时才可操作。; - 重置密码后,需要重启云主机后生效。; 。 - 示例: jdc vm verify-instance-template --instance-template-id xxx + 示例: jdc vm modify-instance-password --instance-id xxx --password xxx ''', ) - def verify_instance_template(self): + def modify_instance_password(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.VerifyInstanceTemplateRequest import VerifyInstanceTemplateRequest + from jdcloud_sdk.services.vm.apis.ModifyInstancePasswordRequest import ModifyInstancePasswordRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = VerifyInstanceTemplateRequest(params_dict, headers) + req = ModifyInstancePasswordRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1598,31 +1861,31 @@ def verify_instance_template(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--service-name'], dict(help="""(string) 服务类型,取值为{vm、nc},vm代表虚机、nc代表原生容器 """, dest='serviceName', required=False)), - (['--filters'], dict(help="""(array: filter) instanceTypes - 实例规格,精确匹配,支持多个; az - 可用区,精确匹配,支持多个; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询实例规格信息列表; ''', + help=''' ; 获取云主机vnc地址。; ; 详细操作说明请参考帮助文档:[连接实例](https://docs.jdcloud.com/cn/virtual-machines/connect-to-instance); ; ## 接口说明; - 实例仅 `running` 状态时才可获取到 `vnc` 地址。; - 调用该接口可获取云主机 `vnc` 地址,用于远程连接管理云主机。; - `vnc` 地址的有效期为1个小时,调用接口获取vnc地址后如果1个小时内没有使用,`vnc` 地址将自动失效,再次使用需要重新获取。; - 裸金属实例目前不支持通过 `vnc` 登录。; ''', description=''' - 查询实例规格信息列表; 。 + ; 获取云主机vnc地址。; ; 详细操作说明请参考帮助文档:[连接实例](https://docs.jdcloud.com/cn/virtual-machines/connect-to-instance); ; ## 接口说明; - 实例仅 `running` 状态时才可获取到 `vnc` 地址。; - 调用该接口可获取云主机 `vnc` 地址,用于远程连接管理云主机。; - `vnc` 地址的有效期为1个小时,调用接口获取vnc地址后如果1个小时内没有使用,`vnc` 地址将自动失效,再次使用需要重新获取。; - 裸金属实例目前不支持通过 `vnc` 登录。; 。 - 示例: jdc vm describe-instance-types + 示例: jdc vm describe-instance-vnc-url --instance-id xxx ''', ) - def describe_instance_types(self): + def describe_instance_vnc_url(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeInstanceTypesRequest import DescribeInstanceTypesRequest + from jdcloud_sdk.services.vm.apis.DescribeInstanceVncUrlRequest import DescribeInstanceVncUrlRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeInstanceTypesRequest(params_dict, headers) + req = DescribeInstanceVncUrlRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1632,32 +1895,33 @@ def describe_instance_types(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码;默认为1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认为20;取值范围[10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) keyNames - 密钥对名称,精确匹配,支持多个; """, dest='filters', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--instance-type'], dict(help="""(string) 实例规格,可查询 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes) 接口获得指定地域或可用区的规格信息。 """, dest='instanceType', required=True)), + (['--force'], dict(help="""(bool) 是否强制调配,默认为 `false`。如果指定为 `true`, 将会清除本地数据盘。 """, dest='force', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量查询密钥对。
; 此接口支持分页查询,默认每页20条。; ''', + help=''' ; 变更云主机实例配置。; ; 详细操作说明请参考帮助文档:[调整配置](https://docs.jdcloud.com/cn/virtual-machines/resize-instance); ; ## 接口说明; - 云主机的状态必须为 `stopped` 状态。; - 16年创建的云硬盘做系统盘的云主机,实例规格不允许跨代调配。; - 若当前实例系统盘为本地盘,则不允许跨代调配,例如第一代云主机不允许与第二代云主机互相调配,且不允许调整至第一代存储优化大数据型 `s.d1` 及第二代存储优化大数据型 `s.d2`。; - 若当前实例在高可用组内,则不允许调配至除GPU类型外的第一代云主机,受限于高可用组支持的规格情况。; - 若当前实例已挂载加密云盘,则不允许调配至第一代云主机,受限于支持加密盘的规格情况。; - 裸金属实例规格主机暂不支持调配,即不支持从其他规格调整为裸金属规格或从裸金属规格调整为其他规格。; - 对于按配置计费实例,调整配置后将按照新规格计费,调整前规格会立即出账结算(即对上次整点结算时间至当前时间产生的费用进行结算)。; - 若当前实例带有本地数据盘,需清除本地盘内数据才可调整配置,还请谨慎操作。; - 对于包年包月计费云主机:; - 若调配后规格价格低于调配前规格价格,则将延长云主机到期时间;; - 若调配后规格价格高于调配前规格价格,需要支付到期前的差价。; - 如果当前主机中的弹性网卡数量,超过了目标实例规格允许的弹性网卡数量,会返回错误。可查询 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes) 接口获得实例规格允许的弹性网卡数量。; - 如果当前主机中的云硬盘数据,超过了目标实例规格允许的云硬盘数量,会返回错误。可查询 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes) 接口获得实例规格允许的云硬盘数量。; - 当前主机所使用的镜像,需要支持目标实例规格,否则返回错误。可查询 [DescribeImageConstraints](docs.jdcloud.com/virtual-machines/api/describeimageconstraints) 接口获得指定镜像的实例规格限制信息。; - 云主机欠费或到期时,无法更改实例规格。; ''', description=''' - 批量查询密钥对。
; 此接口支持分页查询,默认每页20条。; 。 + ; 变更云主机实例配置。; ; 详细操作说明请参考帮助文档:[调整配置](https://docs.jdcloud.com/cn/virtual-machines/resize-instance); ; ## 接口说明; - 云主机的状态必须为 `stopped` 状态。; - 16年创建的云硬盘做系统盘的云主机,实例规格不允许跨代调配。; - 若当前实例系统盘为本地盘,则不允许跨代调配,例如第一代云主机不允许与第二代云主机互相调配,且不允许调整至第一代存储优化大数据型 `s.d1` 及第二代存储优化大数据型 `s.d2`。; - 若当前实例在高可用组内,则不允许调配至除GPU类型外的第一代云主机,受限于高可用组支持的规格情况。; - 若当前实例已挂载加密云盘,则不允许调配至第一代云主机,受限于支持加密盘的规格情况。; - 裸金属实例规格主机暂不支持调配,即不支持从其他规格调整为裸金属规格或从裸金属规格调整为其他规格。; - 对于按配置计费实例,调整配置后将按照新规格计费,调整前规格会立即出账结算(即对上次整点结算时间至当前时间产生的费用进行结算)。; - 若当前实例带有本地数据盘,需清除本地盘内数据才可调整配置,还请谨慎操作。; - 对于包年包月计费云主机:; - 若调配后规格价格低于调配前规格价格,则将延长云主机到期时间;; - 若调配后规格价格高于调配前规格价格,需要支付到期前的差价。; - 如果当前主机中的弹性网卡数量,超过了目标实例规格允许的弹性网卡数量,会返回错误。可查询 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes) 接口获得实例规格允许的弹性网卡数量。; - 如果当前主机中的云硬盘数据,超过了目标实例规格允许的云硬盘数量,会返回错误。可查询 [DescribeInstanceTypes](https://docs.jdcloud.com/virtual-machines/api/describeinstancetypes) 接口获得实例规格允许的云硬盘数量。; - 当前主机所使用的镜像,需要支持目标实例规格,否则返回错误。可查询 [DescribeImageConstraints](docs.jdcloud.com/virtual-machines/api/describeimageconstraints) 接口获得指定镜像的实例规格限制信息。; - 云主机欠费或到期时,无法更改实例规格。; 。 - 示例: jdc vm describe-keypairs + 示例: jdc vm resize-instance --instance-id xxx --instance-type xxx ''', ) - def describe_keypairs(self): + def resize_instance(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeKeypairsRequest import DescribeKeypairsRequest + from jdcloud_sdk.services.vm.apis.ResizeInstanceRequest import ResizeInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeKeypairsRequest(params_dict, headers) + req = ResizeInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1667,30 +1931,39 @@ def describe_keypairs(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--key-name'], dict(help="""(string) 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。; """, dest='keyName', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--password'], dict(help="""(string) 实例密码。; 可用于SSH登录和VNC登录。; 长度为8\~30个字符,必须同时包含大、小写英文字母、数字和特殊符号中的三类字符。特殊符号包括:`\(\)\`~!@#$%^&\*\_-+=\|{}\[ ]:";'<>,.?/,`。; 更多密码输入要求请参见 [公共参数规范](https://docs.jdcloud.com/virtual-machines/api/general_parameters)。; """, dest='password', required=False)), + (['--image-id'], dict(help="""(string) 镜像ID。; 若不指定镜像ID,默认使用当前主机的原镜像重置系统。; 可查询 [DescribeImages](https://docs.jdcloud.com/virtual-machines/api/describeimages) 接口获得指定地域的镜像信息。; """, dest='imageId', required=False)), + (['--key-names'], dict(help="""(array: string) 密钥对名称。仅Linux系统下该参数生效,当前仅支持输入单个密钥。; """, dest='keyNames', required=False)), + (['--hostname'], dict(help="""(string) 实例hostname。; 若不指定hostname,则默认以实例名称`name`作为hostname,但是会以RFC 952和RFC 1123命名规范做一定转义。; **Windows系统**:长度为2\~15个字符,允许大小写字母、数字或连字符(-),不能以连字符(-)开头或结尾,不能连续使用连字符(-),也不能全部使用数字。不支持点号(.)。; **Linux系统**:长度为2-64个字符,允许支持多个点号,点之间为一段,每段允许使用大小写字母、数字或连字符(-),但不能连续使用点号(.)或连字符(-),不能以点号(.)或连字符(-)开头或结尾。; """, dest='hostname', required=False)), + (['--metadata'], dict(help="""(array: metadata) 用户自定义元数据。; 以 `key-value` 键值对形式指定,可在实例系统内通过元数据服务查询获取。最多支持40对键值对,且 `key` 不超过256字符,`value` 不超过16KB,不区分大小写。; 注意:`key` 不要以连字符(-)结尾,否则此 `key` 不生效。; """, dest='metadata', required=False)), + (['--userdata'], dict(help="""(array: userdata) 自定义脚本。; 目前仅支持启动脚本,即 `launch-script`,须Base64编码且编码前数据长度不能超过16KB。; **linux系统**:支持bash和python,编码前须分别以 `#!/bin/bash` 和 `#!/usr/bin/env python` 作为内容首行。; **Windows系统**:支持 `bat` 和 `powershell`,编码前须分别以 `` 作为内容首、尾行。; """, dest='userdata', required=False)), + (['--pass-word-auth'], dict(help="""(string) 密码授权,若存在密匙,则根据此参数决定是否使用密码,若没有密匙,此参数无效,会强制使用密码。; 若不使用密码,且密匙对解绑后,用户需重置密码,方可使用密码登录。; 此参数在windows系统中必须为yes。; """, dest='passWordAuth', required=False)), + (['--image-inherit'], dict(help="""(string) 继承镜像中的登录验证方式,"yes"为使用,"no"为不使用,""默认为"no" """, dest='imageInherit', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建ssh密钥对。公钥部分存储在京东云,并返回未加密的 PEM 编码的 PKCS#8 格式私钥,您只有一次机会保存您的私钥。请妥善保管。
; 若传入已存在的密钥名称,会返回错误。; ''', + help=''' ; 重置云主机系统。; ; 需要注意的是,重装系统会导致系统盘的内容全部丢失,数据盘的数据不受影响(但需要重新识别)。因此,在需要保留系统运行数据的情况下,强烈建议您在重置系统前制作私有镜像,之后重置时选择该私有镜像即可实现保留系统运行数据。; ; 详细操作说明请参考帮助文档:[重置系统](https://docs.jdcloud.com/cn/virtual-machines/rebuild-instance); ; ## 接口说明; - 云主机的状态必须为 `stopped` 状态。; - 若实例基于私有镜像创建,而私有镜像已被删除,则无法使用原镜像重置系统,即无法恢复至刚创建时的系统状态,建议保留被实例引用的私有镜像。; - 重置系统需要重新指定密码,对于 `Linux` 系统您还可以重新指定 `SSH密钥`。; - 对于云盘作系统盘的实例,当前系统盘大小不能超过目标镜像对应系统盘快照的容量。; - 云主机系统盘类型必须与待更换镜像支持的系统盘类型保持一致,若当前云主机系统盘为 `local` 类型,则更换镜像的系统盘类型必须为 `loaclDisk` 类型;同理,若当前云主机系统盘为 `cloud` 类型,则更换镜像的系统盘类型必须为 `cloudDisk` 类型。可查询 [DescribeImages](https://docs.jdcloud.com/virtual-machines/api/describeimages) 接口获得指定地域的镜像信息。; - 指定的镜像必须能够支持当前主机的实例规格 `instanceType`,否则会返回错误。可查询 [DescribeImageConstraints](docs.jdcloud.com/virtual-machines/api/describeimageconstraints) 接口获得指定镜像支持的系统盘类型信息。; ''', description=''' - 创建ssh密钥对。公钥部分存储在京东云,并返回未加密的 PEM 编码的 PKCS#8 格式私钥,您只有一次机会保存您的私钥。请妥善保管。
; 若传入已存在的密钥名称,会返回错误。; 。 + ; 重置云主机系统。; ; 需要注意的是,重装系统会导致系统盘的内容全部丢失,数据盘的数据不受影响(但需要重新识别)。因此,在需要保留系统运行数据的情况下,强烈建议您在重置系统前制作私有镜像,之后重置时选择该私有镜像即可实现保留系统运行数据。; ; 详细操作说明请参考帮助文档:[重置系统](https://docs.jdcloud.com/cn/virtual-machines/rebuild-instance); ; ## 接口说明; - 云主机的状态必须为 `stopped` 状态。; - 若实例基于私有镜像创建,而私有镜像已被删除,则无法使用原镜像重置系统,即无法恢复至刚创建时的系统状态,建议保留被实例引用的私有镜像。; - 重置系统需要重新指定密码,对于 `Linux` 系统您还可以重新指定 `SSH密钥`。; - 对于云盘作系统盘的实例,当前系统盘大小不能超过目标镜像对应系统盘快照的容量。; - 云主机系统盘类型必须与待更换镜像支持的系统盘类型保持一致,若当前云主机系统盘为 `local` 类型,则更换镜像的系统盘类型必须为 `loaclDisk` 类型;同理,若当前云主机系统盘为 `cloud` 类型,则更换镜像的系统盘类型必须为 `cloudDisk` 类型。可查询 [DescribeImages](https://docs.jdcloud.com/virtual-machines/api/describeimages) 接口获得指定地域的镜像信息。; - 指定的镜像必须能够支持当前主机的实例规格 `instanceType`,否则会返回错误。可查询 [DescribeImageConstraints](docs.jdcloud.com/virtual-machines/api/describeimageconstraints) 接口获得指定镜像支持的系统盘类型信息。; 。 - 示例: jdc vm create-keypair --key-name xxx + 示例: jdc vm rebuild-instance --instance-id xxx ''', ) - def create_keypair(self): + def rebuild_instance(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.CreateKeypairRequest import CreateKeypairRequest + from jdcloud_sdk.services.vm.apis.RebuildInstanceRequest import RebuildInstanceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateKeypairRequest(params_dict, headers) + req = RebuildInstanceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1700,31 +1973,33 @@ def create_keypair(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--key-name'], dict(help="""(string) 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。; """, dest='keyName', required=True)), - (['--public-key'], dict(help="""(string) 密钥对的公钥部分 """, dest='publicKey', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认为1。 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认为10;取值范围[1, 10]。 """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) filters 中支持使用以下关键字进行过滤; `instanceId`: 云主机ID,精确匹配,支持多个; `privateIpAddress`: 主网卡内网主IP地址,模糊匹配,支持多个; `vpcId`: 私有网络ID,精确匹配,支持多个; `status`: 云主机状态,精确匹配,支持多个,参考 [云主机状态](https://docs.jdcloud.com/virtual-machines/api/vm_status); `name`: 云主机名称,模糊匹配,支持单个; `imageId`: 镜像ID,精确匹配,支持多个; `agId`: 使用可用组id,支持单个; `faultDomain`: 错误域,支持多个; `networkInterfaceId`: 弹性网卡ID,精确匹配,支持多个; `subnetId`: 子网ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 导入由其他工具生成的密钥对的公钥部分。
; 若传入已存在的密钥名称,会返回错误。; ''', + help=''' ; 批量查询云主机用户自定义元数据。; ; 详细操作说明请参考帮助文档:[自定义元数据](https://docs.jdcloud.com/cn/virtual-machines/userdata); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 单次查询最大可查询10台云主机实例自定义元数据。; ''', description=''' - 导入由其他工具生成的密钥对的公钥部分。
; 若传入已存在的密钥名称,会返回错误。; 。 + ; 批量查询云主机用户自定义元数据。; ; 详细操作说明请参考帮助文档:[自定义元数据](https://docs.jdcloud.com/cn/virtual-machines/userdata); ; ## 接口说明; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; - 单次查询最大可查询10台云主机实例自定义元数据。; 。 - 示例: jdc vm import-keypair --key-name xxx --public-key xxx + 示例: jdc vm describe-instances-custom-data ''', ) - def import_keypair(self): + def describe_instances_custom_data(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.ImportKeypairRequest import ImportKeypairRequest + from jdcloud_sdk.services.vm.apis.DescribeInstancesCustomDataRequest import DescribeInstancesCustomDataRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ImportKeypairRequest(params_dict, headers) + req = DescribeInstancesCustomDataRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1734,30 +2009,34 @@ def import_keypair(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--key-name'], dict(help="""(string) 密钥名称 """, dest='keyName', required=True)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) 云主机ID。 """, dest='instanceId', required=True)), + (['--ag-id'], dict(help="""(string) 高可用组Id,必填项。; 可查询 [DescribeAgs](https://docs.jdcloud.com/cn/availability-group/api/describeags) 接口获得高可用组信息。; """, dest='agId', required=False)), + (['--balance'], dict(help="""(bool) 是否强制均衡,默认 false; """, dest='balance', type=bool, required=False)), + (['--clear-local-disk'], dict(help="""(bool) 是否确认清除本地盘数据,默认 false; """, dest='clearLocalDisk', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除ssh密钥对。; ''', + help=''' ; 存量主机加入高可用组。; ; 存量主机加入高可用组,或者主机从一个高可用组移动到另一个高可用组; ; ## 接口说明; - 不支持专属宿主机上的实例调整高可用组。; - 除GPU、vGPU(以P开头)外的一代机暂不支持调整高可用组。; - 与该高可用组关联实例模板的VPC不同的不支持调整高可用组。; - 与该高可用组可用区不匹配的实例不支持调整高可用组。; - 本地系统盘机型不支持强制均衡。; - 仅支持实例状态为已停止的实例强制均衡调整高可用组。; - 若不强制均衡,仅支持实例状态为运行中或已停止的实例调整高可用组。; - 若强制均衡,带本地数据盘的实例需确认清除本地盘数据。; ''', description=''' - 删除ssh密钥对。; 。 + ; 存量主机加入高可用组。; ; 存量主机加入高可用组,或者主机从一个高可用组移动到另一个高可用组; ; ## 接口说明; - 不支持专属宿主机上的实例调整高可用组。; - 除GPU、vGPU(以P开头)外的一代机暂不支持调整高可用组。; - 与该高可用组关联实例模板的VPC不同的不支持调整高可用组。; - 与该高可用组可用区不匹配的实例不支持调整高可用组。; - 本地系统盘机型不支持强制均衡。; - 仅支持实例状态为已停止的实例强制均衡调整高可用组。; - 若不强制均衡,仅支持实例状态为运行中或已停止的实例调整高可用组。; - 若强制均衡,带本地数据盘的实例需确认清除本地盘数据。; 。 - 示例: jdc vm delete-keypair --key-name xxx + 示例: jdc vm modify-instance-placement --instance-id xxx ''', ) - def delete_keypair(self): + def modify_instance_placement(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DeleteKeypairRequest import DeleteKeypairRequest + from jdcloud_sdk.services.vm.apis.ModifyInstancePlacementRequest import ModifyInstancePlacementRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteKeypairRequest(params_dict, headers) + req = ModifyInstancePlacementRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1767,31 +2046,32 @@ def delete_keypair(self): @expose( arguments=[ - (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--filters'], dict(help="""(array: filter) resourceTypes - 资源类型,支持多个[instance,keypair,image,instanceTemplate,imageShare]; """, dest='filters', required=False)), - (['--image-id'], dict(help="""(string) 私有镜像Id,查询镜像共享(imageShare)配额时,此参数必传 """, dest='imageId', required=False)), + (['--region-id'], dict(help="""(string) 地域ID。 """, dest='regionId', required=False)), + (['--service-name'], dict(help="""(string) 产品线类型,默认为 `vm`。支持范围:`vm` 云主机,`nc` 原生容器。 """, dest='serviceName', required=False)), + (['--filters'], dict(help="""(array: filter) filters 中支持使用以下关键字进行过滤; `instanceTypes`: 实例规格,精确匹配,支持多个; `az`: 可用区,精确匹配,支持多个; `architecture`: CPU架构,精确匹配,支持单个,可选范围:x86_64或arm64; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询配额,支持的类型:云主机、镜像、密钥、模板、镜像共享。; ''', + help=''' ; 查询实例规格列表。; ; 详细操作说明请参考帮助文档:[实例规格类型](https://docs.jdcloud.com/cn/virtual-machines/instance-type-family); ; ## 接口说明; - 调用该接口可查询全量实例规格信息。; - 可查询实例规格的CPU、内存大小、可绑定的弹性网卡数量、可挂载的云硬盘数量,是否售卖等信息。; - GPU 或 本地存储型的规格可查询 GPU型号、GPU卡数量、本地盘数量。; - 尽量使用过滤器查询关心的实例规格,并适当缓存这些信息。否则全量查询可能响应较慢。; ''', description=''' - 查询配额,支持的类型:云主机、镜像、密钥、模板、镜像共享。; 。 + ; 查询实例规格列表。; ; 详细操作说明请参考帮助文档:[实例规格类型](https://docs.jdcloud.com/cn/virtual-machines/instance-type-family); ; ## 接口说明; - 调用该接口可查询全量实例规格信息。; - 可查询实例规格的CPU、内存大小、可绑定的弹性网卡数量、可挂载的云硬盘数量,是否售卖等信息。; - GPU 或 本地存储型的规格可查询 GPU型号、GPU卡数量、本地盘数量。; - 尽量使用过滤器查询关心的实例规格,并适当缓存这些信息。否则全量查询可能响应较慢。; 。 - 示例: jdc vm describe-quotas + 示例: jdc vm describe-instance-types ''', ) - def describe_quotas(self): + def describe_instance_types(self): client_factory = ClientFactory('vm') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vm.apis.DescribeQuotasRequest import DescribeQuotasRequest + from jdcloud_sdk.services.vm.apis.DescribeInstanceTypesRequest import DescribeInstanceTypesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeQuotasRequest(params_dict, headers) + req = DescribeInstanceTypesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1801,7 +2081,7 @@ def describe_quotas(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-image','delete-image','describe-images','describe-image-constraints','describe-image-constraints-batch','share-image','un-share-image','release-image','un-release-image','describe-image-members','copy-images','modify-image-attribute','import-image','export-image','image-tasks','describe-instances','create-instances','describe-brief-instances','describe-instance','delete-instance','describe-instance-status','describe-instance-private-ip-address','stop-instance','start-instance','reboot-instance','attach-network-interface','detach-network-interface','modify-instance-network-attribute','associate-elastic-ip','disassociate-elastic-ip','create-image','attach-disk','detach-disk','modify-instance-disk-attribute','modify-instance-attribute','modify-instance-password','describe-instance-vnc-url','resize-instance','rebuild-instance','describe-instance-templates','create-instance-template','describe-instance-template','update-instance-template','delete-instance-template','verify-instance-template','describe-instance-types','describe-keypairs','create-keypair','import-keypair','delete-keypair','describe-quotas',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-instance-templates','create-instance-template','describe-instance-template','update-instance-template','delete-instance-template','verify-instance-template','describe-instance-templates-customdata','describe-keypairs','create-keypair','import-keypair','delete-keypair','attach-keypair','detach-keypair','describe-image','delete-image','describe-images','describe-image-constraints','describe-image-constraints-batch','share-image','un-share-image','release-image','un-release-image','describe-image-members','copy-images','modify-image-attribute','import-image','export-image','image-tasks','describe-quotas','describe-instances','create-instances','describe-brief-instances','describe-instance','delete-instance','describe-instance-status','describe-instance-private-ip-address','stop-instance','start-instance','reboot-instance','attach-network-interface','detach-network-interface','modify-instance-network-attribute','associate-elastic-ip','disassociate-elastic-ip','create-image','attach-disk','detach-disk','modify-instance-disk-attribute','modify-instance-attribute','modify-instance-vpc-attribute','modify-instance-password','describe-instance-vnc-url','resize-instance','rebuild-instance','describe-instances-custom-data','modify-instance-placement','describe-instance-types',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/vod.py b/jdcloud_cli/controllers/services/vod.py index 5254efa..e297fe3 100644 --- a/jdcloud_cli/controllers/services/vod.py +++ b/jdcloud_cli/controllers/services/vod.py @@ -40,29 +40,1009 @@ class Meta: arguments=[ (['--page-number'], dict(help="""(int) 页码;默认值为 1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询转码模板组列表。; ''', + description=''' + 查询转码模板组列表。; 。 + + 示例: jdc vod list-transcode-template-groups + ''', + ) + def list_transcode_template_groups(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.ListTranscodeTemplateGroupsRequest import ListTranscodeTemplateGroupsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ListTranscodeTemplateGroupsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--group-name'], dict(help="""(string) 转码模板组名称 """, dest='groupName', required=False)), + (['--templates'], dict(help="""(array: groupedTranscodeTemplateData) NA """, dest='templates', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建转码模板组 ''', + description=''' + 创建转码模板组。 + + 示例: jdc vod create-transcode-template-group + ''', + ) + def create_transcode_template_group(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.CreateTranscodeTemplateGroupRequest import CreateTranscodeTemplateGroupRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateTranscodeTemplateGroupRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--group-id'], dict(help="""(string) 模板组ID """, dest='groupId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询转码模板组 ''', + description=''' + 查询转码模板组。 + + 示例: jdc vod get-transcode-template-group --group-id xxx + ''', + ) + def get_transcode_template_group(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.GetTranscodeTemplateGroupRequest import GetTranscodeTemplateGroupRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = GetTranscodeTemplateGroupRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--group-id'], dict(help="""(string) 模板组ID """, dest='groupId', required=True)), + (['--group-name'], dict(help="""(string) 转码模板组名称 """, dest='groupName', required=False)), + (['--templates'], dict(help="""(array: groupedTranscodeTemplateData) NA """, dest='templates', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改转码模板组 ''', + description=''' + 修改转码模板组。 + + 示例: jdc vod update-transcode-template-group --group-id xxx + ''', + ) + def update_transcode_template_group(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.UpdateTranscodeTemplateGroupRequest import UpdateTranscodeTemplateGroupRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateTranscodeTemplateGroupRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--group-id'], dict(help="""(string) 模板组ID """, dest='groupId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除转码模板组 ''', + description=''' + 删除转码模板组。 + + 示例: jdc vod delete-transcode-template-group --group-id xxx + ''', + ) + def delete_transcode_template_group(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.DeleteTranscodeTemplateGroupRequest import DeleteTranscodeTemplateGroupRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteTranscodeTemplateGroupRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--group-id'], dict(help="""(string) 模板组ID """, dest='groupId', required=False)), + (['--template-ids'], dict(help="""(int) 待删除的模板ID列表 """, dest='templateIds', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除转码模板组中的模板。; ''', + description=''' + 删除转码模板组中的模板。; 。 + + 示例: jdc vod delete-grouped-transcode-templates + ''', + ) + def delete_grouped_transcode_templates(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.DeleteGroupedTranscodeTemplatesRequest import DeleteGroupedTranscodeTemplatesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteGroupedTranscodeTemplatesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--page-number'], dict(help="""(int) 页码;默认值为 1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询质测模板列表。; ''', + description=''' + 查询质测模板列表。; 。 + + 示例: jdc vod list-quality-detection-templates + ''', + ) + def list_quality_detection_templates(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.ListQualityDetectionTemplatesRequest import ListQualityDetectionTemplatesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ListQualityDetectionTemplatesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--name'], dict(help="""(string) 模板名称。长度不超过128个字符。UTF-8编码。; """, dest='name', required=True)), + (['--template-type'], dict(help="""(string) 模板类型,区分该模板的检测内容。目前只支持 video 。 """, dest='templateType', required=True)), + (['--detections'], dict(help="""(array: string) 检测项列表。取值范围:; blackScreen - 黑场; pureColor - 纯色; colorCast - 偏色; frozenFrame - 静帧; brightness - 亮度; contrast - 对比度; """, dest='detections', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建质检模板 ''', + description=''' + 创建质检模板。 + + 示例: jdc vod create-quality-detection-template --name xxx --template-type xxx + ''', + ) + def create_quality_detection_template(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.CreateQualityDetectionTemplateRequest import CreateQualityDetectionTemplateRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateQualityDetectionTemplateRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--template-id'], dict(help="""(int) 模板ID """, dest='templateId', type=int, required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询质检模板 ''', + description=''' + 查询质检模板。 + + 示例: jdc vod get-quality-detection-template --template-id 5 + ''', + ) + def get_quality_detection_template(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.GetQualityDetectionTemplateRequest import GetQualityDetectionTemplateRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = GetQualityDetectionTemplateRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--template-id'], dict(help="""(int) 模板ID """, dest='templateId', type=int, required=True)), + (['--name'], dict(help="""(string) 模板名称。长度不超过128个字符。UTF-8编码。; """, dest='name', required=False)), + (['--detections'], dict(help="""(array: string) 检测项列表。取值范围:; blackScreen - 黑场; pureColor - 纯色; colorCast - 偏色; frozenFrame - 静帧; brightness - 亮度; contrast - 对比度; """, dest='detections', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改质检模板 ''', + description=''' + 修改质检模板。 + + 示例: jdc vod update-quality-detection-template --template-id 5 + ''', + ) + def update_quality_detection_template(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.UpdateQualityDetectionTemplateRequest import UpdateQualityDetectionTemplateRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateQualityDetectionTemplateRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--template-id'], dict(help="""(int) 模板ID """, dest='templateId', type=int, required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除质检模板 ''', + description=''' + 删除质检模板。 + + 示例: jdc vod delete-quality-detection-template --template-id 5 + ''', + ) + def delete_quality_detection_template(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.DeleteQualityDetectionTemplateRequest import DeleteQualityDetectionTemplateRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteQualityDetectionTemplateRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--http-method'], dict(help="""(string) HTTP 请求方法,上传支持 PUT 和 POST 方法,默认值为 PUT 。; 通过该接口获取到上传地址和凭证之后,后续的上传动作,必须使用和该值一致的方法进行文件上传。; """, dest='httpMethod', required=False)), + (['--title'], dict(help="""(string) 视频标题 """, dest='title', required=True)), + (['--file-name'], dict(help="""(string) 文件名称 """, dest='fileName', required=True)), + (['--file-size'], dict(help="""(int) 文件大小 """, dest='fileSize', type=int, required=False)), + (['--cover-url'], dict(help="""(string) 封面地址 """, dest='coverUrl', required=False)), + (['--description'], dict(help="""(string) 视频描述 """, dest='description', required=False)), + (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=False)), + (['--tags'], dict(help="""(array: string) 视频标签集合 """, dest='tags', required=False)), + (['--transcode-template-group-id'], dict(help="""(string) 转码模板组ID """, dest='transcodeTemplateGroupId', required=False)), + (['--transcode-template-ids'], dict(help="""(array: int) 转码模板ID集合 """, dest='transcodeTemplateIds', type=int, required=False)), + (['--watermark-ids'], dict(help="""(array: int) 水印ID集合 """, dest='watermarkIds', type=int, required=False)), + (['--user-data'], dict(help="""(string) 自定义数据 """, dest='userData', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取视频上传地址和凭证 ''', + description=''' + 获取视频上传地址和凭证。 + + 示例: jdc vod create-video-upload-task --title xxx --file-name xxx + ''', + ) + def create_video_upload_task(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.CreateVideoUploadTaskRequest import CreateVideoUploadTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateVideoUploadTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--video-id'], dict(help="""(string) 视频地址 """, dest='videoId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 刷新视频上传地址和凭证 ''', + description=''' + 刷新视频上传地址和凭证。 + + 示例: jdc vod refresh-video-upload-task --video-id xxx + ''', + ) + def refresh_video_upload_task(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.RefreshVideoUploadTaskRequest import RefreshVideoUploadTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = RefreshVideoUploadTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--http-method'], dict(help="""(string) HTTP 请求方法,上传支持 PUT 和 POST 方法,默认值为 PUT 。 """, dest='httpMethod', required=False)), + (['--file-name'], dict(help="""(string) 文件名称 """, dest='fileName', required=True)), + (['--file-size'], dict(help="""(int) 文件大小 """, dest='fileSize', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取图片上传地址和凭证 ''', + description=''' + 获取图片上传地址和凭证。 + + 示例: jdc vod create-image-upload-task --file-name xxx + ''', + ) + def create_image_upload_task(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.CreateImageUploadTaskRequest import CreateImageUploadTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateImageUploadTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--title'], dict(help="""(string) 视频标题 """, dest='title', required=True)), + (['--file-name'], dict(help="""(string) 文件名称 """, dest='fileName', required=True)), + (['--file-size'], dict(help="""(int) 文件大小 """, dest='fileSize', type=int, required=False)), + (['--cover-url'], dict(help="""(string) 封面地址 """, dest='coverUrl', required=False)), + (['--description'], dict(help="""(string) 视频描述 """, dest='description', required=False)), + (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=False)), + (['--tags'], dict(help="""(array: string) 视频标签集合 """, dest='tags', required=False)), + (['--transcode-template-group-id'], dict(help="""(string) 转码模板组ID。若此字段不为空,则将以模板组方式提交转码作业,transcodeTemplateIds字段将被忽略。 """, dest='transcodeTemplateGroupId', required=False)), + (['--transcode-template-ids'], dict(help="""(array: int) 转码模板ID集合 """, dest='transcodeTemplateIds', type=int, required=False)), + (['--watermark-ids'], dict(help="""(array: int) 水印ID集合 """, dest='watermarkIds', type=int, required=False)), + (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), + (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), + (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), + (['--record-times'], dict(help="""(array: recordTime) 录制时间段集合; - 支持自定义1-10个时间段,拼接成一个文件; - 每个时间段不小于10s; - 总跨度不超过12小时; - 时间段按升序排列且无重叠; """, dest='recordTimes', required=True)), + (['--record-file-type'], dict(help="""(string) 录制文件类型:; - 取值: ts, flv, mp4; - 不区分大小写; """, dest='recordFileType', required=True)), + (['--task-external-id'], dict(help="""(string) 直播录制任务外键 """, dest='taskExternalId', required=False)), + (['--priority'], dict(help="""(string) 任务优先级:; - 取值: low, medium, high; - 不区分大小写; """, dest='priority', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建直播转点播任务 ''', + description=''' + 创建直播转点播任务。 + + 示例: jdc vod create-live-to-vod-task --title xxx --file-name xxx --publish-domain xxx --app-name xxx --stream-name xxx --record-times ['{"":""}'] --record-file-type xxx + ''', + ) + def create_live_to_vod_task(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.CreateLiveToVodTaskRequest import CreateLiveToVodTaskRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateLiveToVodTaskRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--page-number'], dict(help="""(int) 页码;默认值为 1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), (['--sorts'], dict(help="""(array: sort) NA """, dest='sorts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询视频列表信息。; 允许通过条件过滤查询,支持的过滤字段如下:; - status[eq] 按视频状态精确查询; - categoryId[eq] 按分类ID精确查询; - videoId[eq] 按视频ID精确查询; - name[eq] 按视频名称精确查询; ''', + description=''' + 查询视频列表信息。; 允许通过条件过滤查询,支持的过滤字段如下:; - status[eq] 按视频状态精确查询; - categoryId[eq] 按分类ID精确查询; - videoId[eq] 按视频ID精确查询; - name[eq] 按视频名称精确查询; 。 + + 示例: jdc vod list-videos + ''', + ) + def list_videos(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.ListVideosRequest import ListVideosRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ListVideosRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询单个视频信息 ''', + description=''' + 查询单个视频信息。 + + 示例: jdc vod get-video --video-id xxx + ''', + ) + def get_video(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.GetVideoRequest import GetVideoRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = GetVideoRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), + (['--name'], dict(help="""(string) 视频名称 """, dest='name', required=False)), + (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=False)), + (['--tags'], dict(help="""(array: string) 标签 """, dest='tags', required=False)), + (['--cover-url'], dict(help="""(string) 封面地址 """, dest='coverUrl', required=False)), + (['--description'], dict(help="""(string) 视频描述信息 """, dest='description', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改视频信息 ''', + description=''' + 修改视频信息。 + + 示例: jdc vod update-video --video-id xxx + ''', + ) + def update_video(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.UpdateVideoRequest import UpdateVideoRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = UpdateVideoRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除视频,调用该接口会同时删除与指定视频相关的所有信息,包括转码任务信息、转码流数据等,同时清除云存储中相关文件资源。 ''', + description=''' + 删除视频,调用该接口会同时删除与指定视频相关的所有信息,包括转码任务信息、转码流数据等,同时清除云存储中相关文件资源。。 + + 示例: jdc vod delete-video --video-id xxx + ''', + ) + def delete_video(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.DeleteVideoRequest import DeleteVideoRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteVideoRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--video-ids'], dict(help="""(array: string) 视频ID集合 """, dest='videoIds', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 批量删除视频,调用该接口会同时删除与指定视频相关的所有信息,包括转码任务信息、转码流数据等,同时清除云存储中相关文件资源。 ''', + description=''' + 批量删除视频,调用该接口会同时删除与指定视频相关的所有信息,包括转码任务信息、转码流数据等,同时清除云存储中相关文件资源。。 + + 示例: jdc vod batch-delete-videos + ''', + ) + def batch_delete_videos(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.BatchDeleteVideosRequest import BatchDeleteVideosRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = BatchDeleteVideosRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--bulk-items'], dict(help="""(array: batchUpdateVideosBulkItem) 批量更新视频的条目集合 """, dest='bulkItems', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 批量修改视频信息 ''', + description=''' + 批量修改视频信息。 + + 示例: jdc vod batch-update-videos --bulk-items ['{"":""}'] + ''', + ) + def batch_update_videos(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.BatchUpdateVideosRequest import BatchUpdateVideosRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = BatchUpdateVideosRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取视频播放信息 ''', + description=''' + 获取视频播放信息。 + + 示例: jdc vod get-video-play-info --video-id xxx + ''', + ) + def get_video_play_info(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.GetVideoPlayInfoRequest import GetVideoPlayInfoRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = GetVideoPlayInfoRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), + (['--task-ids'], dict(help="""(array: int) NA """, dest='taskIds', type=int, required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除视频转码流 ''', + description=''' + 删除视频转码流。 + + 示例: jdc vod delete-video-streams --video-id xxx --task-ids [5] + ''', + ) + def delete_video_streams(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.DeleteVideoStreamsRequest import DeleteVideoStreamsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteVideoStreamsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), + (['--audit-result'], dict(help="""(string) 审核结果,取值范围:; block(封禁); unblock(解封); """, dest='auditResult', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 视频审核; 视频在上传中或者转码中不允许更改视频审核状态,即视频只有在正常或屏蔽状态下才可以调用此接口设置审核状态; ''', + description=''' + 视频审核; 视频在上传中或者转码中不允许更改视频审核状态,即视频只有在正常或屏蔽状态下才可以调用此接口设置审核状态; 。 + + 示例: jdc vod video-audit --video-id xxx --audit-result xxx + ''', + ) + def video_audit(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.VideoAuditRequest import VideoAuditRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = VideoAuditRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 获取视频源文件信息 ''', + description=''' + 获取视频源文件信息。 + + 示例: jdc vod get-video-source-info --video-id xxx + ''', + ) + def get_video_source_info(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.GetVideoSourceInfoRequest import GetVideoSourceInfoRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = GetVideoSourceInfoRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--media-id'], dict(help="""(string) 媒资ID """, dest='mediaId', required=False)), + (['--template-ids'], dict(help="""(array: int) 质检模板ID列表 """, dest='templateIds', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 提交质检作业 ''', + description=''' + 提交质检作业。 + + 示例: jdc vod submit-quality-detection-job + ''', + ) + def submit_quality_detection_job(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.SubmitQualityDetectionJobRequest import SubmitQualityDetectionJobRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = SubmitQualityDetectionJobRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--bulk-items'], dict(help="""(array: submitQualityDetectionJobRequestObject) NA """, dest='bulkItems', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 批量提交质检作业 ''', + description=''' + 批量提交质检作业。 + + 示例: jdc vod batch-submit-quality-detection-jobs + ''', + ) + def batch_submit_quality_detection_jobs(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.BatchSubmitQualityDetectionJobsRequest import BatchSubmitQualityDetectionJobsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = BatchSubmitQualityDetectionJobsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--project-name'], dict(help="""(string) 工程名称 """, dest='projectName', required=True)), + (['--description'], dict(help="""(string) 工程描述 """, dest='description', required=False)), + (['--timeline'], dict(help="""(timeline) 时间线信息 """, dest='timeline', required=True)), + (['--media-metadata'], dict(help="""(mediaMetadata) 剪辑合成媒资元数据 """, dest='mediaMetadata', required=False)), + (['--user-data'], dict(help="""(string) 用户数据,JSON格式的字符串。; 在Timeline中的所有MediaClip中,若有2个或以上的不同MediaId,即素材片段来源于2个或以上不同视频,则在提交剪辑作业时,必须在UserData中指明合并后的视频画面的宽高。; 如 {\"extendData\": {\"width\": 720, \"height\": 500}},其中width和height必须为[16, 4096]之间的偶数; videoMode 支持 normal 普通模式 screen_record 屏幕录制模式 两种模式,默认为 normal。; 如 "{\"extendData\":{\"videoMode\":\"screen_record\"}}"; """, dest='userData', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建视频剪辑作业; ''', + description=''' + 创建视频剪辑作业; 。 + + 示例: jdc vod create-vedit-job --project-name xxx --timeline '{"":""}' + ''', + ) + def create_vedit_job(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.CreateVeditJobRequest import CreateVeditJobRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateVeditJobRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--project-id'], dict(help="""(int) 工程ID """, dest='projectId', type=int, required=True)), + (['--media-metadata'], dict(help="""(mediaMetadata) 合成媒资元数据 """, dest='mediaMetadata', required=False)), + (['--user-data'], dict(help="""(string) 用户数据,JSON格式的字符串。; 在Timeline中的所有MediaClip中,若有2个或以上的不同MediaId,即素材片段来源于2个或以上不同视频,则在提交剪辑作业时,必须在UserData中指明合并后的视频画面的宽高。; 如 {\"extendData\": {\"width\": 720, \"height\": 500}},其中width和height必须为[16, 4096]之间的偶数; videoMode 支持 normal 普通模式 screen_record 屏幕录制模式 两种模式,默认为 normal。; 如 "{\"extendData\":{\"videoMode\":\"screen_record\"}}"; """, dest='userData', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询分类列表。按照分页方式,返回分类列表信息。 ''', + help=''' 提交视频剪辑作业 ''', description=''' - 查询分类列表。按照分页方式,返回分类列表信息。。 + 提交视频剪辑作业。 - 示例: jdc vod list-categories + 示例: jdc vod submit-vedit-job --project-id 5 ''', ) - def list_categories(self): + def submit_vedit_job(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.ListCategoriesRequest import ListCategoriesRequest + from jdcloud_sdk.services.vod.apis.SubmitVeditJobRequest import SubmitVeditJobRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListCategoriesRequest(params_dict, headers) + req = SubmitVeditJobRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -72,31 +1052,32 @@ def list_categories(self): @expose( arguments=[ - (['--name'], dict(help="""(string) 分类名称 """, dest='name', required=True)), - (['--parent-id'], dict(help="""(int) 父分类ID,取值为 0 或 null 时,表示该分类为一级分类; """, dest='parentId', type=int, required=False)), - (['--description'], dict(help="""(string) 分类描述信息 """, dest='description', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认值为 1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加分类 ''', + help=''' 查询视频剪辑工程列表。; 允许通过条件过滤查询,支持的过滤字段如下:; - projectId[eq] 按照工程ID精确查询; ''', description=''' - 添加分类。 + 查询视频剪辑工程列表。; 允许通过条件过滤查询,支持的过滤字段如下:; - projectId[eq] 按照工程ID精确查询; 。 - 示例: jdc vod create-category --name xxx + 示例: jdc vod list-vedit-projects ''', ) - def create_category(self): + def list_vedit_projects(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.CreateCategoryRequest import CreateCategoryRequest + from jdcloud_sdk.services.vod.apis.ListVeditProjectsRequest import ListVeditProjectsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateCategoryRequest(params_dict, headers) + req = ListVeditProjectsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -106,29 +1087,32 @@ def create_category(self): @expose( arguments=[ - (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=True)), + (['--project-name'], dict(help="""(string) 工程名称 """, dest='projectName', required=True)), + (['--description'], dict(help="""(string) 工程描述 """, dest='description', required=False)), + (['--timeline'], dict(help="""(timeline) 时间线信息 """, dest='timeline', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询分类及其子分类,若指定的分类ID为0,则返回一个根分类及其子分类(即一级分类). ''', + help=''' 创建视频剪辑工程 ''', description=''' - 查询分类及其子分类,若指定的分类ID为0,则返回一个根分类及其子分类(即一级分类).。 + 创建视频剪辑工程。 - 示例: jdc vod get-category-with-children --category-id 5 + 示例: jdc vod create-vedit-project --project-name xxx --timeline '{"":""}' ''', ) - def get_category_with_children(self): + def create_vedit_project(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.GetCategoryWithChildrenRequest import GetCategoryWithChildrenRequest + from jdcloud_sdk.services.vod.apis.CreateVeditProjectRequest import CreateVeditProjectRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetCategoryWithChildrenRequest(params_dict, headers) + req = CreateVeditProjectRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -138,29 +1122,30 @@ def get_category_with_children(self): @expose( arguments=[ - (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=True)), + (['--project-id'], dict(help="""(int) 视频剪辑工程ID """, dest='projectId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询分类 ''', + help=''' 查询视频剪辑工程详情 ''', description=''' - 查询分类。 + 查询视频剪辑工程详情。 - 示例: jdc vod get-category --category-id 5 + 示例: jdc vod get-vedit-project --project-id 5 ''', ) - def get_category(self): + def get_vedit_project(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.GetCategoryRequest import GetCategoryRequest + from jdcloud_sdk.services.vod.apis.GetVeditProjectRequest import GetVeditProjectRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetCategoryRequest(params_dict, headers) + req = GetVeditProjectRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -170,32 +1155,33 @@ def get_category(self): @expose( arguments=[ - (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=True)), - (['--name'], dict(help="""(string) 分类名称 """, dest='name', required=False)), - (['--parent-id'], dict(help="""(int) 父分类ID,取值为 0 或 null 时,表示该分类为一级分类; """, dest='parentId', type=int, required=False)), - (['--description'], dict(help="""(string) 分类描述信息 """, dest='description', required=False)), + (['--project-id'], dict(help="""(int) 视频剪辑工程ID """, dest='projectId', type=int, required=True)), + (['--project-name'], dict(help="""(string) 工程名称 """, dest='projectName', required=False)), + (['--description'], dict(help="""(string) 工程描述 """, dest='description', required=False)), + (['--timeline'], dict(help="""(timeline) 时间线信息 """, dest='timeline', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改分类 ''', + help=''' 修改视频剪辑工程信息 ''', description=''' - 修改分类。 + 修改视频剪辑工程信息。 - 示例: jdc vod update-category --category-id 5 + 示例: jdc vod update-vedit-project --project-id 5 ''', ) - def update_category(self): + def update_vedit_project(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.UpdateCategoryRequest import UpdateCategoryRequest + from jdcloud_sdk.services.vod.apis.UpdateVeditProjectRequest import UpdateVeditProjectRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateCategoryRequest(params_dict, headers) + req = UpdateVeditProjectRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -205,29 +1191,30 @@ def update_category(self): @expose( arguments=[ - (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=True)), + (['--project-id'], dict(help="""(int) 视频剪辑工程ID """, dest='projectId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除分类 ''', + help=''' 删除视频剪辑工程 ''', description=''' - 删除分类。 + 删除视频剪辑工程。 - 示例: jdc vod delete-category --category-id 5 + 示例: jdc vod delete-vedit-project --project-id 5 ''', ) - def delete_category(self): + def delete_vedit_project(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.DeleteCategoryRequest import DeleteCategoryRequest + from jdcloud_sdk.services.vod.apis.DeleteVeditProjectRequest import DeleteVeditProjectRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteCategoryRequest(params_dict, headers) + req = DeleteVeditProjectRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -241,6 +1228,7 @@ def delete_category(self): (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), (['--sorts'], dict(help="""(array: sort) NA """, dest='sorts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -273,6 +1261,7 @@ def list_domains(self): arguments=[ (['--name'], dict(help="""(string) 域名名称 """, dest='name', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -305,6 +1294,7 @@ def create_domain(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -337,6 +1327,7 @@ def get_domain(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -369,6 +1360,7 @@ def delete_domain(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -401,6 +1393,7 @@ def enable_domain(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -433,6 +1426,7 @@ def disable_domain(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -468,6 +1462,7 @@ def set_default_domain(self): (['--header-value'], dict(help="""(string) 头参数值 """, dest='headerValue', required=True)), (['--header-type'], dict(help="""(string) 头参数类型,取值范围:req、resp """, dest='headerType', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -500,6 +1495,7 @@ def set_header(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -534,6 +1530,7 @@ def list_headers(self): (['--header-name'], dict(help="""(string) 头参数名。当前支持的访问头参数取值范围:; Content-Disposition; Content-Language; Expires; Access-Control-Allow-Origin; Access-Control-Allow-Methods; Access-Control-Max-Age; Access-Control-Expose-Headers; """, dest='headerName', required=True)), (['--header-type'], dict(help="""(string) 头参数类型,取值范围:req、resp """, dest='headerType', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -566,8 +1563,9 @@ def delete_header(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--config'], dict(help="""(refererRuleConfigObject) Referer防盗链规则配置对象 """, dest='config', required=True)), - (['--enabled'], dict(help="""(bool) 是否启用该规则 """, dest='enabled', required=True)), + (['--enabled'], dict(help="""(bool) 是否启用该规则 """, dest='enabled', type=bool, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -600,6 +1598,7 @@ def set_referer_rule(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -632,8 +1631,9 @@ def get_referer_rule(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--config'], dict(help="""(uRLRuleConfigObject) URL鉴权规则配置对象 """, dest='config', required=True)), - (['--enabled'], dict(help="""(bool) 是否启用该规则 """, dest='enabled', required=True)), + (['--enabled'], dict(help="""(bool) 是否启用该规则 """, dest='enabled', type=bool, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -666,6 +1666,7 @@ def set_urlrule(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -698,8 +1699,9 @@ def get_urlrule(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--config'], dict(help="""(iPRuleConfigObject) IP黑名单规则配置对象 """, dest='config', required=True)), - (['--enabled'], dict(help="""(bool) 是否启用该规则 """, dest='enabled', required=True)), + (['--enabled'], dict(help="""(bool) 是否启用该规则 """, dest='enabled', type=bool, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -732,6 +1734,7 @@ def set_iprule(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -768,8 +1771,9 @@ def get_iprule(self): (['--ssl-cert'], dict(help="""(string) 证书内容 """, dest='sslCert', required=False)), (['--ssl-key'], dict(help="""(string) 证书私钥 """, dest='sslKey', required=False)), (['--jump-type'], dict(help="""(string) 跳转类型。取值范围:; default - 采用回源域名的默认协议; http - 强制采用http协议回源; https - 强制采用https协议回源; """, dest='jumpType', required=False)), - (['--enabled'], dict(help="""(bool) SSL配置启用状态 """, dest='enabled', required=False)), + (['--enabled'], dict(help="""(bool) SSL配置启用状态 """, dest='enabled', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -802,6 +1806,7 @@ def set_http_ssl(self): arguments=[ (['--domain-id'], dict(help="""(int) 域名ID """, dest='domainId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -832,185 +1837,32 @@ def get_http_ssl(self): @expose( arguments=[ - (['--title'], dict(help="""(string) 视频标题 """, dest='title', required=True)), - (['--file-name'], dict(help="""(string) 文件名称 """, dest='fileName', required=True)), - (['--file-size'], dict(help="""(int) 文件大小 """, dest='fileSize', type=int, required=False)), - (['--cover-url'], dict(help="""(string) 封面地址 """, dest='coverUrl', required=False)), - (['--description'], dict(help="""(string) 视频描述 """, dest='description', required=False)), - (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=False)), - (['--tags'], dict(help="""(array: string) 视频标签集合 """, dest='tags', required=False)), - (['--transcode-template-ids'], dict(help="""(array: int) 转码模板ID集合 """, dest='transcodeTemplateIds', type=int, required=False)), - (['--watermark-ids'], dict(help="""(array: int) 水印ID集合 """, dest='watermarkIds', type=int, required=False)), - (['--publish-domain'], dict(help="""(string) 推流域名 """, dest='publishDomain', required=True)), - (['--app-name'], dict(help="""(string) 应用名称 """, dest='appName', required=True)), - (['--stream-name'], dict(help="""(string) 流名称 """, dest='streamName', required=True)), - (['--record-times'], dict(help="""(array: recordTime) 录制时间段集合; - 支持自定义1-10个时间段,拼接成一个文件; - 每个时间段不小于10s; - 总跨度不超过12小时; - 时间段按升序排列且无重叠; """, dest='recordTimes', required=True)), - (['--record-file-type'], dict(help="""(string) 录制文件类型:; - 取值: ts, flv, mp4; - 不区分大小写; """, dest='recordFileType', required=True)), - (['--task-external-id'], dict(help="""(string) 直播录制任务外键 """, dest='taskExternalId', required=False)), - (['--priority'], dict(help="""(string) 任务优先级:; - 取值: low, medium, high; - 不区分大小写; """, dest='priority', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 创建直播转点播任务 ''', - description=''' - 创建直播转点播任务。 - - 示例: jdc vod create-live-to-vod-task --title xxx --file-name xxx --publish-domain xxx --app-name xxx --stream-name xxx --record-times ['{"":""}'] --record-file-type xxx - ''', - ) - def create_live_to_vod_task(self): - client_factory = ClientFactory('vod') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.vod.apis.CreateLiveToVodTaskRequest import CreateLiveToVodTaskRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = CreateLiveToVodTaskRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--http-method'], dict(help="""(string) HTTP 请求方法,上传只支持 PUT 方法,默认值为 PUT """, dest='httpMethod', required=False)), - (['--title'], dict(help="""(string) 视频标题 """, dest='title', required=True)), - (['--file-name'], dict(help="""(string) 文件名称 """, dest='fileName', required=True)), - (['--file-size'], dict(help="""(int) 文件大小 """, dest='fileSize', type=int, required=False)), - (['--cover-url'], dict(help="""(string) 封面地址 """, dest='coverUrl', required=False)), - (['--description'], dict(help="""(string) 视频描述 """, dest='description', required=False)), - (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=False)), - (['--tags'], dict(help="""(array: string) 视频标签集合 """, dest='tags', required=False)), - (['--transcode-template-ids'], dict(help="""(array: int) 转码模板ID集合 """, dest='transcodeTemplateIds', type=int, required=False)), - (['--watermark-ids'], dict(help="""(array: int) 水印ID集合 """, dest='watermarkIds', type=int, required=False)), - (['--user-data'], dict(help="""(string) 自定义数据 """, dest='userData', required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 获取视频上传地址和凭证 ''', - description=''' - 获取视频上传地址和凭证。 - - 示例: jdc vod create-video-upload-task --title xxx --file-name xxx - ''', - ) - def create_video_upload_task(self): - client_factory = ClientFactory('vod') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.vod.apis.CreateVideoUploadTaskRequest import CreateVideoUploadTaskRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = CreateVideoUploadTaskRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--video-id'], dict(help="""(string) 视频地址 """, dest='videoId', required=True)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 刷新视频上传地址和凭证 ''', - description=''' - 刷新视频上传地址和凭证。 - - 示例: jdc vod refresh-video-upload-task --video-id xxx - ''', - ) - def refresh_video_upload_task(self): - client_factory = ClientFactory('vod') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.vod.apis.RefreshVideoUploadTaskRequest import RefreshVideoUploadTaskRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = RefreshVideoUploadTaskRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--http-method'], dict(help="""(string) HTTP 请求方法,上传只支持 PUT 方法,默认值为 PUT """, dest='httpMethod', required=False)), - (['--file-name'], dict(help="""(string) 文件名称 """, dest='fileName', required=True)), - (['--file-size'], dict(help="""(int) 文件大小 """, dest='fileSize', type=int, required=False)), - (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), - (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), - ], - formatter_class=RawTextHelpFormatter, - help=''' 获取图片上传地址和凭证 ''', - description=''' - 获取图片上传地址和凭证。 - - 示例: jdc vod create-image-upload-task --file-name xxx - ''', - ) - def create_image_upload_task(self): - client_factory = ClientFactory('vod') - client = client_factory.get(self.app) - if client is None: - return - - try: - from jdcloud_sdk.services.vod.apis.CreateImageUploadTaskRequest import CreateImageUploadTaskRequest - params_dict = collect_user_args(self.app) - headers = collect_user_headers(self.app) - req = CreateImageUploadTaskRequest(params_dict, headers) - resp = client.send(req) - Printer.print_result(resp) - except ImportError: - print('{"error":"This api is not supported, please use the newer version"}') - except Exception as e: - print(e) - - @expose( - arguments=[ - (['--media-id'], dict(help="""(string) 媒资ID """, dest='mediaId', required=False)), - (['--template-ids'], dict(help="""(array: int) 质检模板ID列表 """, dest='templateIds', type=int, required=False)), + (['--page-number'], dict(help="""(int) 页码;默认值为 1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), + (['--sorts'], dict(help="""(array: sort) NA """, dest='sorts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 提交质检作业 ''', + help=''' 查询分类列表。按照分页方式,返回分类列表信息。 ''', description=''' - 提交质检作业。 + 查询分类列表。按照分页方式,返回分类列表信息。。 - 示例: jdc vod submit-quality-detection-job + 示例: jdc vod list-categories ''', ) - def submit_quality_detection_job(self): + def list_categories(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.SubmitQualityDetectionJobRequest import SubmitQualityDetectionJobRequest + from jdcloud_sdk.services.vod.apis.ListCategoriesRequest import ListCategoriesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SubmitQualityDetectionJobRequest(params_dict, headers) + req = ListCategoriesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1020,29 +1872,32 @@ def submit_quality_detection_job(self): @expose( arguments=[ - (['--bulk-items'], dict(help="""(array: submitQualityDetectionJobRequestObject) NA """, dest='bulkItems', required=False)), + (['--name'], dict(help="""(string) 分类名称 """, dest='name', required=True)), + (['--parent-id'], dict(help="""(int) 父分类ID,取值为 0 或 null 时,表示该分类为一级分类; """, dest='parentId', type=int, required=False)), + (['--description'], dict(help="""(string) 分类描述信息 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量提交质检作业 ''', + help=''' 添加分类 ''', description=''' - 批量提交质检作业。 + 添加分类。 - 示例: jdc vod batch-submit-quality-detection-jobs + 示例: jdc vod create-category --name xxx ''', ) - def batch_submit_quality_detection_jobs(self): + def create_category(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.BatchSubmitQualityDetectionJobsRequest import BatchSubmitQualityDetectionJobsRequest + from jdcloud_sdk.services.vod.apis.CreateCategoryRequest import CreateCategoryRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BatchSubmitQualityDetectionJobsRequest(params_dict, headers) + req = CreateCategoryRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1052,30 +1907,31 @@ def batch_submit_quality_detection_jobs(self): @expose( arguments=[ - (['--page-number'], dict(help="""(int) 页码;默认值为 1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), + (['--flat-mode'], dict(help="""(bool) 是否返回平坦结构结果,默认为false(flatMode和treeMode不能同时为false) """, dest='flatMode', type=bool, required=False)), + (['--tree-mode'], dict(help="""(bool) 是否返回树结构结果,默认为false(flatMode和treeMode不能同时为false) """, dest='treeMode', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询质测模板列表。; ''', + help=''' 查询所有分类 ''', description=''' - 查询质测模板列表。; 。 + 查询所有分类。 - 示例: jdc vod list-quality-detection-templates + 示例: jdc vod list-all-categories ''', ) - def list_quality_detection_templates(self): + def list_all_categories(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.ListQualityDetectionTemplatesRequest import ListQualityDetectionTemplatesRequest + from jdcloud_sdk.services.vod.apis.ListAllCategoriesRequest import ListAllCategoriesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListQualityDetectionTemplatesRequest(params_dict, headers) + req = ListAllCategoriesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1084,32 +1940,31 @@ def list_quality_detection_templates(self): print(e) @expose( - arguments=[ - (['--name'], dict(help="""(string) 模板名称。长度不超过128个字符。UTF-8编码。; """, dest='name', required=True)), - (['--template-type'], dict(help="""(string) 模板类型,区分该模板的检测内容。目前只支持 video 。 """, dest='templateType', required=True)), - (['--detections'], dict(help="""(array: string) 检测项列表。取值范围:; blackScreen - 黑场; pureColor - 纯色; colorCast - 偏色; frozenFrame - 静帧; brightness - 亮度; contrast - 对比度; """, dest='detections', required=False)), + arguments=[ + (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建质检模板 ''', + help=''' 查询分类及其子分类,若指定的分类ID为0,则返回一个根分类及其子分类(即一级分类). ''', description=''' - 创建质检模板。 + 查询分类及其子分类,若指定的分类ID为0,则返回一个根分类及其子分类(即一级分类).。 - 示例: jdc vod create-quality-detection-template --name xxx --template-type xxx + 示例: jdc vod get-category-with-children --category-id 5 ''', ) - def create_quality_detection_template(self): + def get_category_with_children(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.CreateQualityDetectionTemplateRequest import CreateQualityDetectionTemplateRequest + from jdcloud_sdk.services.vod.apis.GetCategoryWithChildrenRequest import GetCategoryWithChildrenRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateQualityDetectionTemplateRequest(params_dict, headers) + req = GetCategoryWithChildrenRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1119,29 +1974,30 @@ def create_quality_detection_template(self): @expose( arguments=[ - (['--template-id'], dict(help="""(int) 模板ID """, dest='templateId', type=int, required=True)), + (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询质检模板 ''', + help=''' 查询分类 ''', description=''' - 查询质检模板。 + 查询分类。 - 示例: jdc vod get-quality-detection-template --template-id 5 + 示例: jdc vod get-category --category-id 5 ''', ) - def get_quality_detection_template(self): + def get_category(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.GetQualityDetectionTemplateRequest import GetQualityDetectionTemplateRequest + from jdcloud_sdk.services.vod.apis.GetCategoryRequest import GetCategoryRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetQualityDetectionTemplateRequest(params_dict, headers) + req = GetCategoryRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1151,31 +2007,33 @@ def get_quality_detection_template(self): @expose( arguments=[ - (['--template-id'], dict(help="""(int) 模板ID """, dest='templateId', type=int, required=True)), - (['--name'], dict(help="""(string) 模板名称。长度不超过128个字符。UTF-8编码。; """, dest='name', required=False)), - (['--detections'], dict(help="""(array: string) 检测项列表。取值范围:; blackScreen - 黑场; pureColor - 纯色; colorCast - 偏色; frozenFrame - 静帧; brightness - 亮度; contrast - 对比度; """, dest='detections', required=False)), + (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=True)), + (['--name'], dict(help="""(string) 分类名称 """, dest='name', required=False)), + (['--parent-id'], dict(help="""(int) 父分类ID,取值为 0 或 null 时,表示该分类为一级分类; """, dest='parentId', type=int, required=False)), + (['--description'], dict(help="""(string) 分类描述信息 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改质检模板 ''', + help=''' 修改分类 ''', description=''' - 修改质检模板。 + 修改分类。 - 示例: jdc vod update-quality-detection-template --template-id 5 + 示例: jdc vod update-category --category-id 5 ''', ) - def update_quality_detection_template(self): + def update_category(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.UpdateQualityDetectionTemplateRequest import UpdateQualityDetectionTemplateRequest + from jdcloud_sdk.services.vod.apis.UpdateCategoryRequest import UpdateCategoryRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateQualityDetectionTemplateRequest(params_dict, headers) + req = UpdateCategoryRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1185,29 +2043,30 @@ def update_quality_detection_template(self): @expose( arguments=[ - (['--template-id'], dict(help="""(int) 模板ID """, dest='templateId', type=int, required=True)), + (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除质检模板 ''', + help=''' 删除分类 ''', description=''' - 删除质检模板。 + 删除分类。 - 示例: jdc vod delete-quality-detection-template --template-id 5 + 示例: jdc vod delete-category --category-id 5 ''', ) - def delete_quality_detection_template(self): + def delete_category(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.DeleteQualityDetectionTemplateRequest import DeleteQualityDetectionTemplateRequest + from jdcloud_sdk.services.vod.apis.DeleteCategoryRequest import DeleteCategoryRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteQualityDetectionTemplateRequest(params_dict, headers) + req = DeleteCategoryRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1217,31 +2076,31 @@ def delete_quality_detection_template(self): @expose( arguments=[ - (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=False)), - (['--template-ids'], dict(help="""(array: int) 转码模板ID列表 """, dest='templateIds', type=int, required=False)), - (['--watermark-ids'], dict(help="""(array: int) 水印ID列表 """, dest='watermarkIds', type=int, required=False)), + (['--video-ids'], dict(help="""(array: string) 视频ID列表 """, dest='videoIds', required=False)), + (['--template-ids'], dict(help="""(array: string) 转码模板ID列表 """, dest='templateIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 提交转码作业 ''', + help=''' 提交截图作业; ''', description=''' - 提交转码作业。 + 提交截图作业; 。 - 示例: jdc vod submit-transcode-job + 示例: jdc vod submit-snapshot-task ''', ) - def submit_transcode_job(self): + def submit_snapshot_task(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.SubmitTranscodeJobRequest import SubmitTranscodeJobRequest + from jdcloud_sdk.services.vod.apis.SubmitSnapshotTaskRequest import SubmitSnapshotTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SubmitTranscodeJobRequest(params_dict, headers) + req = SubmitSnapshotTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1251,29 +2110,32 @@ def submit_transcode_job(self): @expose( arguments=[ - (['--bulk-items'], dict(help="""(array: submitTranscodeJobRequestObject) NA """, dest='bulkItems', required=False)), + (['--page-number'], dict(help="""(int) 页码;默认值为 1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量提交转码作业 ''', + help=''' 查询视频截图任务列表; 支持过滤查询:; - createTime,ge 最早任务创建时间; - createTime,le 最晚任务创建时间; - status,in 任务状态IN查询; - taskId,eq 任务ID精确查询; ''', description=''' - 批量提交转码作业。 + 查询视频截图任务列表; 支持过滤查询:; - createTime,ge 最早任务创建时间; - createTime,le 最晚任务创建时间; - status,in 任务状态IN查询; - taskId,eq 任务ID精确查询; 。 - 示例: jdc vod batch-submit-transcode-jobs + 示例: jdc vod list-snapshot-tasks ''', ) - def batch_submit_transcode_jobs(self): + def list_snapshot_tasks(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.BatchSubmitTranscodeJobsRequest import BatchSubmitTranscodeJobsRequest + from jdcloud_sdk.services.vod.apis.ListSnapshotTasksRequest import ListSnapshotTasksRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BatchSubmitTranscodeJobsRequest(params_dict, headers) + req = ListSnapshotTasksRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1287,6 +2149,7 @@ def batch_submit_transcode_jobs(self): (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1321,9 +2184,11 @@ def list_transcode_templates(self): (['--video'], dict(help="""(video) 视频参数配置 """, dest='video', required=True)), (['--audio'], dict(help="""(audio) 音频参数配置 """, dest='audio', required=True)), (['--encapsulation'], dict(help="""(encapsulation) 封装配置 """, dest='encapsulation', required=True)), + (['--out-file'], dict(help="""(outFile) 输出文件配置 """, dest='outFile', required=False)), (['--definition'], dict(help="""(string) 清晰度规格标记。取值范围:; SD - 标清; HD - 高清; FHD - 超清; 2K; 4K; """, dest='definition', required=True)), (['--template-type'], dict(help="""(string) 模板类型。取值范围:; jdchd - 京享超清; jdchs - 极速转码; """, dest='templateType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1356,6 +2221,7 @@ def create_transcode_template(self): arguments=[ (['--template-id'], dict(help="""(int) 模板ID """, dest='templateId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1391,9 +2257,11 @@ def get_transcode_template(self): (['--video'], dict(help="""(video) 视频参数配置 """, dest='video', required=False)), (['--audio'], dict(help="""(audio) 音频参数配置 """, dest='audio', required=False)), (['--encapsulation'], dict(help="""(encapsulation) 封装配置 """, dest='encapsulation', required=False)), + (['--out-file'], dict(help="""(outFile) 输出文件配置 """, dest='outFile', required=False)), (['--definition'], dict(help="""(string) 清晰度规格标记。取值范围:; SD - 标清; HD - 高清; FHD - 超清; 2K; 4K; """, dest='definition', required=False)), (['--template-type'], dict(help="""(string) 模板类型。取值范围:; jdchd - 京享超清; jdchs - 极速转码; """, dest='templateType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1426,6 +2294,7 @@ def update_transcode_template(self): arguments=[ (['--template-id'], dict(help="""(int) 模板ID """, dest='templateId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1459,29 +2328,29 @@ def delete_transcode_template(self): (['--page-number'], dict(help="""(int) 页码;默认值为 1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), - (['--sorts'], dict(help="""(array: sort) NA """, dest='sorts', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询视频列表信息。; 允许通过条件过滤查询,支持的过滤字段如下:; - status[eq] 按视频状态精确查询; - categoryId[eq] 按分类ID精确查询; - videoId[eq] 按视频ID精确查询; - name[eq] 按视频名称精确查询; ''', + help=''' 查询截图模板列表。; 允许通过条件过滤查询,支持的过滤字段如下:; - snapshotType[eq] 按模板类型精确查询; - templateId[eq] 按模板ID精确查询; ''', description=''' - 查询视频列表信息。; 允许通过条件过滤查询,支持的过滤字段如下:; - status[eq] 按视频状态精确查询; - categoryId[eq] 按分类ID精确查询; - videoId[eq] 按视频ID精确查询; - name[eq] 按视频名称精确查询; 。 + 查询截图模板列表。; 允许通过条件过滤查询,支持的过滤字段如下:; - snapshotType[eq] 按模板类型精确查询; - templateId[eq] 按模板ID精确查询; 。 - 示例: jdc vod list-videos + 示例: jdc vod list-snapshot-templates ''', ) - def list_videos(self): + def list_snapshot_templates(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.ListVideosRequest import ListVideosRequest + from jdcloud_sdk.services.vod.apis.ListSnapshotTemplatesRequest import ListSnapshotTemplatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListVideosRequest(params_dict, headers) + req = ListSnapshotTemplatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1491,29 +2360,33 @@ def list_videos(self): @expose( arguments=[ - (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), + (['--template-name'], dict(help="""(string) 模板标题。长度不超过 128 个字节。UTF-8 编码。 """, dest='templateName', required=True)), + (['--snapshot-type'], dict(help="""(string) 模板类型。取值范围:; sample - 采样截图模板; sprite - 雪碧图模板; """, dest='snapshotType', required=False)), + (['--image-sample-config'], dict(help="""(imageSampleConfig) 采样截图模板配置 """, dest='imageSampleConfig', required=False)), + (['--image-sprite-config'], dict(help="""(imageSpriteConfig) 雪碧图模板配置 """, dest='imageSpriteConfig', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询单个视频信息 ''', + help=''' 创建截图模板 ''', description=''' - 查询单个视频信息。 + 创建截图模板。 - 示例: jdc vod get-video --video-id xxx + 示例: jdc vod create-snapshot-template --template-name xxx ''', ) - def get_video(self): + def create_snapshot_template(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.GetVideoRequest import GetVideoRequest + from jdcloud_sdk.services.vod.apis.CreateSnapshotTemplateRequest import CreateSnapshotTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVideoRequest(params_dict, headers) + req = CreateSnapshotTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1523,34 +2396,30 @@ def get_video(self): @expose( arguments=[ - (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), - (['--name'], dict(help="""(string) 视频名称 """, dest='name', required=False)), - (['--category-id'], dict(help="""(int) 分类ID """, dest='categoryId', type=int, required=False)), - (['--tags'], dict(help="""(array: string) 标签 """, dest='tags', required=False)), - (['--cover-url'], dict(help="""(string) 封面地址 """, dest='coverUrl', required=False)), - (['--description'], dict(help="""(string) 视频描述信息 """, dest='description', required=False)), + (['--template-id'], dict(help="""(string) 模板ID """, dest='templateId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改视频信息 ''', + help=''' 查询截图模板 ''', description=''' - 修改视频信息。 + 查询截图模板。 - 示例: jdc vod update-video --video-id xxx + 示例: jdc vod get-snapshot-template --template-id xxx ''', ) - def update_video(self): + def get_snapshot_template(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.UpdateVideoRequest import UpdateVideoRequest + from jdcloud_sdk.services.vod.apis.GetSnapshotTemplateRequest import GetSnapshotTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateVideoRequest(params_dict, headers) + req = GetSnapshotTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1560,29 +2429,34 @@ def update_video(self): @expose( arguments=[ - (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), + (['--template-id'], dict(help="""(string) 模板ID """, dest='templateId', required=True)), + (['--template-name'], dict(help="""(string) 模板标题。长度不超过 128 个字节。UTF-8 编码。 """, dest='templateName', required=False)), + (['--snapshot-type'], dict(help="""(string) 模板类型。取值范围:; sample - 采样截图模板; sprite - 雪碧图模板; """, dest='snapshotType', required=False)), + (['--image-sample-config'], dict(help="""(imageSampleConfig) 采样截图模板配置 """, dest='imageSampleConfig', required=False)), + (['--image-sprite-config'], dict(help="""(imageSpriteConfig) 雪碧图模板配置 """, dest='imageSpriteConfig', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除视频,调用该接口会同时删除与指定视频相关的所有信息,包括转码任务信息、转码流数据等,同时清除云存储中相关文件资源。 ''', + help=''' 修改截图模板 ''', description=''' - 删除视频,调用该接口会同时删除与指定视频相关的所有信息,包括转码任务信息、转码流数据等,同时清除云存储中相关文件资源。。 + 修改截图模板。 - 示例: jdc vod delete-video --video-id xxx + 示例: jdc vod update-snapshot-template --template-id xxx ''', ) - def delete_video(self): + def update_snapshot_template(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.DeleteVideoRequest import DeleteVideoRequest + from jdcloud_sdk.services.vod.apis.UpdateSnapshotTemplateRequest import UpdateSnapshotTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVideoRequest(params_dict, headers) + req = UpdateSnapshotTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1592,29 +2466,30 @@ def delete_video(self): @expose( arguments=[ - (['--video-ids'], dict(help="""(array: string) 视频ID集合 """, dest='videoIds', required=False)), + (['--template-id'], dict(help="""(string) 模板ID """, dest='templateId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量删除视频,调用该接口会同时删除与指定视频相关的所有信息,包括转码任务信息、转码流数据等,同时清除云存储中相关文件资源。 ''', + help=''' 删除截图模板 ''', description=''' - 批量删除视频,调用该接口会同时删除与指定视频相关的所有信息,包括转码任务信息、转码流数据等,同时清除云存储中相关文件资源。。 + 删除截图模板。 - 示例: jdc vod batch-delete-videos + 示例: jdc vod delete-snapshot-template --template-id xxx ''', ) - def batch_delete_videos(self): + def delete_snapshot_template(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.BatchDeleteVideosRequest import BatchDeleteVideosRequest + from jdcloud_sdk.services.vod.apis.DeleteSnapshotTemplateRequest import DeleteSnapshotTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BatchDeleteVideosRequest(params_dict, headers) + req = DeleteSnapshotTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1624,29 +2499,33 @@ def batch_delete_videos(self): @expose( arguments=[ - (['--bulk-items'], dict(help="""(array: batchUpdateVideosBulkItem) 批量更新视频的条目集合 """, dest='bulkItems', required=True)), + (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=False)), + (['--template-group-id'], dict(help="""(string) 转码模板组ID。若此字段不为空,则以模板组方式提交作业,templateIds字段将被忽略。 """, dest='templateGroupId', required=False)), + (['--template-ids'], dict(help="""(array: int) 转码模板ID列表 """, dest='templateIds', type=int, required=False)), + (['--watermark-ids'], dict(help="""(array: int) 水印ID列表 """, dest='watermarkIds', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量修改视频信息 ''', + help=''' 提交转码作业 ''', description=''' - 批量修改视频信息。 + 提交转码作业。 - 示例: jdc vod batch-update-videos --bulk-items ['{"":""}'] + 示例: jdc vod submit-transcode-job ''', ) - def batch_update_videos(self): + def submit_transcode_job(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.BatchUpdateVideosRequest import BatchUpdateVideosRequest + from jdcloud_sdk.services.vod.apis.SubmitTranscodeJobRequest import SubmitTranscodeJobRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BatchUpdateVideosRequest(params_dict, headers) + req = SubmitTranscodeJobRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1656,29 +2535,30 @@ def batch_update_videos(self): @expose( arguments=[ - (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), + (['--bulk-items'], dict(help="""(array: submitTranscodeJobRequestObject) NA """, dest='bulkItems', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取视频播放信息 ''', + help=''' 批量提交转码作业 ''', description=''' - 获取视频播放信息。 + 批量提交转码作业。 - 示例: jdc vod get-video-play-info --video-id xxx + 示例: jdc vod batch-submit-transcode-jobs ''', ) - def get_video_play_info(self): + def batch_submit_transcode_jobs(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.GetVideoPlayInfoRequest import GetVideoPlayInfoRequest + from jdcloud_sdk.services.vod.apis.BatchSubmitTranscodeJobsRequest import BatchSubmitTranscodeJobsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVideoPlayInfoRequest(params_dict, headers) + req = BatchSubmitTranscodeJobsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1688,30 +2568,30 @@ def get_video_play_info(self): @expose( arguments=[ - (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), - (['--task-ids'], dict(help="""(array: int) NA """, dest='taskIds', type=int, required=True)), + (['--video-ids'], dict(help="""(array: string) NA """, dest='videoIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除视频转码流 ''', + help=''' 查询视频转码摘要 ''', description=''' - 删除视频转码流。 + 查询视频转码摘要。 - 示例: jdc vod delete-video-streams --video-id xxx --task-ids [0] + 示例: jdc vod get-transcode-summaries ''', ) - def delete_video_streams(self): + def get_transcode_summaries(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.DeleteVideoStreamsRequest import DeleteVideoStreamsRequest + from jdcloud_sdk.services.vod.apis.GetTranscodeSummariesRequest import GetTranscodeSummariesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVideoStreamsRequest(params_dict, headers) + req = GetTranscodeSummariesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1721,30 +2601,63 @@ def delete_video_streams(self): @expose( arguments=[ - (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=True)), - (['--audit-result'], dict(help="""(string) 审核结果,取值范围:; block(封禁); unblock(解封); """, dest='auditResult', required=True)), + (['--job-ids'], dict(help="""(array: int) NA """, dest='jobIds', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 视频审核; 视频在上传中或者转码中不允许更改视频审核状态,即视频只有在正常或屏蔽状态下才可以调用此接口设置审核状态; ''', + help=''' 查询转码作业摘要 ''', description=''' - 视频审核; 视频在上传中或者转码中不允许更改视频审核状态,即视频只有在正常或屏蔽状态下才可以调用此接口设置审核状态; 。 + 查询转码作业摘要。 - 示例: jdc vod video-audit --video-id xxx --audit-result xxx + 示例: jdc vod get-transcode-job-summaries ''', ) - def video_audit(self): + def get_transcode_job_summaries(self): client_factory = ClientFactory('vod') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vod.apis.VideoAuditRequest import VideoAuditRequest + from jdcloud_sdk.services.vod.apis.GetTranscodeJobSummariesRequest import GetTranscodeJobSummariesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = VideoAuditRequest(params_dict, headers) + req = GetTranscodeJobSummariesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--task-ids'], dict(help="""(array: int) NA """, dest='taskIds', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询转码任务摘要 ''', + description=''' + 查询转码任务摘要。 + + 示例: jdc vod get-transcode-task-summaries + ''', + ) + def get_transcode_task_summaries(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.GetTranscodeTaskSummariesRequest import GetTranscodeTaskSummariesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = GetTranscodeTaskSummariesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1757,6 +2670,7 @@ def video_audit(self): (['--page-number'], dict(help="""(int) 页码;默认值为 1 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1792,11 +2706,14 @@ def list_watermarks(self): (['--width'], dict(help="""(string) 水印宽度。; 当 sizeUnit = pixel 时,取值范围为 [8, 4096] 整数; 当 sizeUnit = percent 时,取值范围为 [0, 100] 小数; """, dest='width', required=True)), (['--height'], dict(help="""(string) 水印高度。; 当 sizeUnit = pixel 时,取值范围为 [8, 4096] 整数; 当 sizeUnit = percent 时,取值范围为 [0, 100] 小数; """, dest='height', required=True)), (['--size-unit'], dict(help="""(string) 尺寸单位。取值范围:; pixel - 像素; percent - 百分比; 默认值为 pixel; """, dest='sizeUnit', required=False)), + (['--width-ref'], dict(help="""(string) NA """, dest='widthRef', required=False)), + (['--height-ref'], dict(help="""(string) 高度参考,仅当 siteUnit = percent 时生效。; 取值说明:; w: 输出水印高度 = height * 水印原图高度; v: 等同于 vh; vw: 输出水印高度 = height * 输出视频宽度; vh: 输出水印高度 = height * 输出视频高度; vls: 输出水印高度 = height * 输出视频长边; vss: 输出水印高度 = height * 输出视频短边; """, dest='heightRef', required=False)), (['--position'], dict(help="""(string) 水印位置。取值范围:; LT - 左上; RT - 右上; LB - 左下; RB - 右下; """, dest='position', required=True)), (['--offset-x'], dict(help="""(string) 水平偏移。; 当 offsetUnit = pixel 时,取值范围为 [8, 4088] 整数; 当 offsetUnit = percent 时,取值范围为 [0, 100] 小数; """, dest='offsetX', required=True)), (['--offset-y'], dict(help="""(string) 竖直偏移。; 当 offsetUnit = pixel 时,取值范围为 [8, 4088] 整数; 当 offsetUnit = percent 时,取值范围为 [0, 100] 小数; """, dest='offsetY', required=True)), (['--offset-unit'], dict(help="""(string) 偏移单位。取值范围:; pixel - 像素; percent - 百分比; 默认值为 pixel; """, dest='offsetUnit', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1829,6 +2746,7 @@ def create_watermark(self): arguments=[ (['--watermark-id'], dict(help="""(int) 水印ID """, dest='watermarkId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1865,11 +2783,14 @@ def get_watermark(self): (['--width'], dict(help="""(string) 水印宽度。; 当 sizeUnit = pixel 时,取值范围为 [8, 4096] 整数; 当 sizeUnit = percent 时,取值范围为 [0, 100] 小数; """, dest='width', required=False)), (['--height'], dict(help="""(string) 水印高度。; 当 sizeUnit = pixel 时,取值范围为 [8, 4096] 整数; 当 sizeUnit = percent 时,取值范围为 [0, 100] 小数; """, dest='height', required=False)), (['--size-unit'], dict(help="""(string) 尺寸单位。取值范围:; pixel - 像素; percent - 百分比; 默认值为 pixel; """, dest='sizeUnit', required=False)), + (['--width-ref'], dict(help="""(string) NA """, dest='widthRef', required=False)), + (['--height-ref'], dict(help="""(string) 高度参考,仅当 siteUnit = percent 时生效。; 取值说明:; w: 输出水印高度 = height * 水印原图高度; v: 等同于 vh; vw: 输出水印高度 = height * 输出视频宽度; vh: 输出水印高度 = height * 输出视频高度; vls: 输出水印高度 = height * 输出视频长边; vss: 输出水印高度 = height * 输出视频短边; """, dest='heightRef', required=False)), (['--position'], dict(help="""(string) 水印位置。取值范围:; LT - 左上; RT - 右上; LB - 左下; RB - 右下; """, dest='position', required=False)), (['--offset-x'], dict(help="""(string) 水平偏移。; 当 offsetUnit = pixel 时,取值范围为 [8, 4088] 整数; 当 offsetUnit = percent 时,取值范围为 [0, 100] 小数; """, dest='offsetX', required=False)), (['--offset-y'], dict(help="""(string) 竖直偏移。; 当 offsetUnit = pixel 时,取值范围为 [8, 4088] 整数; 当 offsetUnit = percent 时,取值范围为 [0, 100] 小数; """, dest='offsetY', required=False)), (['--offset-unit'], dict(help="""(string) 偏移单位。取值范围:; pixel - 像素; percent - 百分比; 默认值为 pixel; """, dest='offsetUnit', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1902,6 +2823,7 @@ def update_watermark(self): arguments=[ (['--watermark-id'], dict(help="""(int) 水印ID """, dest='watermarkId', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -1932,7 +2854,75 @@ def delete_watermark(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['list-categories','create-category','get-category-with-children','get-category','update-category','delete-category','list-domains','create-domain','get-domain','delete-domain','enable-domain','disable-domain','set-default-domain','set-header','list-headers','delete-header','set-referer-rule','get-referer-rule','set-urlrule','get-urlrule','set-iprule','get-iprule','set-http-ssl','get-http-ssl','create-live-to-vod-task','create-video-upload-task','refresh-video-upload-task','create-image-upload-task','submit-quality-detection-job','batch-submit-quality-detection-jobs','list-quality-detection-templates','create-quality-detection-template','get-quality-detection-template','update-quality-detection-template','delete-quality-detection-template','submit-transcode-job','batch-submit-transcode-jobs','list-transcode-templates','create-transcode-template','get-transcode-template','update-transcode-template','delete-transcode-template','list-videos','get-video','update-video','delete-video','batch-delete-videos','batch-update-videos','get-video-play-info','delete-video-streams','video-audit','list-watermarks','create-watermark','get-watermark','update-watermark','delete-watermark',], required=True)), + (['--video-id'], dict(help="""(string) 视频ID """, dest='videoId', required=False)), + (['--template-ids'], dict(help="""(array: int) 转码模板ID列表 """, dest='templateIds', type=int, required=False)), + (['--watermark-ids'], dict(help="""(array: int) 水印ID列表 """, dest='watermarkIds', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 提交转码作业 ''', + description=''' + 提交转码作业。 + + 示例: jdc vod submit-transcode-job + ''', + ) + def submit_transcode_job(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.SubmitTranscodeJobRequest import SubmitTranscodeJobRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = SubmitTranscodeJobRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--bulk-items'], dict(help="""(array: submitTranscodeJobRequestObject) NA """, dest='bulkItems', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 批量提交转码作业 ''', + description=''' + 批量提交转码作业。 + + 示例: jdc vod batch-submit-transcode-jobs + ''', + ) + def batch_submit_transcode_jobs(self): + client_factory = ClientFactory('vod') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vod.apis.BatchSubmitTranscodeJobsRequest import BatchSubmitTranscodeJobsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = BatchSubmitTranscodeJobsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--api'], dict(help="""(string) api name """, choices=['list-transcode-template-groups','create-transcode-template-group','get-transcode-template-group','update-transcode-template-group','delete-transcode-template-group','delete-grouped-transcode-templates','list-quality-detection-templates','create-quality-detection-template','get-quality-detection-template','update-quality-detection-template','delete-quality-detection-template','create-video-upload-task','refresh-video-upload-task','create-image-upload-task','create-live-to-vod-task','list-videos','get-video','update-video','delete-video','batch-delete-videos','batch-update-videos','get-video-play-info','delete-video-streams','video-audit','get-video-source-info','submit-quality-detection-job','batch-submit-quality-detection-jobs','create-vedit-job','submit-vedit-job','list-vedit-projects','create-vedit-project','get-vedit-project','update-vedit-project','delete-vedit-project','list-domains','create-domain','get-domain','delete-domain','enable-domain','disable-domain','set-default-domain','set-header','list-headers','delete-header','set-referer-rule','get-referer-rule','set-urlrule','get-urlrule','set-iprule','get-iprule','set-http-ssl','get-http-ssl','list-categories','create-category','list-all-categories','get-category-with-children','get-category','update-category','delete-category','submit-snapshot-task','list-snapshot-tasks','list-transcode-templates','create-transcode-template','get-transcode-template','update-transcode-template','delete-transcode-template','list-snapshot-templates','create-snapshot-template','get-snapshot-template','update-snapshot-template','delete-snapshot-template','submit-transcode-job','batch-submit-transcode-jobs','get-transcode-summaries','get-transcode-job-summaries','get-transcode-task-summaries','list-watermarks','create-watermark','get-watermark','update-watermark','delete-watermark','submit-transcode-job','batch-submit-transcode-jobs',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/vpc.py b/jdcloud_cli/controllers/services/vpc.py index e0ae1c7..7c9c5e1 100644 --- a/jdcloud_cli/controllers/services/vpc.py +++ b/jdcloud_cli/controllers/services/vpc.py @@ -41,30 +41,30 @@ class Meta: (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) elasticIpIds - elasticip id数组条件,支持多个; elasticIpAddress - eip的IP地址,支持单个; chargeStatus - eip的费用支付状态,normal(正常状态) or overdue(预付费已到期) or arrear(欠费状态),支持单个; ipType - eip类型,取值:all(所有类型)、standard(标准弹性IP)、edge(边缘弹性IP),默认standard,支持单个; azs - eip可用区,支持多个; """, dest='filters', required=False)), - (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), + (['--filters'], dict(help="""(array: filter) vpcPeeringIds - vpcPeering ID,支持多个; vpcPeeringNames - vpcPeering名称列表,支持多个; vpcId - vpcPeering本端Vpc Id,支持单个; remoteVpcId - vpcPeering对端Vpc Id,支持单个; azType - vpcPeering本端VPC az类型,取值:all(全部类型),standard(标准VPC),edge(边缘VPC),默认standard ,支持单个; azs - vpcPeering本端VPC可用区,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询弹性公网IP列表 ''', + help=''' 查询VpcPeering资源列表 ''', description=''' - 查询弹性公网IP列表。 + 查询VpcPeering资源列表。 - 示例: jdc vpc describe-elastic-ips + 示例: jdc vpc describe-vpc-peerings ''', ) - def describe_elastic_ips(self): + def describe_vpc_peerings(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeElasticIpsRequest import DescribeElasticIpsRequest + from jdcloud_sdk.services.vpc.apis.DescribeVpcPeeringsRequest import DescribeVpcPeeringsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeElasticIpsRequest(params_dict, headers) + req = DescribeVpcPeeringsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -75,33 +75,33 @@ def describe_elastic_ips(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--max-count'], dict(help="""(int) 购买弹性ip数量;取值范围:[1,100] """, dest='maxCount', type=int, required=True)), - (['--elastic-ip-address'], dict(help="""(string) 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空 """, dest='elasticIpAddress', required=False)), - (['--elastic-ip-spec'], dict(help="""(elasticIpSpec) 弹性ip规格 """, dest='elasticIpSpec', required=True)), - (['--user-tags'], dict(help="""(array: tag) 用户标签 """, dest='userTags', required=False)), - (['--ip-type'], dict(help="""(string) 弹性ip类型,取值:standard(标准公网IP),edge(边缘公网IP),默认为standard """, dest='ipType', required=False)), + (['--vpc-peering-name'], dict(help="""(string) VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 """, dest='vpcPeeringName', required=True)), + (['--vpc-id'], dict(help="""(string) VpcPeering本端Vpc的Id """, dest='vpcId', required=True)), + (['--remote-vpc-id'], dict(help="""(string) VpcPeering对端Vpc的Id """, dest='remoteVpcId', required=True)), + (['--description'], dict(help="""(string) VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建一个或者多个弹性公网IP ''', + help=''' 创建VpcPeering接口 ''', description=''' - 创建一个或者多个弹性公网IP。 + 创建VpcPeering接口。 - 示例: jdc vpc create-elastic-ips --max-count 0 --elastic-ip-spec '{"":""}' + 示例: jdc vpc create-vpc-peering --vpc-peering-name xxx --vpc-id xxx --remote-vpc-id xxx ''', ) - def create_elastic_ips(self): + def create_vpc_peering(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.CreateElasticIpsRequest import CreateElasticIpsRequest + from jdcloud_sdk.services.vpc.apis.CreateVpcPeeringRequest import CreateVpcPeeringRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateElasticIpsRequest(params_dict, headers) + req = CreateVpcPeeringRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -112,29 +112,30 @@ def create_elastic_ips(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--elastic-ip-id'], dict(help="""(string) ElasticIp ID """, dest='elasticIpId', required=True)), + (['--vpc-peering-id'], dict(help="""(string) vpcPeeringId ID """, dest='vpcPeeringId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' ElasticIp资源信息详情 ''', + help=''' 查询VpcPeering资源详情 ''', description=''' - ElasticIp资源信息详情。 + 查询VpcPeering资源详情。 - 示例: jdc vpc describe-elastic-ip --elastic-ip-id xxx + 示例: jdc vpc describe-vpc-peering --vpc-peering-id xxx ''', ) - def describe_elastic_ip(self): + def describe_vpc_peering(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeElasticIpRequest import DescribeElasticIpRequest + from jdcloud_sdk.services.vpc.apis.DescribeVpcPeeringRequest import DescribeVpcPeeringRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeElasticIpRequest(params_dict, headers) + req = DescribeVpcPeeringRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -145,30 +146,32 @@ def describe_elastic_ip(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--elastic-ip-id'], dict(help="""(string) ElasticIp ID """, dest='elasticIpId', required=True)), - (['--bandwidth-mbps'], dict(help="""(int) 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] """, dest='bandwidthMbps', type=int, required=True)), + (['--vpc-peering-id'], dict(help="""(string) vpcPeeringId ID """, dest='vpcPeeringId', required=True)), + (['--vpc-peering-name'], dict(help="""(string) VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 """, dest='vpcPeeringName', required=False)), + (['--description'], dict(help="""(string) VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改弹性公网IP ''', + help=''' 修改VpcPeering接口 ''', description=''' - 修改弹性公网IP。 + 修改VpcPeering接口。 - 示例: jdc vpc modify-elastic-ip --elastic-ip-id xxx --bandwidth-mbps 0 + 示例: jdc vpc modify-vpc-peering --vpc-peering-id xxx ''', ) - def modify_elastic_ip(self): + def modify_vpc_peering(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.ModifyElasticIpRequest import ModifyElasticIpRequest + from jdcloud_sdk.services.vpc.apis.ModifyVpcPeeringRequest import ModifyVpcPeeringRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyElasticIpRequest(params_dict, headers) + req = ModifyVpcPeeringRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -179,29 +182,30 @@ def modify_elastic_ip(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--elastic-ip-id'], dict(help="""(string) ElasticIp ID """, dest='elasticIpId', required=True)), + (['--vpc-peering-id'], dict(help="""(string) vpcPeeringId ID """, dest='vpcPeeringId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除弹性公网IP ''', + help=''' 删除VpcPeering接口 ''', description=''' - 删除弹性公网IP。 + 删除VpcPeering接口。 - 示例: jdc vpc delete-elastic-ip --elastic-ip-id xxx + 示例: jdc vpc delete-vpc-peering --vpc-peering-id xxx ''', ) - def delete_elastic_ip(self): + def delete_vpc_peering(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DeleteElasticIpRequest import DeleteElasticIpRequest + from jdcloud_sdk.services.vpc.apis.DeleteVpcPeeringRequest import DeleteVpcPeeringRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteElasticIpRequest(params_dict, headers) + req = DeleteVpcPeeringRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -214,29 +218,30 @@ def delete_elastic_ip(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) routeTableIds - 路由表ID列表,支持多个; routeTableNames - 路由表名称列表,支持多个; vpcId - 路由表所属vpc Id,支持单个; azType - 路由表az类型,取值:all(全部类型),standard(标准路由表),edge(边缘路由表),默认standard ,支持单个; azs - 可用区,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询Acl列表 ''', + help=''' 查询路由表列表 ''', description=''' - 查询Acl列表。 + 查询路由表列表。 - 示例: jdc vpc describe-network-acls + 示例: jdc vpc describe-route-tables ''', ) - def describe_network_acls(self): + def describe_route_tables(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeNetworkAclsRequest import DescribeNetworkAclsRequest + from jdcloud_sdk.services.vpc.apis.DescribeRouteTablesRequest import DescribeRouteTablesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeNetworkAclsRequest(params_dict, headers) + req = DescribeRouteTablesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -247,31 +252,32 @@ def describe_network_acls(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--vpc-id'], dict(help="""(string) 私有网络id """, dest='vpcId', required=True)), - (['--network-acl-name'], dict(help="""(string) networkAcl名称 """, dest='networkAclName', required=True)), - (['--description'], dict(help="""(string) 描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--vpc-id'], dict(help="""(string) 路由表所属的私有网络ID """, dest='vpcId', required=True)), + (['--route-table-name'], dict(help="""(string) 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='routeTableName', required=True)), + (['--description'], dict(help="""(string) 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建networkAcl接口 ''', + help=''' 创建路由表 ''', description=''' - 创建networkAcl接口。 + 创建路由表。 - 示例: jdc vpc create-network-acl --vpc-id xxx --network-acl-name xxx + 示例: jdc vpc create-route-table --vpc-id xxx --route-table-name xxx ''', ) - def create_network_acl(self): + def create_route_table(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.CreateNetworkAclRequest import CreateNetworkAclRequest + from jdcloud_sdk.services.vpc.apis.CreateRouteTableRequest import CreateRouteTableRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateNetworkAclRequest(params_dict, headers) + req = CreateRouteTableRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -282,29 +288,30 @@ def create_network_acl(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), + (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询networkAcl资源详情 ''', + help=''' 查询路由表信息详情 ''', description=''' - 查询networkAcl资源详情。 + 查询路由表信息详情。 - 示例: jdc vpc describe-network-acl --network-acl-id xxx + 示例: jdc vpc describe-route-table --route-table-id xxx ''', ) - def describe_network_acl(self): + def describe_route_table(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeNetworkAclRequest import DescribeNetworkAclRequest + from jdcloud_sdk.services.vpc.apis.DescribeRouteTableRequest import DescribeRouteTableRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeNetworkAclRequest(params_dict, headers) + req = DescribeRouteTableRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -315,31 +322,32 @@ def describe_network_acl(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), - (['--network-acl-name'], dict(help="""(string) networkAcl名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='networkAclName', required=False)), - (['--description'], dict(help="""(string) 描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), + (['--route-table-name'], dict(help="""(string) 路由表的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 """, dest='routeTableName', required=False)), + (['--description'], dict(help="""(string) 路由表的描述,取值范围:0-256个UTF-8编码下的全部字符 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改networkAcl接口 ''', + help=''' 修改路由表属性 ''', description=''' - 修改networkAcl接口。 + 修改路由表属性。 - 示例: jdc vpc modify-network-acl --network-acl-id xxx + 示例: jdc vpc modify-route-table --route-table-id xxx ''', ) - def modify_network_acl(self): + def modify_route_table(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.ModifyNetworkAclRequest import ModifyNetworkAclRequest + from jdcloud_sdk.services.vpc.apis.ModifyRouteTableRequest import ModifyRouteTableRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyNetworkAclRequest(params_dict, headers) + req = ModifyRouteTableRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -350,29 +358,30 @@ def modify_network_acl(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), + (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除networkAcl接口 ''', + help=''' 删除路由表 ''', description=''' - 删除networkAcl接口。 + 删除路由表。 - 示例: jdc vpc delete-network-acl --network-acl-id xxx + 示例: jdc vpc delete-route-table --route-table-id xxx ''', ) - def delete_network_acl(self): + def delete_route_table(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DeleteNetworkAclRequest import DeleteNetworkAclRequest + from jdcloud_sdk.services.vpc.apis.DeleteRouteTableRequest import DeleteRouteTableRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteNetworkAclRequest(params_dict, headers) + req = DeleteRouteTableRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -383,30 +392,31 @@ def delete_network_acl(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), - (['--subnet-ids'], dict(help="""(array: string) networkAcl要绑定的子网ID列表, subnet已被其他networkAcl绑定时,自动解绑 """, dest='subnetIds', required=False)), + (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), + (['--route-table-rule-specs'], dict(help="""(array: addRouteTableRules) 路由表规则信息 """, dest='routeTableRuleSpecs', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 给子网绑定networkAcl接口 ''', + help=''' 添加路由表规则 ''', description=''' - 给子网绑定networkAcl接口。 + 添加路由表规则。 - 示例: jdc vpc associate-network-acl --network-acl-id xxx + 示例: jdc vpc add-route-table-rules --route-table-id xxx --route-table-rule-specs ['{"":""}'] ''', ) - def associate_network_acl(self): + def add_route_table_rules(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.AssociateNetworkAclRequest import AssociateNetworkAclRequest + from jdcloud_sdk.services.vpc.apis.AddRouteTableRulesRequest import AddRouteTableRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AssociateNetworkAclRequest(params_dict, headers) + req = AddRouteTableRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -417,30 +427,31 @@ def associate_network_acl(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), - (['--subnet-id'], dict(help="""(string) networkAcl要解绑的子网ID """, dest='subnetId', required=True)), + (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), + (['--rule-ids'], dict(help="""(array: string) 路由表规则Id列表 """, dest='ruleIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 给子网解绑NetworkAcl接口 ''', + help=''' 移除路由表规则 ''', description=''' - 给子网解绑NetworkAcl接口。 + 移除路由表规则。 - 示例: jdc vpc disassociate-network-acl --network-acl-id xxx --subnet-id xxx + 示例: jdc vpc remove-route-table-rules --route-table-id xxx ''', ) - def disassociate_network_acl(self): + def remove_route_table_rules(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DisassociateNetworkAclRequest import DisassociateNetworkAclRequest + from jdcloud_sdk.services.vpc.apis.RemoveRouteTableRulesRequest import RemoveRouteTableRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisassociateNetworkAclRequest(params_dict, headers) + req = RemoveRouteTableRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -451,30 +462,31 @@ def disassociate_network_acl(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), - (['--network-acl-rule-specs'], dict(help="""(array: addNetworkAclRuleSpec) networkAcl规则列表 """, dest='networkAclRuleSpecs', required=True)), + (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), + (['--modify-route-table-rule-specs'], dict(help="""(array: modifyRouteTableRules) 路由表规则信息 """, dest='modifyRouteTableRuleSpecs', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加networkAcl规则接口 ''', + help=''' 修改路由表规则 ''', description=''' - 添加networkAcl规则接口。 + 修改路由表规则。 - 示例: jdc vpc add-network-acl-rules --network-acl-id xxx --network-acl-rule-specs ['{"":""}'] + 示例: jdc vpc modify-route-table-rules --route-table-id xxx --modify-route-table-rule-specs ['{"":""}'] ''', ) - def add_network_acl_rules(self): + def modify_route_table_rules(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.AddNetworkAclRulesRequest import AddNetworkAclRulesRequest + from jdcloud_sdk.services.vpc.apis.ModifyRouteTableRulesRequest import ModifyRouteTableRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddNetworkAclRulesRequest(params_dict, headers) + req = ModifyRouteTableRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -485,30 +497,31 @@ def add_network_acl_rules(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), - (['--rule-ids'], dict(help="""(array: string) networkAcl规则ID列表 """, dest='ruleIds', required=False)), + (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), + (['--subnet-ids'], dict(help="""(array: string) 路由表要绑定的子网ID列表, subnet已被其他路由表绑定时,自动解绑。路由表绑定的子网属性要相同,或者都是标准子网,或者都是相同边缘可用区的边缘子网。 """, dest='subnetIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 移除networkAcl规则 ''', + help=''' 路由表绑定子网接口 ''', description=''' - 移除networkAcl规则。 + 路由表绑定子网接口。 - 示例: jdc vpc remove-network-acl-rules --network-acl-id xxx + 示例: jdc vpc associate-route-table --route-table-id xxx ''', ) - def remove_network_acl_rules(self): + def associate_route_table(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.RemoveNetworkAclRulesRequest import RemoveNetworkAclRulesRequest + from jdcloud_sdk.services.vpc.apis.AssociateRouteTableRequest import AssociateRouteTableRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RemoveNetworkAclRulesRequest(params_dict, headers) + req = AssociateRouteTableRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -519,30 +532,31 @@ def remove_network_acl_rules(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), - (['--modify-network-acl-rule-specs'], dict(help="""(array: modifyNetworkAclRuleSpec) networkAcl规则列表 """, dest='modifyNetworkAclRuleSpecs', required=True)), + (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), + (['--subnet-id'], dict(help="""(string) 路由表要解绑的子网ID,解绑后子网绑定默认路由表 """, dest='subnetId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改networkAcl接口 ''', + help=''' 给路由表解绑子网接口 ''', description=''' - 修改networkAcl接口。 + 给路由表解绑子网接口。 - 示例: jdc vpc modify-network-acl-rules --network-acl-id xxx --modify-network-acl-rule-specs ['{"":""}'] + 示例: jdc vpc disassociate-route-table --route-table-id xxx --subnet-id xxx ''', ) - def modify_network_acl_rules(self): + def disassociate_route_table(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.ModifyNetworkAclRulesRequest import ModifyNetworkAclRulesRequest + from jdcloud_sdk.services.vpc.apis.DisassociateRouteTableRequest import DisassociateRouteTableRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyNetworkAclRulesRequest(params_dict, headers) + req = DisassociateRouteTableRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -555,29 +569,30 @@ def modify_network_acl_rules(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) networkInterfaceIds - 弹性网卡ID列表,支持多个; networkInterfaceNames - 弹性网卡名称列表,支持多个; vpcId - 弹性网卡所属vpc Id,支持单个; subnetId - 弹性网卡所属子网Id,支持单个; role - 网卡角色,取值范围:Primary(主网卡)、Secondary(辅助网卡)、Managed (受管网卡),支持单个; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) subnetIds - subnet ID列表,支持多个; subnetNames - subnet名称列表,支持多个; routeTableId - 子网关联路由表Id,支持单个; aclId - 子网关联acl Id,支持单个; vpcId - 子网所属VPC Id,支持单个; subnetType - 子网类型,取值:all(全部类型),standard(标准子网),edge(边缘子网),默认standard ,支持单个; azs - 可用区,支持多个; azType - VPC az类型,取值:all(全部类型),standard(标准可用区子网),edge(边缘可用区子网),默认standard ,支持单个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询弹性网卡列表 ''', + help=''' 查询子网列表 ''', description=''' - 查询弹性网卡列表。 + 查询子网列表。 - 示例: jdc vpc describe-network-interfaces + 示例: jdc vpc describe-subnets ''', ) - def describe_network_interfaces(self): + def describe_subnets(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeNetworkInterfacesRequest import DescribeNetworkInterfacesRequest + from jdcloud_sdk.services.vpc.apis.DescribeSubnetsRequest import DescribeSubnetsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeNetworkInterfacesRequest(params_dict, headers) + req = DescribeSubnetsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -588,37 +603,35 @@ def describe_network_interfaces(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=True)), - (['--az'], dict(help="""(string) 可用区,用户的默认可用区,该参数无效,不建议使用 """, dest='az', required=False)), - (['--network-interface-name'], dict(help="""(string) 网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='networkInterfaceName', required=False)), - (['--primary-ip-address'], dict(help="""(string) 网卡主IP,如果不指定,会自动从子网中分配 """, dest='primaryIpAddress', required=False)), - (['--secondary-ip-addresses'], dict(help="""(array: string) SecondaryIp列表 """, dest='secondaryIpAddresses', required=False)), - (['--secondary-ip-count'], dict(help="""(int) 自动分配的SecondaryIp数量 """, dest='secondaryIpCount', type=int, required=False)), - (['--security-groups'], dict(help="""(array: string) 要绑定的安全组ID列表,最多指定5个安全组 """, dest='securityGroups', required=False)), - (['--sanity-check'], dict(help="""(int) 源和目标IP地址校验,取值为0或者1,默认为1 """, dest='sanityCheck', type=int, required=False)), - (['--description'], dict(help="""(string) 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--vpc-id'], dict(help="""(string) 子网所属vpc的Id """, dest='vpcId', required=True)), + (['--subnet-name'], dict(help="""(string) 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='subnetName', required=True)), + (['--address-prefix'], dict(help="""(string) 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网 """, dest='addressPrefix', required=True)), + (['--route-table-id'], dict(help="""(string) 子网关联的路由表Id, 默认为vpc的默认路由表,子网关联路由表需检查路由表中已绑定的子网与本子网类型是否一致(一致标准为:或者都为标准子网,或者都为相同边缘可用区的边缘子网) """, dest='routeTableId', required=False)), + (['--description'], dict(help="""(string) 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 """, dest='description', required=False)), + (['--ip-mask-len'], dict(help="""(int) 子网内预留网段掩码长度,此网段IP地址按照单个申请,子网内其余部分IP地址以网段形式分配。此参数非必选,缺省值为0,代表子网内所有IP地址都按照单个申请 """, dest='ipMaskLen', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建网卡接口,只能创建辅助网卡 ''', + help=''' 创建子网 ''', description=''' - 创建网卡接口,只能创建辅助网卡。 + 创建子网。 - 示例: jdc vpc create-network-interface --subnet-id xxx + 示例: jdc vpc create-subnet --vpc-id xxx --subnet-name xxx --address-prefix xxx ''', ) - def create_network_interface(self): + def create_subnet(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.CreateNetworkInterfaceRequest import CreateNetworkInterfaceRequest + from jdcloud_sdk.services.vpc.apis.CreateSubnetRequest import CreateSubnetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateNetworkInterfaceRequest(params_dict, headers) + req = CreateSubnetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -629,29 +642,30 @@ def create_network_interface(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), + (['--subnet-id'], dict(help="""(string) Subnet ID """, dest='subnetId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询弹性网卡信息详情 ''', + help=''' 查询子网信息详情 ''', description=''' - 查询弹性网卡信息详情。 + 查询子网信息详情。 - 示例: jdc vpc describe-network-interface --network-interface-id xxx + 示例: jdc vpc describe-subnet --subnet-id xxx ''', ) - def describe_network_interface(self): + def describe_subnet(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeNetworkInterfaceRequest import DescribeNetworkInterfaceRequest + from jdcloud_sdk.services.vpc.apis.DescribeSubnetRequest import DescribeSubnetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeNetworkInterfaceRequest(params_dict, headers) + req = DescribeSubnetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -662,32 +676,139 @@ def describe_network_interface(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), - (['--network-interface-name'], dict(help="""(string) 弹性网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='networkInterfaceName', required=False)), + (['--subnet-id'], dict(help="""(string) Subnet ID """, dest='subnetId', required=True)), + (['--subnet-name'], dict(help="""(string) 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='subnetName', required=False)), + (['--description'], dict(help="""(string) 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 """, dest='description', required=False)), + (['--ip-mask-len'], dict(help="""(int) 子网内预留网段掩码长度,此网段IP地址按照单个申请,子网内其余部分IP地址以网段形式分配。此参数非必选,缺省值为0,代表子网内所有IP地址都按照单个申请 """, dest='ipMaskLen', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改子网接口 ''', + description=''' + 修改子网接口。 + + 示例: jdc vpc modify-subnet --subnet-id xxx + ''', + ) + def modify_subnet(self): + client_factory = ClientFactory('vpc') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vpc.apis.ModifySubnetRequest import ModifySubnetRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifySubnetRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--subnet-id'], dict(help="""(string) Subnet ID """, dest='subnetId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除子网 ''', + description=''' + 删除子网。 + + 示例: jdc vpc delete-subnet --subnet-id xxx + ''', + ) + def delete_subnet(self): + client_factory = ClientFactory('vpc') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vpc.apis.DeleteSubnetRequest import DeleteSubnetRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteSubnetRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询Acl列表 ''', + description=''' + 查询Acl列表。 + + 示例: jdc vpc describe-network-acls + ''', + ) + def describe_network_acls(self): + client_factory = ClientFactory('vpc') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vpc.apis.DescribeNetworkAclsRequest import DescribeNetworkAclsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeNetworkAclsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--vpc-id'], dict(help="""(string) 私有网络id """, dest='vpcId', required=True)), + (['--network-acl-name'], dict(help="""(string) networkAcl名称 """, dest='networkAclName', required=True)), (['--description'], dict(help="""(string) 描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), - (['--security-groups'], dict(help="""(array: string) 以覆盖原有安全组的方式更新的安全组。如果更新安全组ID列表,最多5个安全组 """, dest='securityGroups', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改弹性网卡接口 ''', + help=''' 创建networkAcl接口 ''', description=''' - 修改弹性网卡接口。 + 创建networkAcl接口。 - 示例: jdc vpc modify-network-interface --network-interface-id xxx + 示例: jdc vpc create-network-acl --vpc-id xxx --network-acl-name xxx ''', ) - def modify_network_interface(self): + def create_network_acl(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.ModifyNetworkInterfaceRequest import ModifyNetworkInterfaceRequest + from jdcloud_sdk.services.vpc.apis.CreateNetworkAclRequest import CreateNetworkAclRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyNetworkInterfaceRequest(params_dict, headers) + req = CreateNetworkAclRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -698,29 +819,30 @@ def modify_network_interface(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), + (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除弹性网卡接口 ''', + help=''' 查询networkAcl资源详情 ''', description=''' - 删除弹性网卡接口。 + 查询networkAcl资源详情。 - 示例: jdc vpc delete-network-interface --network-interface-id xxx + 示例: jdc vpc describe-network-acl --network-acl-id xxx ''', ) - def delete_network_interface(self): + def describe_network_acl(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DeleteNetworkInterfaceRequest import DeleteNetworkInterfaceRequest + from jdcloud_sdk.services.vpc.apis.DescribeNetworkAclRequest import DescribeNetworkAclRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteNetworkInterfaceRequest(params_dict, headers) + req = DescribeNetworkAclRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -731,32 +853,32 @@ def delete_network_interface(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), - (['--elastic-ip-id'], dict(help="""(string) 绑定的弹性Ip Id """, dest='elasticIpId', required=False)), - (['--private-ip-address'], dict(help="""(string) 绑定弹性Ip到指定的privateIp """, dest='privateIpAddress', required=False)), - (['--elastic-ip-address'], dict(help="""(string) 绑定的弹性Ip地址 """, dest='elasticIpAddress', required=False)), + (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), + (['--network-acl-name'], dict(help="""(string) networkAcl名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='networkAclName', required=False)), + (['--description'], dict(help="""(string) 描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 给网卡绑定弹性Ip接口 ''', + help=''' 修改networkAcl接口 ''', description=''' - 给网卡绑定弹性Ip接口。 + 修改networkAcl接口。 - 示例: jdc vpc associate-elastic-ip --network-interface-id xxx + 示例: jdc vpc modify-network-acl --network-acl-id xxx ''', ) - def associate_elastic_ip(self): + def modify_network_acl(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.AssociateElasticIpRequest import AssociateElasticIpRequest + from jdcloud_sdk.services.vpc.apis.ModifyNetworkAclRequest import ModifyNetworkAclRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AssociateElasticIpRequest(params_dict, headers) + req = ModifyNetworkAclRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -767,31 +889,30 @@ def associate_elastic_ip(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), - (['--elastic-ip-id'], dict(help="""(string) 指定解绑的弹性Ip Id """, dest='elasticIpId', required=False)), - (['--elastic-ip-address'], dict(help="""(string) 指定解绑的弹性Ip地址 """, dest='elasticIpAddress', required=False)), + (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 给网卡解绑弹性Ip接口 ''', + help=''' 删除networkAcl接口 ''', description=''' - 给网卡解绑弹性Ip接口。 + 删除networkAcl接口。 - 示例: jdc vpc disassociate-elastic-ip --network-interface-id xxx + 示例: jdc vpc delete-network-acl --network-acl-id xxx ''', ) - def disassociate_elastic_ip(self): + def delete_network_acl(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DisassociateElasticIpRequest import DisassociateElasticIpRequest + from jdcloud_sdk.services.vpc.apis.DeleteNetworkAclRequest import DeleteNetworkAclRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisassociateElasticIpRequest(params_dict, headers) + req = DeleteNetworkAclRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -802,32 +923,207 @@ def disassociate_elastic_ip(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), - (['--force'], dict(help="""(bool) secondary ip被其他接口占用时,是否抢占。false:非抢占重分配,true:抢占重分配,默认抢占重分配。默认值:true """, dest='force', required=False)), - (['--secondary-ips'], dict(help="""(array: string) 指定分配的secondaryIp地址 """, dest='secondaryIps', required=False)), - (['--secondary-ip-count'], dict(help="""(int) 指定自动分配的secondaryIp个数 """, dest='secondaryIpCount', type=int, required=False)), + (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), + (['--subnet-ids'], dict(help="""(array: string) networkAcl要绑定的子网ID列表, subnet已被其他networkAcl绑定时,自动解绑 """, dest='subnetIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 给网卡分配secondaryIp接口 ''', + help=''' 给子网绑定networkAcl接口 ''', description=''' - 给网卡分配secondaryIp接口。 + 给子网绑定networkAcl接口。 - 示例: jdc vpc assign-secondary-ips --network-interface-id xxx + 示例: jdc vpc associate-network-acl --network-acl-id xxx ''', ) - def assign_secondary_ips(self): + def associate_network_acl(self): + client_factory = ClientFactory('vpc') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vpc.apis.AssociateNetworkAclRequest import AssociateNetworkAclRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = AssociateNetworkAclRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), + (['--subnet-id'], dict(help="""(string) networkAcl要解绑的子网ID """, dest='subnetId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 给子网解绑NetworkAcl接口 ''', + description=''' + 给子网解绑NetworkAcl接口。 + + 示例: jdc vpc disassociate-network-acl --network-acl-id xxx --subnet-id xxx + ''', + ) + def disassociate_network_acl(self): + client_factory = ClientFactory('vpc') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vpc.apis.DisassociateNetworkAclRequest import DisassociateNetworkAclRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DisassociateNetworkAclRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), + (['--network-acl-rule-specs'], dict(help="""(array: addNetworkAclRuleSpec) networkAcl规则列表 """, dest='networkAclRuleSpecs', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 添加networkAcl规则接口 ''', + description=''' + 添加networkAcl规则接口。 + + 示例: jdc vpc add-network-acl-rules --network-acl-id xxx --network-acl-rule-specs ['{"":""}'] + ''', + ) + def add_network_acl_rules(self): + client_factory = ClientFactory('vpc') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vpc.apis.AddNetworkAclRulesRequest import AddNetworkAclRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = AddNetworkAclRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), + (['--rule-ids'], dict(help="""(array: string) networkAcl规则ID列表 """, dest='ruleIds', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 移除networkAcl规则 ''', + description=''' + 移除networkAcl规则。 + + 示例: jdc vpc remove-network-acl-rules --network-acl-id xxx + ''', + ) + def remove_network_acl_rules(self): + client_factory = ClientFactory('vpc') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vpc.apis.RemoveNetworkAclRulesRequest import RemoveNetworkAclRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = RemoveNetworkAclRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--network-acl-id'], dict(help="""(string) networkAclId ID """, dest='networkAclId', required=True)), + (['--modify-network-acl-rule-specs'], dict(help="""(array: modifyNetworkAclRuleSpec) networkAcl规则列表 """, dest='modifyNetworkAclRuleSpecs', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 修改networkAcl接口 ''', + description=''' + 修改networkAcl接口。 + + 示例: jdc vpc modify-network-acl-rules --network-acl-id xxx --modify-network-acl-rule-specs ['{"":""}'] + ''', + ) + def modify_network_acl_rules(self): + client_factory = ClientFactory('vpc') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.vpc.apis.ModifyNetworkAclRulesRequest import ModifyNetworkAclRulesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = ModifyNetworkAclRulesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) vpcIds - vpc ID列表,支持多个; vpcNames - vpc名称列表,支持多个; azType - VPC az类型,取值:all(全部类型),standard(标准VPC),edge(边缘VPC),默认standard ,支持单个; azs - 可用区,支持多个; """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询私有网络列表 ''', + description=''' + 查询私有网络列表。 + + 示例: jdc vpc describe-vpcs + ''', + ) + def describe_vpcs(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.AssignSecondaryIpsRequest import AssignSecondaryIpsRequest + from jdcloud_sdk.services.vpc.apis.DescribeVpcsRequest import DescribeVpcsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AssignSecondaryIpsRequest(params_dict, headers) + req = DescribeVpcsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -838,30 +1134,34 @@ def assign_secondary_ips(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), - (['--secondary-ips'], dict(help="""(array: string) 指定删除的secondaryIp地址 """, dest='secondaryIps', required=False)), + (['--vpc-name'], dict(help="""(string) 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='vpcName', required=True)), + (['--address-prefix'], dict(help="""(string) 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间 """, dest='addressPrefix', required=False)), + (['--description'], dict(help="""(string) vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 """, dest='description', required=False)), + (['--az-type'], dict(help="""(string) VPC az类型,取值:standard(标准VPC),edge(边缘VPC) """, dest='azType', required=False)), + (['--az'], dict(help="""(string) VPC可用区,边缘VPC必须指定可用区 """, dest='az', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 给网卡删除secondaryIp接口 ''', + help=''' 创建私有网络 ''', description=''' - 给网卡删除secondaryIp接口。 + 创建私有网络。 - 示例: jdc vpc unassign-secondary-ips --network-interface-id xxx + 示例: jdc vpc create-vpc --vpc-name xxx ''', ) - def unassign_secondary_ips(self): + def create_vpc(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.UnassignSecondaryIpsRequest import UnassignSecondaryIpsRequest + from jdcloud_sdk.services.vpc.apis.CreateVpcRequest import CreateVpcRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UnassignSecondaryIpsRequest(params_dict, headers) + req = CreateVpcRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -872,31 +1172,30 @@ def unassign_secondary_ips(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) networkSecurityGroupIds - 安全组ID列表,支持多个; networkSecurityGroupNames - 安全组名称列表,支持多个; vpcId - 安全组所属vpc Id,支持单个; """, dest='filters', required=False)), + (['--vpc-id'], dict(help="""(string) Vpc ID """, dest='vpcId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询安全组列表 ''', + help=''' 查询虚拟网络信息详情 ''', description=''' - 查询安全组列表。 + 查询虚拟网络信息详情。 - 示例: jdc vpc describe-network-security-groups + 示例: jdc vpc describe-vpc --vpc-id xxx ''', ) - def describe_network_security_groups(self): + def describe_vpc(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeNetworkSecurityGroupsRequest import DescribeNetworkSecurityGroupsRequest + from jdcloud_sdk.services.vpc.apis.DescribeVpcRequest import DescribeVpcRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeNetworkSecurityGroupsRequest(params_dict, headers) + req = DescribeVpcRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -907,31 +1206,32 @@ def describe_network_security_groups(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--vpc-id'], dict(help="""(string) 私有网络ID """, dest='vpcId', required=True)), - (['--network-security-group-name'], dict(help="""(string) 安全组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='networkSecurityGroupName', required=True)), - (['--description'], dict(help="""(string) 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--vpc-id'], dict(help="""(string) Vpc ID """, dest='vpcId', required=True)), + (['--vpc-name'], dict(help="""(string) 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='vpcName', required=False)), + (['--description'], dict(help="""(string) vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建安全组 ''', + help=''' 修改私有网络接口 ''', description=''' - 创建安全组。 + 修改私有网络接口。 - 示例: jdc vpc create-network-security-group --vpc-id xxx --network-security-group-name xxx + 示例: jdc vpc modify-vpc --vpc-id xxx ''', ) - def create_network_security_group(self): + def modify_vpc(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.CreateNetworkSecurityGroupRequest import CreateNetworkSecurityGroupRequest + from jdcloud_sdk.services.vpc.apis.ModifyVpcRequest import ModifyVpcRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateNetworkSecurityGroupRequest(params_dict, headers) + req = ModifyVpcRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -942,29 +1242,30 @@ def create_network_security_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-security-group-id'], dict(help="""(string) NetworkSecurityGroup ID """, dest='networkSecurityGroupId', required=True)), + (['--vpc-id'], dict(help="""(string) Vpc ID """, dest='vpcId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询安全组信息详情 ''', + help=''' 删除私有网络 ''', description=''' - 查询安全组信息详情。 + 删除私有网络。 - 示例: jdc vpc describe-network-security-group --network-security-group-id xxx + 示例: jdc vpc delete-vpc --vpc-id xxx ''', ) - def describe_network_security_group(self): + def delete_vpc(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeNetworkSecurityGroupRequest import DescribeNetworkSecurityGroupRequest + from jdcloud_sdk.services.vpc.apis.DeleteVpcRequest import DeleteVpcRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeNetworkSecurityGroupRequest(params_dict, headers) + req = DeleteVpcRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -975,31 +1276,32 @@ def describe_network_security_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-security-group-id'], dict(help="""(string) NetworkSecurityGroup ID """, dest='networkSecurityGroupId', required=True)), - (['--network-security-group-name'], dict(help="""(string) 安全组的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 """, dest='networkSecurityGroupName', required=False)), - (['--description'], dict(help="""(string) 安全组的描述,取值范围:0-256个UTF-8编码下的全部字符 """, dest='description', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) networkInterfaceIds - 弹性网卡ID列表,支持多个; networkInterfaceNames - 弹性网卡名称列表,支持多个; vpcId - 弹性网卡所属vpc Id,支持单个; subnetId - 弹性网卡所属子网Id,支持单个; role - 网卡角色,取值范围:Primary(主网卡)、Secondary(辅助网卡)、Managed (受管网卡),支持单个; azType - 网卡 az类型,取值:all(全部类型),standard(标准Az网卡),edge(边缘Az网卡),默认为all,支持单个; azs - 可用区 az名,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改安全组属性 ''', + help=''' 查询弹性网卡列表 ''', description=''' - 修改安全组属性。 + 查询弹性网卡列表。 - 示例: jdc vpc modify-network-security-group --network-security-group-id xxx + 示例: jdc vpc describe-network-interfaces ''', ) - def modify_network_security_group(self): + def describe_network_interfaces(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.ModifyNetworkSecurityGroupRequest import ModifyNetworkSecurityGroupRequest + from jdcloud_sdk.services.vpc.apis.DescribeNetworkInterfacesRequest import DescribeNetworkInterfacesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyNetworkSecurityGroupRequest(params_dict, headers) + req = DescribeNetworkInterfacesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1010,29 +1312,38 @@ def modify_network_security_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-security-group-id'], dict(help="""(string) NetworkSecurityGroup ID """, dest='networkSecurityGroupId', required=True)), + (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=True)), + (['--az'], dict(help="""(string) 可用区,用户的默认可用区,该参数无效,不建议使用 """, dest='az', required=False)), + (['--network-interface-name'], dict(help="""(string) 网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='networkInterfaceName', required=False)), + (['--primary-ip-address'], dict(help="""(string) 网卡主IP,如果不指定,会自动从子网中分配 """, dest='primaryIpAddress', required=False)), + (['--secondary-ip-addresses'], dict(help="""(array: string) SecondaryIp列表 """, dest='secondaryIpAddresses', required=False)), + (['--secondary-ip-count'], dict(help="""(int) 自动分配的SecondaryIp数量 """, dest='secondaryIpCount', type=int, required=False)), + (['--security-groups'], dict(help="""(array: string) 要绑定的安全组ID列表,最多指定5个安全组 """, dest='securityGroups', required=False)), + (['--sanity-check'], dict(help="""(int) 源和目标IP地址校验,取值为0或者1,默认为1 """, dest='sanityCheck', type=int, required=False)), + (['--description'], dict(help="""(string) 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除安全组 ''', + help=''' 创建网卡接口,只能创建辅助网卡 ''', description=''' - 删除安全组。 + 创建网卡接口,只能创建辅助网卡。 - 示例: jdc vpc delete-network-security-group --network-security-group-id xxx + 示例: jdc vpc create-network-interface --subnet-id xxx ''', ) - def delete_network_security_group(self): + def create_network_interface(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DeleteNetworkSecurityGroupRequest import DeleteNetworkSecurityGroupRequest + from jdcloud_sdk.services.vpc.apis.CreateNetworkInterfaceRequest import CreateNetworkInterfaceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteNetworkSecurityGroupRequest(params_dict, headers) + req = CreateNetworkInterfaceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1043,30 +1354,30 @@ def delete_network_security_group(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-security-group-id'], dict(help="""(string) NetworkSecurityGroup ID """, dest='networkSecurityGroupId', required=True)), - (['--network-security-group-rule-specs'], dict(help="""(array: addSecurityGroupRules) 安全组规则信息 """, dest='networkSecurityGroupRuleSpecs', required=True)), + (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加安全组规则 ''', + help=''' 查询弹性网卡信息详情 ''', description=''' - 添加安全组规则。 + 查询弹性网卡信息详情。 - 示例: jdc vpc add-network-security-group-rules --network-security-group-id xxx --network-security-group-rule-specs ['{"":""}'] + 示例: jdc vpc describe-network-interface --network-interface-id xxx ''', ) - def add_network_security_group_rules(self): + def describe_network_interface(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.AddNetworkSecurityGroupRulesRequest import AddNetworkSecurityGroupRulesRequest + from jdcloud_sdk.services.vpc.apis.DescribeNetworkInterfaceRequest import DescribeNetworkInterfaceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddNetworkSecurityGroupRulesRequest(params_dict, headers) + req = DescribeNetworkInterfaceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1077,30 +1388,33 @@ def add_network_security_group_rules(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-security-group-id'], dict(help="""(string) NetworkSecurityGroup ID """, dest='networkSecurityGroupId', required=True)), - (['--rule-ids'], dict(help="""(array: string) 安全组规则Id列表 """, dest='ruleIds', required=False)), + (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), + (['--network-interface-name'], dict(help="""(string) 弹性网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 """, dest='networkInterfaceName', required=False)), + (['--description'], dict(help="""(string) 描述,允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--security-groups'], dict(help="""(array: string) 以覆盖原有安全组的方式更新的安全组。如果更新安全组ID列表,最多5个安全组 """, dest='securityGroups', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 移除安全组规则 ''', + help=''' 修改弹性网卡信息 ''', description=''' - 移除安全组规则。 + 修改弹性网卡信息。 - 示例: jdc vpc remove-network-security-group-rules --network-security-group-id xxx + 示例: jdc vpc modify-network-interface --network-interface-id xxx ''', ) - def remove_network_security_group_rules(self): + def modify_network_interface(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.RemoveNetworkSecurityGroupRulesRequest import RemoveNetworkSecurityGroupRulesRequest + from jdcloud_sdk.services.vpc.apis.ModifyNetworkInterfaceRequest import ModifyNetworkInterfaceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RemoveNetworkSecurityGroupRulesRequest(params_dict, headers) + req = ModifyNetworkInterfaceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1111,30 +1425,30 @@ def remove_network_security_group_rules(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--network-security-group-id'], dict(help="""(string) NetworkSecurityGroup ID """, dest='networkSecurityGroupId', required=True)), - (['--modify-security-group-rule-specs'], dict(help="""(array: modifySecurityGroupRules) 安全组规则信息 """, dest='modifySecurityGroupRuleSpecs', required=True)), + (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改安全组规则 ''', + help=''' 删除弹性网卡 ''', description=''' - 修改安全组规则。 + 删除弹性网卡。 - 示例: jdc vpc modify-network-security-group-rules --network-security-group-id xxx --modify-security-group-rule-specs ['{"":""}'] + 示例: jdc vpc delete-network-interface --network-interface-id xxx ''', ) - def modify_network_security_group_rules(self): + def delete_network_interface(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.ModifyNetworkSecurityGroupRulesRequest import ModifyNetworkSecurityGroupRulesRequest + from jdcloud_sdk.services.vpc.apis.DeleteNetworkInterfaceRequest import DeleteNetworkInterfaceRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyNetworkSecurityGroupRulesRequest(params_dict, headers) + req = DeleteNetworkInterfaceRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1145,30 +1459,33 @@ def modify_network_security_group_rules(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--type'], dict(help="""(string) 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡)、acl、aclRule、routeTable、staticRoute、propagatedRoute、securityGroupRule """, dest='type', required=True)), - (['--parent-resource-id'], dict(help="""(string) type为vpc、elastic_ip、network_interface不设置, type为subnet、security_group、vpcpeering、acl、routeTable设置为vpcId, type为aclRule设置为aclId, type为staticRoute、propagatedRoute设置为routeTableId, type为securityGroupRule为securityGroupId """, dest='parentResourceId', required=False)), + (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), + (['--elastic-ip-id'], dict(help="""(string) 绑定的弹性Ip Id """, dest='elasticIpId', required=False)), + (['--private-ip-address'], dict(help="""(string) 绑定弹性Ip到指定的privateIp """, dest='privateIpAddress', required=False)), + (['--elastic-ip-address'], dict(help="""(string) 绑定的弹性Ip地址 """, dest='elasticIpAddress', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询配额信息 ''', + help=''' 给网卡绑定弹性Ip接口 ''', description=''' - 查询配额信息。 + 给网卡绑定弹性Ip接口。 - 示例: jdc vpc describe-quota --type xxx + 示例: jdc vpc associate-elastic-ip --network-interface-id xxx ''', ) - def describe_quota(self): + def associate_elastic_ip(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeQuotaRequest import DescribeQuotaRequest + from jdcloud_sdk.services.vpc.apis.AssociateElasticIpRequest import AssociateElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeQuotaRequest(params_dict, headers) + req = AssociateElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1179,31 +1496,32 @@ def describe_quota(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) routeTableIds - 路由表ID列表,支持多个; routeTableNames - 路由表名称列表,支持多个; vpcId - 路由表所属vpc Id,支持单个; """, dest='filters', required=False)), + (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), + (['--elastic-ip-id'], dict(help="""(string) 指定解绑的弹性Ip Id """, dest='elasticIpId', required=False)), + (['--elastic-ip-address'], dict(help="""(string) 指定解绑的弹性Ip地址 """, dest='elasticIpAddress', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询路由表列表 ''', + help=''' 给网卡解绑弹性Ip接口 ''', description=''' - 查询路由表列表。 + 给网卡解绑弹性Ip接口。 - 示例: jdc vpc describe-route-tables + 示例: jdc vpc disassociate-elastic-ip --network-interface-id xxx ''', ) - def describe_route_tables(self): + def disassociate_elastic_ip(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeRouteTablesRequest import DescribeRouteTablesRequest + from jdcloud_sdk.services.vpc.apis.DisassociateElasticIpRequest import DisassociateElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeRouteTablesRequest(params_dict, headers) + req = DisassociateElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1214,31 +1532,35 @@ def describe_route_tables(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--vpc-id'], dict(help="""(string) 路由表所属的私有网络ID """, dest='vpcId', required=True)), - (['--route-table-name'], dict(help="""(string) 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='routeTableName', required=True)), - (['--description'], dict(help="""(string) 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), + (['--force'], dict(help="""(bool) secondary ip被其他接口占用时,是否抢占。false:非抢占重分配,true:抢占重分配;按网段分配时,默认非抢占重分配,指定IP或者个数时,默认抢占重分配。 """, dest='force', type=bool, required=False)), + (['--secondary-ips'], dict(help="""(array: string) 指定分配的secondaryIp地址 """, dest='secondaryIps', required=False)), + (['--secondary-ip-count'], dict(help="""(int) 指定自动分配的secondaryIp个数 """, dest='secondaryIpCount', type=int, required=False)), + (['--secondary-ip-mask-len'], dict(help="""(int) 指定分配的网段掩码长度, 支持24-28位掩码长度,不能与secondaryIpCount或secondaryIps同时指定,不支持抢占重分配 """, dest='secondaryIpMaskLen', type=int, required=False)), + (['--secondary-ip-address'], dict(help="""(string) 指定分配的网段中第一个secondaryIp地址,不能与secondaryIpCount或secondaryIps同时指定,secondaryIpAddress与secondaryIpMaskLen需要保持一致,否则无法创建 """, dest='secondaryIpAddress', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建路由表 ''', + help=''' 给网卡分配secondaryIp ''', description=''' - 创建路由表。 + 给网卡分配secondaryIp。 - 示例: jdc vpc create-route-table --vpc-id xxx --route-table-name xxx + 示例: jdc vpc assign-secondary-ips --network-interface-id xxx ''', ) - def create_route_table(self): + def assign_secondary_ips(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.CreateRouteTableRequest import CreateRouteTableRequest + from jdcloud_sdk.services.vpc.apis.AssignSecondaryIpsRequest import AssignSecondaryIpsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateRouteTableRequest(params_dict, headers) + req = AssignSecondaryIpsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1249,29 +1571,32 @@ def create_route_table(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), + (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), + (['--secondary-ips'], dict(help="""(array: string) 指定删除的secondaryIp地址 """, dest='secondaryIps', required=False)), + (['--secondary-cidrs'], dict(help="""(array: string) 指定删除的secondaryIp网段 """, dest='secondaryCidrs', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询路由表信息详情 ''', + help=''' 给网卡删除secondaryIp ''', description=''' - 查询路由表信息详情。 + 给网卡删除secondaryIp。 - 示例: jdc vpc describe-route-table --route-table-id xxx + 示例: jdc vpc unassign-secondary-ips --network-interface-id xxx ''', ) - def describe_route_table(self): + def unassign_secondary_ips(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeRouteTableRequest import DescribeRouteTableRequest + from jdcloud_sdk.services.vpc.apis.UnassignSecondaryIpsRequest import UnassignSecondaryIpsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeRouteTableRequest(params_dict, headers) + req = UnassignSecondaryIpsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1282,31 +1607,34 @@ def describe_route_table(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), - (['--route-table-name'], dict(help="""(string) 路由表的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 """, dest='routeTableName', required=False)), - (['--description'], dict(help="""(string) 路由表的描述,取值范围:0-256个UTF-8编码下的全部字符 """, dest='description', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围为[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) bwpIds - 共享带宽包ID,支持多个进行精确搜索; name - 共享带宽包名称,支持单个进行精确搜索; """, dest='filters', required=False)), + (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), + (['--resource-group-ids'], dict(help="""(array: string) 资源组筛选条件 """, dest='resourceGroupIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改路由表属性 ''', + help=''' ; 查询共享带宽包列表; ; ## 接口说明; ; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; ; - 如果使用子帐号查询,只会查询到该子帐号有权限的云主机实例。关于资源权限请参考 [IAM概述](https://docs.jdcloud.com/cn/iam/product-overview)。; ; - 单次查询最大可查询100条共享带宽包数据。; ; - 尽量一次调用接口查询多条数据,不建议使用该批量查询接口一次查询一条数据,如果使用不当导致查询过于密集,可能导致网关触发限流。; ; - 由于该接口为 `GET` 方式请求,最终参数会转换为 `URL` 上的参数,但是 `HTTP` 协议下的 `GET` 请求参数长度是有大小限制的,使用者需要注意参数超长的问题。; ''', description=''' - 修改路由表属性。 + ; 查询共享带宽包列表; ; ## 接口说明; ; - 使用 `filters` 过滤器进行条件筛选,每个 `filter` 之间的关系为逻辑与(AND)的关系。; ; - 如果使用子帐号查询,只会查询到该子帐号有权限的云主机实例。关于资源权限请参考 [IAM概述](https://docs.jdcloud.com/cn/iam/product-overview)。; ; - 单次查询最大可查询100条共享带宽包数据。; ; - 尽量一次调用接口查询多条数据,不建议使用该批量查询接口一次查询一条数据,如果使用不当导致查询过于密集,可能导致网关触发限流。; ; - 由于该接口为 `GET` 方式请求,最终参数会转换为 `URL` 上的参数,但是 `HTTP` 协议下的 `GET` 请求参数长度是有大小限制的,使用者需要注意参数超长的问题。; 。 - 示例: jdc vpc modify-route-table --route-table-id xxx + 示例: jdc vpc describe-bandwidth-packages ''', ) - def modify_route_table(self): + def describe_bandwidth_packages(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.ModifyRouteTableRequest import ModifyRouteTableRequest + from jdcloud_sdk.services.vpc.apis.DescribeBandwidthPackagesRequest import DescribeBandwidthPackagesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyRouteTableRequest(params_dict, headers) + req = DescribeBandwidthPackagesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1317,29 +1645,36 @@ def modify_route_table(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), + (['--name'], dict(help="""(string) 名称,只支持中文、数字、大小写字母、英文下划线“_”及中划线“-”,且长度不超过32个字符 """, dest='name', required=True)), + (['--description'], dict(help="""(string) 描述,长度不超过256个字符 """, dest='description', required=False)), + (['--bandwidth-mbps'], dict(help="""(int) 共享带宽包带宽上限,取值范围200-5000,单位为Mbps,保底带宽 = 共享带宽包带宽上限 * 20% """, dest='bandwidthMbps', type=int, required=True)), + (['--provider'], dict(help="""(string) 线路信息,默认bgp,目前只支持中心节点的BGP线路 """, dest='provider', required=False)), + (['--charge-spec'], dict(help="""(chargeSpec) 计费配置。支持包年包月、按配置、按用量计费模式 """, dest='chargeSpec', required=False)), + (['--user-tags'], dict(help="""(array: tag) 用户标签 """, dest='userTags', required=False)), + (['--resource-group-id'], dict(help="""(string) 资源所属资源组ID """, dest='resourceGroupId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除路由表 ''', + help=''' 指定地域创建共享带宽包实例。; ; ## 接口说明; ; - 需要接口完成实名认证、支付方式确认、计费类型选择等准备工作。; ; - 各地域下包年包月和按配置计费的共享带宽包不受配额限制,按用量计费的共享带宽包可创建数量受配额限制,创建前请通过 [DescribeQuotas](https://docs.jdcloud.com/cn/shared-bandwidth-package/api/describequotas?content=API) 确认配额,如须提升请[提交工单](https://ticket.jdcloud.com/applyorder/submit)或联系京东云客服。; ; - 通过本接口创建包年包月资源时将自动从账户扣款(代金券优先),如需使用第三方支付方式请通过控制台创建。; ; - 按用量计费模式需提工单申请使用权限,默认支持增强95消峰计费。; ''', description=''' - 删除路由表。 + 指定地域创建共享带宽包实例。; ; ## 接口说明; ; - 需要接口完成实名认证、支付方式确认、计费类型选择等准备工作。; ; - 各地域下包年包月和按配置计费的共享带宽包不受配额限制,按用量计费的共享带宽包可创建数量受配额限制,创建前请通过 [DescribeQuotas](https://docs.jdcloud.com/cn/shared-bandwidth-package/api/describequotas?content=API) 确认配额,如须提升请[提交工单](https://ticket.jdcloud.com/applyorder/submit)或联系京东云客服。; ; - 通过本接口创建包年包月资源时将自动从账户扣款(代金券优先),如需使用第三方支付方式请通过控制台创建。; ; - 按用量计费模式需提工单申请使用权限,默认支持增强95消峰计费。; 。 - 示例: jdc vpc delete-route-table --route-table-id xxx + 示例: jdc vpc create-bandwidth-package --name xxx --bandwidth-mbps 5 ''', ) - def delete_route_table(self): + def create_bandwidth_package(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DeleteRouteTableRequest import DeleteRouteTableRequest + from jdcloud_sdk.services.vpc.apis.CreateBandwidthPackageRequest import CreateBandwidthPackageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteRouteTableRequest(params_dict, headers) + req = CreateBandwidthPackageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1350,30 +1685,30 @@ def delete_route_table(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), - (['--route-table-rule-specs'], dict(help="""(array: addRouteTableRules) 路由表规则信息 """, dest='routeTableRuleSpecs', required=True)), + (['--bandwidth-package-id'], dict(help="""(string) 共享带宽包ID """, dest='bandwidthPackageId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 添加路由表规则 ''', + help=''' ; 共享带宽包资源信息详情; ; ## 接口说明; ; - 该接口与查询共享带宽包列表返回的信息一致。; ; - 只需要查询单个共享带宽包详细信息的时候可以调用该接口。; ''', description=''' - 添加路由表规则。 + ; 共享带宽包资源信息详情; ; ## 接口说明; ; - 该接口与查询共享带宽包列表返回的信息一致。; ; - 只需要查询单个共享带宽包详细信息的时候可以调用该接口。; 。 - 示例: jdc vpc add-route-table-rules --route-table-id xxx --route-table-rule-specs ['{"":""}'] + 示例: jdc vpc describe-bandwidth-package --bandwidth-package-id xxx ''', ) - def add_route_table_rules(self): + def describe_bandwidth_package(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.AddRouteTableRulesRequest import AddRouteTableRulesRequest + from jdcloud_sdk.services.vpc.apis.DescribeBandwidthPackageRequest import DescribeBandwidthPackageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AddRouteTableRulesRequest(params_dict, headers) + req = DescribeBandwidthPackageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1384,30 +1719,33 @@ def add_route_table_rules(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), - (['--rule-ids'], dict(help="""(array: string) 路由表规则Id列表 """, dest='ruleIds', required=False)), + (['--bandwidth-package-id'], dict(help="""(string) 共享带宽包ID """, dest='bandwidthPackageId', required=True)), + (['--bandwidth-mbps'], dict(help="""(int) 共享带宽包带宽上限,取值范围200-5000,单位为Mbps,且不能低于共享带宽包内公网IP带宽上限 """, dest='bandwidthMbps', type=int, required=False)), + (['--name'], dict(help="""(string) 名称,只支持中文、数字、大小写字母、英文下划线“_”及中划线“-”,且长度不超过32个字符 """, dest='name', required=False)), + (['--description'], dict(help="""(string) 描述,长度不超过256个字符 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 移除路由表规则 ''', + help=''' ; 修改共享带宽包信息,包括带宽上限及共享带宽包名称、描述信息。; ; ## 接口说明; ; - 如共享带宽包中的弹性公网 IP 有单独限速。共享带宽包的带宽上限值不能低于其包含任一弹性公网IP的带宽上限值。; ; - 欠费或到期的共享带宽包资源不支持修改带宽上限。; ''', description=''' - 移除路由表规则。 + ; 修改共享带宽包信息,包括带宽上限及共享带宽包名称、描述信息。; ; ## 接口说明; ; - 如共享带宽包中的弹性公网 IP 有单独限速。共享带宽包的带宽上限值不能低于其包含任一弹性公网IP的带宽上限值。; ; - 欠费或到期的共享带宽包资源不支持修改带宽上限。; 。 - 示例: jdc vpc remove-route-table-rules --route-table-id xxx + 示例: jdc vpc modify-bandwidth-package --bandwidth-package-id xxx ''', ) - def remove_route_table_rules(self): + def modify_bandwidth_package(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.RemoveRouteTableRulesRequest import RemoveRouteTableRulesRequest + from jdcloud_sdk.services.vpc.apis.ModifyBandwidthPackageRequest import ModifyBandwidthPackageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = RemoveRouteTableRulesRequest(params_dict, headers) + req = ModifyBandwidthPackageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1418,30 +1756,30 @@ def remove_route_table_rules(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), - (['--modify-route-table-rule-specs'], dict(help="""(array: modifyRouteTableRules) 路由表规则信息 """, dest='modifyRouteTableRuleSpecs', required=True)), + (['--bandwidth-package-id'], dict(help="""(string) 共享带宽包ID """, dest='bandwidthPackageId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改路由表规则 ''', + help=''' 删除共享带宽包; ; ## 接口说明; ; - 当共享带宽包内有公网IP存在时、包年包月类型的共享带宽包未到期时、按用量计费的共享带宽包使用时长未满一个完整的自然月时均不支持删除共享带宽包; ''', description=''' - 修改路由表规则。 + 删除共享带宽包; ; ## 接口说明; ; - 当共享带宽包内有公网IP存在时、包年包月类型的共享带宽包未到期时、按用量计费的共享带宽包使用时长未满一个完整的自然月时均不支持删除共享带宽包; 。 - 示例: jdc vpc modify-route-table-rules --route-table-id xxx --modify-route-table-rule-specs ['{"":""}'] + 示例: jdc vpc delete-bandwidth-package --bandwidth-package-id xxx ''', ) - def modify_route_table_rules(self): + def delete_bandwidth_package(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.ModifyRouteTableRulesRequest import ModifyRouteTableRulesRequest + from jdcloud_sdk.services.vpc.apis.DeleteBandwidthPackageRequest import DeleteBandwidthPackageRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyRouteTableRulesRequest(params_dict, headers) + req = DeleteBandwidthPackageRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1452,30 +1790,31 @@ def modify_route_table_rules(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), - (['--subnet-ids'], dict(help="""(array: string) 路由表要绑定的子网ID列表, subnet已被其他路由表绑定时,自动解绑。路由表绑定的子网属性要相同,或者都是标准子网,或者都是相同边缘可用区的边缘子网。 """, dest='subnetIds', required=False)), + (['--bandwidth-package-id'], dict(help="""(string) 共享带宽包ID """, dest='bandwidthPackageId', required=True)), + (['--bandwidth-package-ipspecs'], dict(help="""(array: addBandwidthPackageIPSpec) Ip列表 """, dest='bandwidthPackageIPSpecs', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 路由表绑定子网接口 ''', + help=''' ; 向共享带宽包内增加公网IP; ; ## 接口说明 ; ; - 确保已有至少一个共享带宽包资源。; ; - 添加弹性公网IP前,需确保弹性公网IP所在地域与共享带宽包地域和线路相同,弹性公网IP的计费模式为按配置或按用量计费,且未加入其他的共享带宽包资源。; ; - 已欠费的、包年包月的公网IP不能加入共享带宽包。; ; - 一个公网IP同时只能加入一个共享带宽包。; ; - 共享带宽包中可添加的弹性公网IP受配额限制,添加前请通过 [DescribeQuotas](https://docs.jdcloud.com/cn/shared-bandwidth-package/api/describequotas?content=API) 确认配额,如须提升请[提交工单](https://ticket.jdcloud.com/applyorder/submit)或联系京东云客服。; ; - 弹性公网IP加入共享带宽包后,弹性公网 IP 会原有的计费和带宽上限暂时失效,已共享带宽包进行计费,带宽上限默认为共享带宽包的带宽上限,可通过[modifyBandwidthPackageIpBandwidth](https://docs.jdcloud.com/cn/shared-bandwidth-package/api/modifybandwidthpackageIpbandwidth)进行修改。; ; - 共享带宽包欠费或到期停服后不支持添加弹性公网IP。; ''', description=''' - 路由表绑定子网接口。 + ; 向共享带宽包内增加公网IP; ; ## 接口说明 ; ; - 确保已有至少一个共享带宽包资源。; ; - 添加弹性公网IP前,需确保弹性公网IP所在地域与共享带宽包地域和线路相同,弹性公网IP的计费模式为按配置或按用量计费,且未加入其他的共享带宽包资源。; ; - 已欠费的、包年包月的公网IP不能加入共享带宽包。; ; - 一个公网IP同时只能加入一个共享带宽包。; ; - 共享带宽包中可添加的弹性公网IP受配额限制,添加前请通过 [DescribeQuotas](https://docs.jdcloud.com/cn/shared-bandwidth-package/api/describequotas?content=API) 确认配额,如须提升请[提交工单](https://ticket.jdcloud.com/applyorder/submit)或联系京东云客服。; ; - 弹性公网IP加入共享带宽包后,弹性公网 IP 会原有的计费和带宽上限暂时失效,已共享带宽包进行计费,带宽上限默认为共享带宽包的带宽上限,可通过[modifyBandwidthPackageIpBandwidth](https://docs.jdcloud.com/cn/shared-bandwidth-package/api/modifybandwidthpackageIpbandwidth)进行修改。; ; - 共享带宽包欠费或到期停服后不支持添加弹性公网IP。; 。 - 示例: jdc vpc associate-route-table --route-table-id xxx + 示例: jdc vpc add-bandwidth-package-ip --bandwidth-package-id xxx --bandwidth-package-ipspecs ['{"":""}'] ''', ) - def associate_route_table(self): + def add_bandwidth_package_ip(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.AssociateRouteTableRequest import AssociateRouteTableRequest + from jdcloud_sdk.services.vpc.apis.AddBandwidthPackageIPRequest import AddBandwidthPackageIPRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = AssociateRouteTableRequest(params_dict, headers) + req = AddBandwidthPackageIPRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1486,30 +1825,31 @@ def associate_route_table(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--route-table-id'], dict(help="""(string) RouteTable ID """, dest='routeTableId', required=True)), - (['--subnet-id'], dict(help="""(string) 路由表要解绑的子网ID,解绑后子网绑定默认路由表 """, dest='subnetId', required=True)), + (['--bandwidth-package-id'], dict(help="""(string) 共享带宽包ID """, dest='bandwidthPackageId', required=True)), + (['--bandwidth-package-ipspecs'], dict(help="""(array: removeBandwidthPackageIPSpec) 公网IP列表 """, dest='bandwidthPackageIPSpecs', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 给路由表解绑子网接口 ''', + help=''' ; 从共享带宽包内移除公网IP; ; ## 接口说明; ; - 弹性公网IP从共享带宽包中移除后,恢复原有的计费模式和带宽上限。; ; - 共享带宽包是否计费与共享带宽包中有无弹性公网IP无关,如共享带宽包中无弹性公网IP资源时请及时删除资源,避免产生额外费用; ''', description=''' - 给路由表解绑子网接口。 + ; 从共享带宽包内移除公网IP; ; ## 接口说明; ; - 弹性公网IP从共享带宽包中移除后,恢复原有的计费模式和带宽上限。; ; - 共享带宽包是否计费与共享带宽包中有无弹性公网IP无关,如共享带宽包中无弹性公网IP资源时请及时删除资源,避免产生额外费用; 。 - 示例: jdc vpc disassociate-route-table --route-table-id xxx --subnet-id xxx + 示例: jdc vpc remove-bandwidth-package-ip --bandwidth-package-id xxx --bandwidth-package-ipspecs ['{"":""}'] ''', ) - def disassociate_route_table(self): + def remove_bandwidth_package_ip(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DisassociateRouteTableRequest import DisassociateRouteTableRequest + from jdcloud_sdk.services.vpc.apis.RemoveBandwidthPackageIPRequest import RemoveBandwidthPackageIPRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DisassociateRouteTableRequest(params_dict, headers) + req = RemoveBandwidthPackageIPRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1520,31 +1860,31 @@ def disassociate_route_table(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) providers - 边缘公网IP的线路,命名规则:[线路接入区].[资源关联范围].[服务类型],示例如cn-n1-jinan1.ez.bgp,支持多个; pointsOfAccess - 边缘公网IP的线路接入区,提供线路接入区具体位置信息,支持多个; associationScope - 边缘公网IP的资源关联范围,取值ez(边缘可用区)和az(中心可用区,暂不支持),支持单个; serviceTypes - 边缘公网IP的服务类型,取值:bgp(动态),unicom(联通),telecom(电信),mobile(移动),支持多个; azs - 边缘公网IP的可用区,分为全可用区(暂不支持)和边缘可用区ID(同线路接入区]),示例如cn-n1-sqxx1,支持多个; """, dest='filters', required=False)), + (['--bandwidth-package-id'], dict(help="""(string) 共享带宽包ID """, dest='bandwidthPackageId', required=True)), + (['--bandwidth-package-ipspecs'], dict(help="""(array: modifyBandwidthPackageIpBandwidthSpec) Ip列表 """, dest='bandwidthPackageIPSpecs', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询边缘公网IP可用线路列表 ''', + help=''' ; 修改共享带宽包内弹性公网 IP 的带宽上限。; ; ## 接口说明; ; - 共享带宽包中弹性公网IP的带宽上限不能高于共享带宽包的带宽上限。; ''', description=''' - 查询边缘公网IP可用线路列表。 + ; 修改共享带宽包内弹性公网 IP 的带宽上限。; ; ## 接口说明; ; - 共享带宽包中弹性公网IP的带宽上限不能高于共享带宽包的带宽上限。; 。 - 示例: jdc vpc describe-edge-ip-providers + 示例: jdc vpc modify-bandwidth-package-ip-bandwidth --bandwidth-package-id xxx --bandwidth-package-ipspecs ['{"":""}'] ''', ) - def describe_edge_ip_providers(self): + def modify_bandwidth_package_ip_bandwidth(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeEdgeIpProvidersRequest import DescribeEdgeIpProvidersRequest + from jdcloud_sdk.services.vpc.apis.ModifyBandwidthPackageIpBandwidthRequest import ModifyBandwidthPackageIpBandwidthRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeEdgeIpProvidersRequest(params_dict, headers) + req = ModifyBandwidthPackageIpBandwidthRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1557,29 +1897,30 @@ def describe_edge_ip_providers(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) subnetIds - subnet ID列表,支持多个; subnetNames - subnet名称列表,支持多个; routeTableId - 子网关联路由表Id,支持单个; aclId - 子网关联acl Id,支持单个; vpcId - 子网所属VPC Id,支持单个; subnetType - 子网类型,取值:all(全部类型),standard(标准子网),edge(边缘子网),默认standard ,支持单个; azs - 可用区,支持多个; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) networkSecurityGroupIds - 安全组ID列表,支持多个; networkSecurityGroupNames - 安全组名称列表,支持多个; vpcId - 安全组所属vpc Id,支持单个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询子网列表 ''', + help=''' 查询安全组列表 ''', description=''' - 查询子网列表。 + 查询安全组列表。 - 示例: jdc vpc describe-subnets + 示例: jdc vpc describe-network-security-groups ''', ) - def describe_subnets(self): + def describe_network_security_groups(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeSubnetsRequest import DescribeSubnetsRequest + from jdcloud_sdk.services.vpc.apis.DescribeNetworkSecurityGroupsRequest import DescribeNetworkSecurityGroupsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSubnetsRequest(params_dict, headers) + req = DescribeNetworkSecurityGroupsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1590,35 +1931,32 @@ def describe_subnets(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--vpc-id'], dict(help="""(string) 子网所属vpc的Id """, dest='vpcId', required=True)), - (['--subnet-name'], dict(help="""(string) 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='subnetName', required=True)), - (['--address-prefix'], dict(help="""(string) 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网 """, dest='addressPrefix', required=True)), - (['--route-table-id'], dict(help="""(string) 子网关联的路由表Id, 默认为vpc的默认路由表,子网关联路由表需检查路由表中已绑定的子网与本子网类型是否一致(一致标准为:或者都为标准子网,或者都为相同边缘可用区的边缘子网) """, dest='routeTableId', required=False)), - (['--description'], dict(help="""(string) 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 """, dest='description', required=False)), - (['--subnet-type'], dict(help="""(string) 子网类型,取值:standard(标准子网),edge(边缘子网) """, dest='subnetType', required=False)), - (['--az'], dict(help="""(string) 子网可用区,边缘子网必须指定可用区 """, dest='az', required=False)), + (['--vpc-id'], dict(help="""(string) 私有网络ID """, dest='vpcId', required=True)), + (['--network-security-group-name'], dict(help="""(string) 安全组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='networkSecurityGroupName', required=True)), + (['--description'], dict(help="""(string) 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建子网 ''', + help=''' 创建安全组 ''', description=''' - 创建子网。 + 创建安全组。 - 示例: jdc vpc create-subnet --vpc-id xxx --subnet-name xxx --address-prefix xxx + 示例: jdc vpc create-network-security-group --vpc-id xxx --network-security-group-name xxx ''', ) - def create_subnet(self): + def create_network_security_group(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.CreateSubnetRequest import CreateSubnetRequest + from jdcloud_sdk.services.vpc.apis.CreateNetworkSecurityGroupRequest import CreateNetworkSecurityGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateSubnetRequest(params_dict, headers) + req = CreateNetworkSecurityGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1629,29 +1967,30 @@ def create_subnet(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--subnet-id'], dict(help="""(string) Subnet ID """, dest='subnetId', required=True)), + (['--network-security-group-id'], dict(help="""(string) NetworkSecurityGroup ID """, dest='networkSecurityGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询子网信息详情 ''', + help=''' 查询安全组信息详情 ''', description=''' - 查询子网信息详情。 + 查询安全组信息详情。 - 示例: jdc vpc describe-subnet --subnet-id xxx + 示例: jdc vpc describe-network-security-group --network-security-group-id xxx ''', ) - def describe_subnet(self): + def describe_network_security_group(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeSubnetRequest import DescribeSubnetRequest + from jdcloud_sdk.services.vpc.apis.DescribeNetworkSecurityGroupRequest import DescribeNetworkSecurityGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeSubnetRequest(params_dict, headers) + req = DescribeNetworkSecurityGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1662,31 +2001,32 @@ def describe_subnet(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--subnet-id'], dict(help="""(string) Subnet ID """, dest='subnetId', required=True)), - (['--subnet-name'], dict(help="""(string) 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='subnetName', required=False)), - (['--description'], dict(help="""(string) 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 """, dest='description', required=False)), + (['--network-security-group-id'], dict(help="""(string) NetworkSecurityGroup ID """, dest='networkSecurityGroupId', required=True)), + (['--network-security-group-name'], dict(help="""(string) 安全组的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 """, dest='networkSecurityGroupName', required=False)), + (['--description'], dict(help="""(string) 安全组的描述,取值范围:0-256个UTF-8编码下的全部字符 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改子网接口 ''', + help=''' 修改安全组属性 ''', description=''' - 修改子网接口。 + 修改安全组属性。 - 示例: jdc vpc modify-subnet --subnet-id xxx + 示例: jdc vpc modify-network-security-group --network-security-group-id xxx ''', ) - def modify_subnet(self): + def modify_network_security_group(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.ModifySubnetRequest import ModifySubnetRequest + from jdcloud_sdk.services.vpc.apis.ModifyNetworkSecurityGroupRequest import ModifyNetworkSecurityGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifySubnetRequest(params_dict, headers) + req = ModifyNetworkSecurityGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1697,29 +2037,30 @@ def modify_subnet(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--subnet-id'], dict(help="""(string) Subnet ID """, dest='subnetId', required=True)), + (['--network-security-group-id'], dict(help="""(string) NetworkSecurityGroup ID """, dest='networkSecurityGroupId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除子网 ''', + help=''' 删除安全组 ''', description=''' - 删除子网。 + 删除安全组。 - 示例: jdc vpc delete-subnet --subnet-id xxx + 示例: jdc vpc delete-network-security-group --network-security-group-id xxx ''', ) - def delete_subnet(self): + def delete_network_security_group(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DeleteSubnetRequest import DeleteSubnetRequest + from jdcloud_sdk.services.vpc.apis.DeleteNetworkSecurityGroupRequest import DeleteNetworkSecurityGroupRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteSubnetRequest(params_dict, headers) + req = DeleteNetworkSecurityGroupRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1730,31 +2071,31 @@ def delete_subnet(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) vpcIds - vpc ID列表,支持多个; vpcNames - vpc名称列表,支持多个; """, dest='filters', required=False)), + (['--network-security-group-id'], dict(help="""(string) NetworkSecurityGroup ID """, dest='networkSecurityGroupId', required=True)), + (['--network-security-group-rule-specs'], dict(help="""(array: addSecurityGroupRules) 安全组规则信息 """, dest='networkSecurityGroupRuleSpecs', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询私有网络列表 ''', + help=''' 添加安全组规则 ''', description=''' - 查询私有网络列表。 + 添加安全组规则。 - 示例: jdc vpc describe-vpcs + 示例: jdc vpc add-network-security-group-rules --network-security-group-id xxx --network-security-group-rule-specs ['{"":""}'] ''', ) - def describe_vpcs(self): + def add_network_security_group_rules(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeVpcsRequest import DescribeVpcsRequest + from jdcloud_sdk.services.vpc.apis.AddNetworkSecurityGroupRulesRequest import AddNetworkSecurityGroupRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeVpcsRequest(params_dict, headers) + req = AddNetworkSecurityGroupRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1765,31 +2106,31 @@ def describe_vpcs(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--vpc-name'], dict(help="""(string) 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='vpcName', required=True)), - (['--address-prefix'], dict(help="""(string) 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间 """, dest='addressPrefix', required=False)), - (['--description'], dict(help="""(string) vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 """, dest='description', required=False)), + (['--network-security-group-id'], dict(help="""(string) NetworkSecurityGroup ID """, dest='networkSecurityGroupId', required=True)), + (['--rule-ids'], dict(help="""(array: string) 安全组规则Id列表 """, dest='ruleIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建私有网络 ''', + help=''' 移除安全组规则 ''', description=''' - 创建私有网络。 + 移除安全组规则。 - 示例: jdc vpc create-vpc --vpc-name xxx + 示例: jdc vpc remove-network-security-group-rules --network-security-group-id xxx ''', ) - def create_vpc(self): + def remove_network_security_group_rules(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.CreateVpcRequest import CreateVpcRequest + from jdcloud_sdk.services.vpc.apis.RemoveNetworkSecurityGroupRulesRequest import RemoveNetworkSecurityGroupRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVpcRequest(params_dict, headers) + req = RemoveNetworkSecurityGroupRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1800,29 +2141,31 @@ def create_vpc(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--vpc-id'], dict(help="""(string) Vpc ID """, dest='vpcId', required=True)), + (['--network-security-group-id'], dict(help="""(string) NetworkSecurityGroup ID """, dest='networkSecurityGroupId', required=True)), + (['--modify-security-group-rule-specs'], dict(help="""(array: modifySecurityGroupRules) 安全组规则信息 """, dest='modifySecurityGroupRuleSpecs', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询Vpc信息详情 ''', + help=''' 修改安全组规则 ''', description=''' - 查询Vpc信息详情。 + 修改安全组规则。 - 示例: jdc vpc describe-vpc --vpc-id xxx + 示例: jdc vpc modify-network-security-group-rules --network-security-group-id xxx --modify-security-group-rule-specs ['{"":""}'] ''', ) - def describe_vpc(self): + def modify_network_security_group_rules(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeVpcRequest import DescribeVpcRequest + from jdcloud_sdk.services.vpc.apis.ModifyNetworkSecurityGroupRulesRequest import ModifyNetworkSecurityGroupRulesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeVpcRequest(params_dict, headers) + req = ModifyNetworkSecurityGroupRulesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1833,31 +2176,31 @@ def describe_vpc(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--vpc-id'], dict(help="""(string) Vpc ID """, dest='vpcId', required=True)), - (['--vpc-name'], dict(help="""(string) 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='vpcName', required=False)), - (['--description'], dict(help="""(string) vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 """, dest='description', required=False)), + (['--type'], dict(help="""(string) 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡)、acl、aclRule、routeTable、staticRoute、propagatedRoute、securityGroupRule、network_interface_cidr、bwpByUsage、bandwidthPackageIp、natGateway """, dest='type', required=True)), + (['--parent-resource-id'], dict(help="""(string) type为vpc、elastic_ip、network_interface、bwpByUsage、natGateway不设置, type为subnet、security_group、vpcpeering、acl、routeTable设置为vpcId, type为aclRule设置为aclId, type为staticRoute、propagatedRoute设置为routeTableId, type为securityGroupRule为securityGroupId, type为network_interface_cidr设置为networkInterfaceId,type为bandwidthPackageIp设置为bandwidthPackageId """, dest='parentResourceId', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改私有网络接口 ''', + help=''' 查询配额信息 ''', description=''' - 修改私有网络接口。 + 查询配额信息。 - 示例: jdc vpc modify-vpc --vpc-id xxx + 示例: jdc vpc describe-quota --type xxx ''', ) - def modify_vpc(self): + def describe_quota(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.ModifyVpcRequest import ModifyVpcRequest + from jdcloud_sdk.services.vpc.apis.DescribeQuotaRequest import DescribeQuotaRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyVpcRequest(params_dict, headers) + req = DescribeQuotaRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1868,29 +2211,34 @@ def modify_vpc(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--vpc-id'], dict(help="""(string) Vpc ID """, dest='vpcId', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) elasticIpIds - elasticip id数组条件,支持多个; elasticIpAddress - eip的IP地址,支持单个; chargeStatus - eip的费用支付状态,normal(正常状态) or overdue(预付费已到期) or arrear(欠费状态),支持单个; ipType - eip类型,取值:all(所有类型)、standard(标准弹性IP)、edge(边缘弹性IP),默认standard,支持单个; azs - eip可用区,支持多个; bandwidthPackageId - 共享带宽包ID,支持单个; status - IP是否被绑定,取值:ASSOCIATED(被绑定)、NOT_ASSOCIATED(未被绑定)、ALL(全部)。支持单个; """, dest='filters', required=False)), + (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), + (['--resource-group-ids'], dict(help="""(array: string) 资源组筛选条件 """, dest='resourceGroupIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除私有网络 ''', + help=''' 查询弹性公网IP列表 ''', description=''' - 删除私有网络。 + 查询弹性公网IP列表。 - 示例: jdc vpc delete-vpc --vpc-id xxx + 示例: jdc vpc describe-elastic-ips ''', ) - def delete_vpc(self): + def describe_elastic_ips(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DeleteVpcRequest import DeleteVpcRequest + from jdcloud_sdk.services.vpc.apis.DescribeElasticIpsRequest import DescribeElasticIpsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVpcRequest(params_dict, headers) + req = DescribeElasticIpsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1901,31 +2249,36 @@ def delete_vpc(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) vpcPeeringIds - vpcPeering ID,支持多个; vpcPeeringNames - vpcPeering名称列表,支持多个; vpcId - vpcPeering本端Vpc Id,支持单个; remoteVpcId - vpcPeering对端Vpc Id,支持单个; """, dest='filters', required=False)), + (['--max-count'], dict(help="""(int) 购买弹性ip数量;取值范围:[1,100] """, dest='maxCount', type=int, required=True)), + (['--elastic-ip-address'], dict(help="""(string) 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空 """, dest='elasticIpAddress', required=False)), + (['--elastic-ip-spec'], dict(help="""(elasticIpSpec) 弹性ip规格 """, dest='elasticIpSpec', required=True)), + (['--user-tags'], dict(help="""(array: tag) 用户标签 """, dest='userTags', required=False)), + (['--ip-type'], dict(help="""(string) 弹性ip类型,取值:standard(标准公网IP),edge(边缘公网IP),默认为standard """, dest='ipType', required=False)), + (['--resource-group-id'], dict(help="""(string) 资源所属资源组ID """, dest='resourceGroupId', required=False)), + (['--dry-run'], dict(help="""(bool) 预检标识,默认false,dryRun为true时只作检查,不做变更 """, dest='dryRun', type=bool, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询VpcPeering资源列表 ''', + help=''' 创建一个或者多个弹性公网IP ''', description=''' - 查询VpcPeering资源列表。 + 创建一个或者多个弹性公网IP。 - 示例: jdc vpc describe-vpc-peerings + 示例: jdc vpc create-elastic-ips --max-count 5 --elastic-ip-spec '{"":""}' ''', ) - def describe_vpc_peerings(self): + def create_elastic_ips(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeVpcPeeringsRequest import DescribeVpcPeeringsRequest + from jdcloud_sdk.services.vpc.apis.CreateElasticIpsRequest import CreateElasticIpsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeVpcPeeringsRequest(params_dict, headers) + req = CreateElasticIpsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1936,32 +2289,30 @@ def describe_vpc_peerings(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--vpc-peering-name'], dict(help="""(string) VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 """, dest='vpcPeeringName', required=True)), - (['--vpc-id'], dict(help="""(string) VpcPeering本端Vpc的Id """, dest='vpcId', required=True)), - (['--remote-vpc-id'], dict(help="""(string) VpcPeering对端Vpc的Id """, dest='remoteVpcId', required=True)), - (['--description'], dict(help="""(string) VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 """, dest='description', required=False)), + (['--elastic-ip-id'], dict(help="""(string) ElasticIp ID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建VpcPeering接口 ''', + help=''' ElasticIp资源信息详情 ''', description=''' - 创建VpcPeering接口。 + ElasticIp资源信息详情。 - 示例: jdc vpc create-vpc-peering --vpc-peering-name xxx --vpc-id xxx --remote-vpc-id xxx + 示例: jdc vpc describe-elastic-ip --elastic-ip-id xxx ''', ) - def create_vpc_peering(self): + def describe_elastic_ip(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.CreateVpcPeeringRequest import CreateVpcPeeringRequest + from jdcloud_sdk.services.vpc.apis.DescribeElasticIpRequest import DescribeElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVpcPeeringRequest(params_dict, headers) + req = DescribeElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -1972,29 +2323,31 @@ def create_vpc_peering(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--vpc-peering-id'], dict(help="""(string) vpcPeeringId ID """, dest='vpcPeeringId', required=True)), + (['--elastic-ip-id'], dict(help="""(string) ElasticIp ID """, dest='elasticIpId', required=True)), + (['--bandwidth-mbps'], dict(help="""(int) 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] """, dest='bandwidthMbps', type=int, required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询VpcPeering资源详情 ''', + help=''' 修改弹性公网IP,当弹性公网IP加入共享带宽包后,此公网IP限速需要调用共享带宽包的接口(修改共享带宽包内公网IP带宽上限) ''', description=''' - 查询VpcPeering资源详情。 + 修改弹性公网IP,当弹性公网IP加入共享带宽包后,此公网IP限速需要调用共享带宽包的接口(修改共享带宽包内公网IP带宽上限)。 - 示例: jdc vpc describe-vpc-peering --vpc-peering-id xxx + 示例: jdc vpc modify-elastic-ip --elastic-ip-id xxx --bandwidth-mbps 5 ''', ) - def describe_vpc_peering(self): + def modify_elastic_ip(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DescribeVpcPeeringRequest import DescribeVpcPeeringRequest + from jdcloud_sdk.services.vpc.apis.ModifyElasticIpRequest import ModifyElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeVpcPeeringRequest(params_dict, headers) + req = ModifyElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2005,31 +2358,30 @@ def describe_vpc_peering(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--vpc-peering-id'], dict(help="""(string) vpcPeeringId ID """, dest='vpcPeeringId', required=True)), - (['--vpc-peering-name'], dict(help="""(string) VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 """, dest='vpcPeeringName', required=False)), - (['--description'], dict(help="""(string) VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 """, dest='description', required=False)), + (['--elastic-ip-id'], dict(help="""(string) ElasticIp ID """, dest='elasticIpId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改VpcPeering接口 ''', + help=''' 删除弹性公网IP,已加入共享带宽包的公网IP不能删除,需要先从共享带宽包移出 ''', description=''' - 修改VpcPeering接口。 + 删除弹性公网IP,已加入共享带宽包的公网IP不能删除,需要先从共享带宽包移出。 - 示例: jdc vpc modify-vpc-peering --vpc-peering-id xxx + 示例: jdc vpc delete-elastic-ip --elastic-ip-id xxx ''', ) - def modify_vpc_peering(self): + def delete_elastic_ip(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.ModifyVpcPeeringRequest import ModifyVpcPeeringRequest + from jdcloud_sdk.services.vpc.apis.DeleteElasticIpRequest import DeleteElasticIpRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyVpcPeeringRequest(params_dict, headers) + req = DeleteElasticIpRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2040,29 +2392,32 @@ def modify_vpc_peering(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), - (['--vpc-peering-id'], dict(help="""(string) vpcPeeringId ID """, dest='vpcPeeringId', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) providers - 边缘公网IP的线路,命名规则:[线路接入区].[资源关联范围].[服务类型],示例如cn-n1-jinan1.ez.bgp,支持多个; pointsOfAccess - 边缘公网IP的线路接入区,提供线路接入区具体位置信息,支持多个; associationScope - 边缘公网IP的资源关联范围,取值ez(边缘可用区)和az(中心可用区,暂不支持),支持单个; serviceTypes - 边缘公网IP的服务类型,取值:bgp(动态),unicom(联通),telecom(电信),mobile(移动),支持多个; azs - 边缘公网IP的可用区,分为全可用区(暂不支持)和边缘可用区ID(同线路接入区]),示例如cn-n1-sqxx1,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除VpcPeering接口 ''', + help=''' 查询边缘公网IP可用线路列表 ''', description=''' - 删除VpcPeering接口。 + 查询边缘公网IP可用线路列表。 - 示例: jdc vpc delete-vpc-peering --vpc-peering-id xxx + 示例: jdc vpc describe-edge-ip-providers ''', ) - def delete_vpc_peering(self): + def describe_edge_ip_providers(self): client_factory = ClientFactory('vpc') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vpc.apis.DeleteVpcPeeringRequest import DeleteVpcPeeringRequest + from jdcloud_sdk.services.vpc.apis.DescribeEdgeIpProvidersRequest import DescribeEdgeIpProvidersRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVpcPeeringRequest(params_dict, headers) + req = DescribeEdgeIpProvidersRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -2072,7 +2427,7 @@ def delete_vpc_peering(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-elastic-ips','create-elastic-ips','describe-elastic-ip','modify-elastic-ip','delete-elastic-ip','describe-network-acls','create-network-acl','describe-network-acl','modify-network-acl','delete-network-acl','associate-network-acl','disassociate-network-acl','add-network-acl-rules','remove-network-acl-rules','modify-network-acl-rules','describe-network-interfaces','create-network-interface','describe-network-interface','modify-network-interface','delete-network-interface','associate-elastic-ip','disassociate-elastic-ip','assign-secondary-ips','unassign-secondary-ips','describe-network-security-groups','create-network-security-group','describe-network-security-group','modify-network-security-group','delete-network-security-group','add-network-security-group-rules','remove-network-security-group-rules','modify-network-security-group-rules','describe-quota','describe-route-tables','create-route-table','describe-route-table','modify-route-table','delete-route-table','add-route-table-rules','remove-route-table-rules','modify-route-table-rules','associate-route-table','disassociate-route-table','describe-edge-ip-providers','describe-subnets','create-subnet','describe-subnet','modify-subnet','delete-subnet','describe-vpcs','create-vpc','describe-vpc','modify-vpc','delete-vpc','describe-vpc-peerings','create-vpc-peering','describe-vpc-peering','modify-vpc-peering','delete-vpc-peering',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-vpc-peerings','create-vpc-peering','describe-vpc-peering','modify-vpc-peering','delete-vpc-peering','describe-route-tables','create-route-table','describe-route-table','modify-route-table','delete-route-table','add-route-table-rules','remove-route-table-rules','modify-route-table-rules','associate-route-table','disassociate-route-table','describe-subnets','create-subnet','describe-subnet','modify-subnet','delete-subnet','describe-network-acls','create-network-acl','describe-network-acl','modify-network-acl','delete-network-acl','associate-network-acl','disassociate-network-acl','add-network-acl-rules','remove-network-acl-rules','modify-network-acl-rules','describe-vpcs','create-vpc','describe-vpc','modify-vpc','delete-vpc','describe-network-interfaces','create-network-interface','describe-network-interface','modify-network-interface','delete-network-interface','associate-elastic-ip','disassociate-elastic-ip','assign-secondary-ips','unassign-secondary-ips','describe-bandwidth-packages','create-bandwidth-package','describe-bandwidth-package','modify-bandwidth-package','delete-bandwidth-package','add-bandwidth-package-ip','remove-bandwidth-package-ip','modify-bandwidth-package-ip-bandwidth','describe-network-security-groups','create-network-security-group','describe-network-security-group','modify-network-security-group','delete-network-security-group','add-network-security-group-rules','remove-network-security-group-rules','modify-network-security-group-rules','describe-quota','describe-elastic-ips','create-elastic-ips','describe-elastic-ip','modify-elastic-ip','delete-elastic-ip','describe-edge-ip-providers',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/vqd.py b/jdcloud_cli/controllers/services/vqd.py index b2aad40..d7d198d 100644 --- a/jdcloud_cli/controllers/services/vqd.py +++ b/jdcloud_cli/controllers/services/vqd.py @@ -42,6 +42,7 @@ class Meta: (['--http-url'], dict(help="""(string) HTTP方式的该字段为必选项 """, dest='httpUrl', required=False)), (['--callback-events'], dict(help="""(array: string) 回调事件列表。; - VqdSuccess 视频质检成功; - VqdFailure 视频质检失败; - VqdStart 视频质检开始; """, dest='callbackEvents', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -73,6 +74,7 @@ def set_callback(self): @expose( arguments=[ (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -103,30 +105,32 @@ def query_callback(self): @expose( arguments=[ - (['--media'], dict(help="""(vqdMediaObject) NA """, dest='media', required=True)), - (['--template-id'], dict(help="""(string) 检测模板ID """, dest='templateId', required=True)), + (['--page-number'], dict(help="""(int) 页码;默认值为 1 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 提交视频质检任务 ''', + help=''' 查询视频质检模板列表。; 支持过滤查询:; - templateId,eq 精确匹配模板ID,非必选; ''', description=''' - 提交视频质检任务。 + 查询视频质检模板列表。; 支持过滤查询:; - templateId,eq 精确匹配模板ID,非必选; 。 - 示例: jdc vqd submit-vqd-task --media '{"":""}' --template-id xxx + 示例: jdc vqd list-vqd-templates ''', ) - def submit_vqd_task(self): + def list_vqd_templates(self): client_factory = ClientFactory('vqd') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vqd.apis.SubmitVqdTaskRequest import SubmitVqdTaskRequest + from jdcloud_sdk.services.vqd.apis.ListVqdTemplatesRequest import ListVqdTemplatesRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = SubmitVqdTaskRequest(params_dict, headers) + req = ListVqdTemplatesRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -136,30 +140,32 @@ def submit_vqd_task(self): @expose( arguments=[ - (['--media-list'], dict(help="""(array: vqdMediaObject) 媒体列表 """, dest='mediaList', required=True)), - (['--template-id'], dict(help="""(string) 检测模板ID """, dest='templateId', required=True)), + (['--template-name'], dict(help="""(string) 模板名称。长度不超过128个字符。UTF-8编码。; """, dest='templateName', required=True)), + (['--threshold'], dict(help="""(float) 缺陷判定时间阈值,非必须,默认值为 3.0 """, dest='threshold', required=False)), + (['--detections'], dict(help="""(array: string) 检测项列表 """, dest='detections', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量提交视频质检任务,一次同时最多提交50个输入媒体 ''', + help=''' 创建视频质检模板 ''', description=''' - 批量提交视频质检任务,一次同时最多提交50个输入媒体。 + 创建视频质检模板。 - 示例: jdc vqd batch-submit-vqd-tasks --media-list ['{"":""}'] --template-id xxx + 示例: jdc vqd create-vqd-template --template-name xxx ''', ) - def batch_submit_vqd_tasks(self): + def create_vqd_template(self): client_factory = ClientFactory('vqd') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vqd.apis.BatchSubmitVqdTasksRequest import BatchSubmitVqdTasksRequest + from jdcloud_sdk.services.vqd.apis.CreateVqdTemplateRequest import CreateVqdTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BatchSubmitVqdTasksRequest(params_dict, headers) + req = CreateVqdTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -169,31 +175,30 @@ def batch_submit_vqd_tasks(self): @expose( arguments=[ - (['--page-number'], dict(help="""(int) 页码;默认值为 1 """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), + (['--template-id'], dict(help="""(string) 模板ID,路径参数 """, dest='templateId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询视频质检任务列表; 支持过滤查询:; - createTime,ge 最早任务创建时间; - createTime,le 最晚任务创建时间; - status,in 任务状态; ''', + help=''' 查询视频质检模板 ''', description=''' - 查询视频质检任务列表; 支持过滤查询:; - createTime,ge 最早任务创建时间; - createTime,le 最晚任务创建时间; - status,in 任务状态; 。 + 查询视频质检模板。 - 示例: jdc vqd list-vqd-tasks + 示例: jdc vqd get-vqd-template --template-id xxx ''', ) - def list_vqd_tasks(self): + def get_vqd_template(self): client_factory = ClientFactory('vqd') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vqd.apis.ListVqdTasksRequest import ListVqdTasksRequest + from jdcloud_sdk.services.vqd.apis.GetVqdTemplateRequest import GetVqdTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListVqdTasksRequest(params_dict, headers) + req = GetVqdTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -203,29 +208,33 @@ def list_vqd_tasks(self): @expose( arguments=[ - (['--task-id'], dict(help="""(string) 任务ID,路径参数 """, dest='taskId', required=True)), + (['--template-id'], dict(help="""(string) 模板ID,路径参数 """, dest='templateId', required=True)), + (['--template-name'], dict(help="""(string) 模板名称。长度不超过128个字符。UTF-8编码。; """, dest='templateName', required=False)), + (['--threshold'], dict(help="""(float) 缺陷判定时间阈值 """, dest='threshold', required=False)), + (['--detections'], dict(help="""(array: string) 检测项列表 """, dest='detections', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 获取视频质检任务详细信息 ''', + help=''' 修改视频质检模板 ''', description=''' - 获取视频质检任务详细信息。 + 修改视频质检模板。 - 示例: jdc vqd get-vqd-task --task-id xxx + 示例: jdc vqd update-vqd-template --template-id xxx ''', ) - def get_vqd_task(self): + def update_vqd_template(self): client_factory = ClientFactory('vqd') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vqd.apis.GetVqdTaskRequest import GetVqdTaskRequest + from jdcloud_sdk.services.vqd.apis.UpdateVqdTemplateRequest import UpdateVqdTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVqdTaskRequest(params_dict, headers) + req = UpdateVqdTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -235,29 +244,30 @@ def get_vqd_task(self): @expose( arguments=[ - (['--task-id'], dict(help="""(string) 任务ID,路径参数 """, dest='taskId', required=True)), + (['--template-id'], dict(help="""(string) 模板ID,路径参数 """, dest='templateId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除视频质检任务。删除任务时,会同时删除任务相关的数据,如任务执行结果等 ''', + help=''' 删除视频质检模板 ''', description=''' - 删除视频质检任务。删除任务时,会同时删除任务相关的数据,如任务执行结果等。 + 删除视频质检模板。 - 示例: jdc vqd delete-vqd-task --task-id xxx + 示例: jdc vqd delete-vqd-template --template-id xxx ''', ) - def delete_vqd_task(self): + def delete_vqd_template(self): client_factory = ClientFactory('vqd') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vqd.apis.DeleteVqdTaskRequest import DeleteVqdTaskRequest + from jdcloud_sdk.services.vqd.apis.DeleteVqdTemplateRequest import DeleteVqdTemplateRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVqdTaskRequest(params_dict, headers) + req = DeleteVqdTemplateRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -267,29 +277,31 @@ def delete_vqd_task(self): @expose( arguments=[ - (['--task-id'], dict(help="""(string) 任务ID,路径参数 """, dest='taskId', required=True)), + (['--media'], dict(help="""(vqdMediaObject) NA """, dest='media', required=True)), + (['--template-id'], dict(help="""(string) 检测模板ID """, dest='templateId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询视频质检任务结果 ''', + help=''' 提交视频质检任务 ''', description=''' - 查询视频质检任务结果。 + 提交视频质检任务。 - 示例: jdc vqd query-vqd-task-result --task-id xxx + 示例: jdc vqd submit-vqd-task --media '{"":""}' --template-id xxx ''', ) - def query_vqd_task_result(self): + def submit_vqd_task(self): client_factory = ClientFactory('vqd') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vqd.apis.QueryVqdTaskResultRequest import QueryVqdTaskResultRequest + from jdcloud_sdk.services.vqd.apis.SubmitVqdTaskRequest import SubmitVqdTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = QueryVqdTaskResultRequest(params_dict, headers) + req = SubmitVqdTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -299,29 +311,31 @@ def query_vqd_task_result(self): @expose( arguments=[ - (['--task-ids'], dict(help="""(array: string) NA """, dest='taskIds', required=False)), + (['--media-list'], dict(help="""(array: vqdMediaObject) 媒体列表 """, dest='mediaList', required=True)), + (['--template-id'], dict(help="""(string) 检测模板ID """, dest='templateId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 批量删除视频质检任务。删除任务时,会同时删除任务相关的数据,如任务执行结果等。一次最多删除50条 ''', + help=''' 批量提交视频质检任务,一次同时最多提交50个输入媒体 ''', description=''' - 批量删除视频质检任务。删除任务时,会同时删除任务相关的数据,如任务执行结果等。一次最多删除50条。 + 批量提交视频质检任务,一次同时最多提交50个输入媒体。 - 示例: jdc vqd batch-delete-vqd-tasks + 示例: jdc vqd batch-submit-vqd-tasks --media-list ['{"":""}'] --template-id xxx ''', ) - def batch_delete_vqd_tasks(self): + def batch_submit_vqd_tasks(self): client_factory = ClientFactory('vqd') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vqd.apis.BatchDeleteVqdTasksRequest import BatchDeleteVqdTasksRequest + from jdcloud_sdk.services.vqd.apis.BatchSubmitVqdTasksRequest import BatchSubmitVqdTasksRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = BatchDeleteVqdTasksRequest(params_dict, headers) + req = BatchSubmitVqdTasksRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -335,27 +349,28 @@ def batch_delete_vqd_tasks(self): (['--page-size'], dict(help="""(int) 分页大小;默认值为 10;取值范围 [10, 100] """, dest='pageSize', type=int, required=False)), (['--filters'], dict(help="""(array: filter) NA """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询视频质检模板列表。; 支持过滤查询:; - templateId,eq 精确匹配模板ID,非必选; ''', + help=''' 查询视频质检任务列表; 支持过滤查询:; - createTime,ge 最早任务创建时间; - createTime,le 最晚任务创建时间; - status,in 任务状态; ''', description=''' - 查询视频质检模板列表。; 支持过滤查询:; - templateId,eq 精确匹配模板ID,非必选; 。 + 查询视频质检任务列表; 支持过滤查询:; - createTime,ge 最早任务创建时间; - createTime,le 最晚任务创建时间; - status,in 任务状态; 。 - 示例: jdc vqd list-vqd-templates + 示例: jdc vqd list-vqd-tasks ''', ) - def list_vqd_templates(self): + def list_vqd_tasks(self): client_factory = ClientFactory('vqd') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vqd.apis.ListVqdTemplatesRequest import ListVqdTemplatesRequest + from jdcloud_sdk.services.vqd.apis.ListVqdTasksRequest import ListVqdTasksRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListVqdTemplatesRequest(params_dict, headers) + req = ListVqdTasksRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -365,31 +380,30 @@ def list_vqd_templates(self): @expose( arguments=[ - (['--template-name'], dict(help="""(string) 模板名称。长度不超过128个字符。UTF-8编码。; """, dest='templateName', required=True)), - (['--threshold'], dict(help="""(float) 缺陷判定时间阈值,非必须,默认值为 3.0 """, dest='threshold', required=False)), - (['--detections'], dict(help="""(array: string) 检测项列表 """, dest='detections', required=False)), + (['--task-id'], dict(help="""(string) 任务ID,路径参数 """, dest='taskId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建视频质检模板 ''', + help=''' 获取视频质检任务详细信息 ''', description=''' - 创建视频质检模板。 + 获取视频质检任务详细信息。 - 示例: jdc vqd create-vqd-template --template-name xxx + 示例: jdc vqd get-vqd-task --task-id xxx ''', ) - def create_vqd_template(self): + def get_vqd_task(self): client_factory = ClientFactory('vqd') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vqd.apis.CreateVqdTemplateRequest import CreateVqdTemplateRequest + from jdcloud_sdk.services.vqd.apis.GetVqdTaskRequest import GetVqdTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateVqdTemplateRequest(params_dict, headers) + req = GetVqdTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -399,29 +413,30 @@ def create_vqd_template(self): @expose( arguments=[ - (['--template-id'], dict(help="""(string) 模板ID,路径参数 """, dest='templateId', required=True)), + (['--task-id'], dict(help="""(string) 任务ID,路径参数 """, dest='taskId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询视频质检模板 ''', + help=''' 删除视频质检任务。删除任务时,会同时删除任务相关的数据,如任务执行结果等 ''', description=''' - 查询视频质检模板。 + 删除视频质检任务。删除任务时,会同时删除任务相关的数据,如任务执行结果等。 - 示例: jdc vqd get-vqd-template --template-id xxx + 示例: jdc vqd delete-vqd-task --task-id xxx ''', ) - def get_vqd_template(self): + def delete_vqd_task(self): client_factory = ClientFactory('vqd') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vqd.apis.GetVqdTemplateRequest import GetVqdTemplateRequest + from jdcloud_sdk.services.vqd.apis.DeleteVqdTaskRequest import DeleteVqdTaskRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetVqdTemplateRequest(params_dict, headers) + req = DeleteVqdTaskRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -431,32 +446,30 @@ def get_vqd_template(self): @expose( arguments=[ - (['--template-id'], dict(help="""(string) 模板ID,路径参数 """, dest='templateId', required=True)), - (['--template-name'], dict(help="""(string) 模板名称。长度不超过128个字符。UTF-8编码。; """, dest='templateName', required=False)), - (['--threshold'], dict(help="""(float) 缺陷判定时间阈值 """, dest='threshold', required=False)), - (['--detections'], dict(help="""(array: string) 检测项列表 """, dest='detections', required=False)), + (['--task-id'], dict(help="""(string) 任务ID,路径参数 """, dest='taskId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改视频质检模板 ''', + help=''' 查询视频质检任务结果 ''', description=''' - 修改视频质检模板。 + 查询视频质检任务结果。 - 示例: jdc vqd update-vqd-template --template-id xxx + 示例: jdc vqd query-vqd-task-result --task-id xxx ''', ) - def update_vqd_template(self): + def query_vqd_task_result(self): client_factory = ClientFactory('vqd') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vqd.apis.UpdateVqdTemplateRequest import UpdateVqdTemplateRequest + from jdcloud_sdk.services.vqd.apis.QueryVqdTaskResultRequest import QueryVqdTaskResultRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = UpdateVqdTemplateRequest(params_dict, headers) + req = QueryVqdTaskResultRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -466,29 +479,30 @@ def update_vqd_template(self): @expose( arguments=[ - (['--template-id'], dict(help="""(string) 模板ID,路径参数 """, dest='templateId', required=True)), + (['--task-ids'], dict(help="""(array: string) NA """, dest='taskIds', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除视频质检模板 ''', + help=''' 批量删除视频质检任务。删除任务时,会同时删除任务相关的数据,如任务执行结果等。一次最多删除50条 ''', description=''' - 删除视频质检模板。 + 批量删除视频质检任务。删除任务时,会同时删除任务相关的数据,如任务执行结果等。一次最多删除50条。 - 示例: jdc vqd delete-vqd-template --template-id xxx + 示例: jdc vqd batch-delete-vqd-tasks ''', ) - def delete_vqd_template(self): + def batch_delete_vqd_tasks(self): client_factory = ClientFactory('vqd') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.vqd.apis.DeleteVqdTemplateRequest import DeleteVqdTemplateRequest + from jdcloud_sdk.services.vqd.apis.BatchDeleteVqdTasksRequest import BatchDeleteVqdTasksRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteVqdTemplateRequest(params_dict, headers) + req = BatchDeleteVqdTasksRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -498,7 +512,7 @@ def delete_vqd_template(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['set-callback','query-callback','submit-vqd-task','batch-submit-vqd-tasks','list-vqd-tasks','get-vqd-task','delete-vqd-task','query-vqd-task-result','batch-delete-vqd-tasks','list-vqd-templates','create-vqd-template','get-vqd-template','update-vqd-template','delete-vqd-template',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['set-callback','query-callback','list-vqd-templates','create-vqd-template','get-vqd-template','update-vqd-template','delete-vqd-template','submit-vqd-task','batch-submit-vqd-tasks','list-vqd-tasks','get-vqd-task','delete-vqd-task','query-vqd-task-result','batch-delete-vqd-tasks',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/xdata.py b/jdcloud_cli/controllers/services/xdata.py index d48ace2..33f9c2d 100644 --- a/jdcloud_cli/controllers/services/xdata.py +++ b/jdcloud_cli/controllers/services/xdata.py @@ -39,29 +39,29 @@ class Meta: @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--instance-name'], dict(help="""(string) 实例名称 """, dest='instanceName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户实例的所有数据库信息 ''', + help=''' 查询用户所属的实例信息 ''', description=''' - 查询用户实例的所有数据库信息。 + 查询用户所属的实例信息。 - 示例: jdc xdata list-database-info --instance-name xxx + 示例: jdc xdata list-instance-info ''', ) - def list_database_info(self): + def list_instance_info(self): client_factory = ClientFactory('xdata') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.xdata.apis.ListDatabaseInfoRequest import ListDatabaseInfoRequest + from jdcloud_sdk.services.xdata.apis.ListInstanceInfoRequest import ListInstanceInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListDatabaseInfoRequest(params_dict, headers) + req = ListInstanceInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -72,30 +72,31 @@ def list_database_info(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--database-name'], dict(help="""(string) 数据库名 """, dest='databaseName', required=True)), (['--instance-name'], dict(help="""(string) 实例名称 """, dest='instanceName', required=True)), + (['--database-name'], dict(help="""(string) 数据库名称 """, dest='databaseName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户实例的指定数据库信息 ''', + help=''' 查询用户实例指定数据库下的所有数据表信息 ''', description=''' - 查询用户实例的指定数据库信息。 + 查询用户实例指定数据库下的所有数据表信息。 - 示例: jdc xdata get-database-info --database-name xxx --instance-name xxx + 示例: jdc xdata list-table-info --instance-name xxx --database-name xxx ''', ) - def get_database_info(self): + def list_table_info(self): client_factory = ClientFactory('xdata') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.xdata.apis.GetDatabaseInfoRequest import GetDatabaseInfoRequest + from jdcloud_sdk.services.xdata.apis.ListTableInfoRequest import ListTableInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetDatabaseInfoRequest(params_dict, headers) + req = ListTableInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -106,31 +107,31 @@ def get_database_info(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--database-name'], dict(help="""(string) 数据库名 """, dest='databaseName', required=True)), (['--instance-name'], dict(help="""(string) 实例名称 """, dest='instanceName', required=True)), - (['--description'], dict(help="""(string) 数据库描述信息 """, dest='description', required=False)), + (['--db-model-dbtable'], dict(help="""(dwTableDesc) 数据表描述信息 """, dest='dbModelDBTable', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建属于用户实例的数据库 ''', + help=''' 创建用户实例的数据表 ''', description=''' - 创建属于用户实例的数据库。 + 创建用户实例的数据表。 - 示例: jdc xdata create-database --database-name xxx --instance-name xxx + 示例: jdc xdata create-table --instance-name xxx --db-model-dbtable '{"":""}' ''', ) - def create_database(self): + def create_table(self): client_factory = ClientFactory('xdata') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.xdata.apis.CreateDatabaseRequest import CreateDatabaseRequest + from jdcloud_sdk.services.xdata.apis.CreateTableRequest import CreateTableRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateDatabaseRequest(params_dict, headers) + req = CreateTableRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -141,30 +142,32 @@ def create_database(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--database-name'], dict(help="""(string) 数据库名 """, dest='databaseName', required=True)), + (['--table-name'], dict(help="""(string) 数据表名 """, dest='tableName', required=True)), (['--instance-name'], dict(help="""(string) 实例名称 """, dest='instanceName', required=True)), + (['--database-name'], dict(help="""(string) 数据库名称 """, dest='databaseName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除用户实例的指定数据库 ''', + help=''' 查询用户实例的指定数据表信息 ''', description=''' - 删除用户实例的指定数据库。 + 查询用户实例的指定数据表信息。 - 示例: jdc xdata delete-database --database-name xxx --instance-name xxx + 示例: jdc xdata get-table-info --table-name xxx --instance-name xxx --database-name xxx ''', ) - def delete_database(self): + def get_table_info(self): client_factory = ClientFactory('xdata') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.xdata.apis.DeleteDatabaseRequest import DeleteDatabaseRequest + from jdcloud_sdk.services.xdata.apis.GetTableInfoRequest import GetTableInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteDatabaseRequest(params_dict, headers) + req = GetTableInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -175,28 +178,32 @@ def delete_database(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--table-name'], dict(help="""(string) 数据表名 """, dest='tableName', required=True)), + (['--instance-name'], dict(help="""(string) 实例名称 """, dest='instanceName', required=True)), + (['--database-name'], dict(help="""(string) 数据库名称 """, dest='databaseName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户所属的实例信息 ''', + help=''' 删除用户实例的指定数据表 ''', description=''' - 查询用户所属的实例信息。 + 删除用户实例的指定数据表。 - 示例: jdc xdata list-instance-info + 示例: jdc xdata delete-table --table-name xxx --instance-name xxx --database-name xxx ''', ) - def list_instance_info(self): + def delete_table(self): client_factory = ClientFactory('xdata') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.xdata.apis.ListInstanceInfoRequest import ListInstanceInfoRequest + from jdcloud_sdk.services.xdata.apis.DeleteTableRequest import DeleteTableRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListInstanceInfoRequest(params_dict, headers) + req = DeleteTableRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -217,6 +224,7 @@ def list_instance_info(self): (['--instance-owner-name'], dict(help="""(string) 实例拥有者名称 """, dest='instanceOwnerName', required=False)), (['--is-explain'], dict(help="""(string) 是否需要解释 """, dest='isExplain', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -254,6 +262,7 @@ def execute_ras_query(self): (['--instance-owner-name'], dict(help="""(string) 实例拥有者名称 """, dest='instanceOwnerName', required=False)), (['--script-type'], dict(help="""(string) 脚本类型名称 """, dest='scriptType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -288,6 +297,7 @@ def execute_py_spark_query(self): (['--user-name'], dict(help="""(string) 用户名称 """, dest='userName', required=True)), (['--query-id'], dict(help="""(string) 查询id名称 """, dest='queryId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -322,6 +332,7 @@ def get_ras_query_state(self): (['--user-name'], dict(help="""(string) 用户名称 """, dest='userName', required=True)), (['--query-id'], dict(help="""(string) 查询id """, dest='queryId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -356,6 +367,7 @@ def get_py_spark_execute_state(self): (['--user-name'], dict(help="""(string) 用户名称 """, dest='userName', required=True)), (['--query-id'], dict(help="""(string) 查询id """, dest='queryId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -390,6 +402,7 @@ def get_ras_query_log(self): (['--user-name'], dict(help="""(string) 用户名称 """, dest='userName', required=True)), (['--query-id'], dict(help="""(string) 查询id """, dest='queryId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -424,6 +437,7 @@ def get_ras_query_result(self): (['--user-name'], dict(help="""(string) 用户名称 """, dest='userName', required=True)), (['--query-id'], dict(help="""(string) 查询id """, dest='queryId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -458,6 +472,7 @@ def get_py_spark_execute_result(self): (['--user-name'], dict(help="""(string) 用户名称 """, dest='userName', required=True)), (['--query-id'], dict(help="""(string) 查询id """, dest='queryId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -492,6 +507,7 @@ def cancel_ras_query(self): (['--user-name'], dict(help="""(string) 用户名称 """, dest='userName', required=True)), (['--query-id'], dict(help="""(string) 查询id """, dest='queryId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -524,29 +540,29 @@ def cancel_py_spark_job(self): arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--instance-name'], dict(help="""(string) 实例名称 """, dest='instanceName', required=True)), - (['--database-name'], dict(help="""(string) 数据库名称 """, dest='databaseName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户实例指定数据库下的所有数据表信息 ''', + help=''' 查询用户实例的所有数据库信息 ''', description=''' - 查询用户实例指定数据库下的所有数据表信息。 + 查询用户实例的所有数据库信息。 - 示例: jdc xdata list-table-info --instance-name xxx --database-name xxx + 示例: jdc xdata list-database-info --instance-name xxx ''', ) - def list_table_info(self): + def list_database_info(self): client_factory = ClientFactory('xdata') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.xdata.apis.ListTableInfoRequest import ListTableInfoRequest + from jdcloud_sdk.services.xdata.apis.ListDatabaseInfoRequest import ListDatabaseInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ListTableInfoRequest(params_dict, headers) + req = ListDatabaseInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -557,30 +573,31 @@ def list_table_info(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--database-name'], dict(help="""(string) 数据库名 """, dest='databaseName', required=True)), (['--instance-name'], dict(help="""(string) 实例名称 """, dest='instanceName', required=True)), - (['--db-model-dbtable'], dict(help="""(dwTableDesc) 数据表描述信息 """, dest='dbModelDBTable', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 创建用户实例的数据表 ''', + help=''' 查询用户实例的指定数据库信息 ''', description=''' - 创建用户实例的数据表。 + 查询用户实例的指定数据库信息。 - 示例: jdc xdata create-table --instance-name xxx --db-model-dbtable '{"":""}' + 示例: jdc xdata get-database-info --database-name xxx --instance-name xxx ''', ) - def create_table(self): + def get_database_info(self): client_factory = ClientFactory('xdata') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.xdata.apis.CreateTableRequest import CreateTableRequest + from jdcloud_sdk.services.xdata.apis.GetDatabaseInfoRequest import GetDatabaseInfoRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateTableRequest(params_dict, headers) + req = GetDatabaseInfoRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -591,31 +608,32 @@ def create_table(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--table-name'], dict(help="""(string) 数据表名 """, dest='tableName', required=True)), + (['--database-name'], dict(help="""(string) 数据库名 """, dest='databaseName', required=True)), (['--instance-name'], dict(help="""(string) 实例名称 """, dest='instanceName', required=True)), - (['--database-name'], dict(help="""(string) 数据库名称 """, dest='databaseName', required=True)), + (['--description'], dict(help="""(string) 数据库描述信息 """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询用户实例的指定数据表信息 ''', + help=''' 创建属于用户实例的数据库 ''', description=''' - 查询用户实例的指定数据表信息。 + 创建属于用户实例的数据库。 - 示例: jdc xdata get-table-info --table-name xxx --instance-name xxx --database-name xxx + 示例: jdc xdata create-database --database-name xxx --instance-name xxx ''', ) - def get_table_info(self): + def create_database(self): client_factory = ClientFactory('xdata') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.xdata.apis.GetTableInfoRequest import GetTableInfoRequest + from jdcloud_sdk.services.xdata.apis.CreateDatabaseRequest import CreateDatabaseRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = GetTableInfoRequest(params_dict, headers) + req = CreateDatabaseRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -626,31 +644,31 @@ def get_table_info(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--table-name'], dict(help="""(string) 数据表名 """, dest='tableName', required=True)), + (['--database-name'], dict(help="""(string) 数据库名 """, dest='databaseName', required=True)), (['--instance-name'], dict(help="""(string) 实例名称 """, dest='instanceName', required=True)), - (['--database-name'], dict(help="""(string) 数据库名称 """, dest='databaseName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 删除用户实例的指定数据表 ''', + help=''' 删除用户实例的指定数据库 ''', description=''' - 删除用户实例的指定数据表。 + 删除用户实例的指定数据库。 - 示例: jdc xdata delete-table --table-name xxx --instance-name xxx --database-name xxx + 示例: jdc xdata delete-database --database-name xxx --instance-name xxx ''', ) - def delete_table(self): + def delete_database(self): client_factory = ClientFactory('xdata') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.xdata.apis.DeleteTableRequest import DeleteTableRequest + from jdcloud_sdk.services.xdata.apis.DeleteDatabaseRequest import DeleteDatabaseRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteTableRequest(params_dict, headers) + req = DeleteDatabaseRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -660,7 +678,7 @@ def delete_table(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['list-database-info','get-database-info','create-database','delete-database','list-instance-info','execute-ras-query','execute-py-spark-query','get-ras-query-state','get-py-spark-execute-state','get-ras-query-log','get-ras-query-result','get-py-spark-execute-result','cancel-ras-query','cancel-py-spark-job','list-table-info','create-table','get-table-info','delete-table',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['list-instance-info','list-table-info','create-table','get-table-info','delete-table','execute-ras-query','execute-py-spark-query','get-ras-query-state','get-py-spark-execute-state','get-ras-query-log','get-ras-query-result','get-py-spark-execute-result','cancel-ras-query','cancel-py-spark-job','list-database-info','get-database-info','create-database','delete-database',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/yunding.py b/jdcloud_cli/controllers/services/yunding.py index 4f73996..884026c 100644 --- a/jdcloud_cli/controllers/services/yunding.py +++ b/jdcloud_cli/controllers/services/yunding.py @@ -36,14 +36,237 @@ class Meta: stacked_on = 'base' stacked_type = 'nested' + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--app-code'], dict(help="""(string) 目前统一用jcloud """, dest='appCode', required=True)), + (['--service-code'], dict(help="""(string) 资源的类型,取值vm,ip,database,storage,disk,cdn,redis,balance,nat_gw,db_ro,vpn,ddos等,新接入的产品要求与opentapi命名的产品线名称一致 """, dest='serviceCode', required=True)), + (['--region'], dict(help="""(string) 地域信息,如 cn-north-1 等 """, dest='region', required=True)), + (['--resource-id'], dict(help="""(string) 资源的唯一表示,一般为uuid """, dest='resourceId', required=True)), + (['--data-points'], dict(help="""(array: dataPointX) 监控数据点 """, dest='dataPoints', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 监控数据上报。 ''', + description=''' + 监控数据上报。。 + + 示例: jdc yunding put-product-metric-data --app-code xxx --service-code xxx --region xxx --resource-id xxx --data-points ['{"":""}'] + ''', + ) + def put_product_metric_data(self): + client_factory = ClientFactory('yunding') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.yunding.apis.PutRequest import PutRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = PutRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), + (['--app-code'], dict(help="""(string) 目前统一用jcloud """, dest='appCode', required=True)), + (['--service-code'], dict(help="""(string) 资源的类型,取值vm,ip,database,storage,disk,cdn,redis,balance,nat_gw,db_ro,vpn,ddos等,新接入的产品要求与opentapi命名的产品线名称一致 """, dest='serviceCode', required=True)), + (['--region'], dict(help="""(string) 地域信息,如 cn-north-1 等 """, dest='region', required=True)), + (['--resource-id'], dict(help="""(string) 资源的唯一表示,一般为uuid """, dest='resourceId', required=True)), + (['--data-points'], dict(help="""(array: dataPointX) 监控数据点 """, dest='dataPoints', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 监控数据上报。 ''', + description=''' + 监控数据上报。。 + + 示例: jdc yunding put-product-metric-data --app-code xxx --service-code xxx --region xxx --resource-id xxx --data-points ['{"":""}'] + ''', + ) + def put_product_metric_data(self): + client_factory = ClientFactory('yunding') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.yunding.apis.PutProductMetricDataRequest import PutProductMetricDataRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = PutProductMetricDataRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--type'], dict(help="""(int) 子网类型,主机等资源子网:1;LB子网:2;数据库子网:3 """, dest='type', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) subnetIds - subnet ID列表,支持多个; subnetNames - subnet名称列表,支持多个; routeTableId - 子网关联路由表Id,支持单个; aclId - 子网关联acl Id,支持单个; vpcId - 子网所属VPC Id,支持单个; """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询子网列表 ''', + description=''' + 查询子网列表。 + + 示例: jdc yunding describe-subnets + ''', + ) + def describe_subnets(self): + client_factory = ClientFactory('yunding') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.yunding.apis.DescribeSubnetsRequest import DescribeSubnetsRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeSubnetsRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--vpc-id'], dict(help="""(string) 子网所属vpc的Id """, dest='vpcId', required=True)), + (['--subnet-name'], dict(help="""(string) 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='subnetName', required=True)), + (['--address-prefix'], dict(help="""(string) 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网 """, dest='addressPrefix', required=True)), + (['--route-table-id'], dict(help="""(string) 子网关联的路由表Id, 默认为vpc的默认路由表,子网关联路由表需检查路由表中已绑定的子网与本子网类型是否一致(一致标准为:或者都为标准子网,或者都为相同边缘可用区的边缘子网) """, dest='routeTableId', required=False)), + (['--description'], dict(help="""(string) 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 """, dest='description', required=False)), + (['--ip-mask-len'], dict(help="""(int) 子网内预留网段掩码长度,此网段IP地址按照单个申请,子网内其余部分IP地址以网段形式分配。此参数非必选,缺省值为0,代表子网内所有IP地址都按照单个申请 """, dest='ipMaskLen', type=int, required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建子网 ''', + description=''' + 创建子网。 + + 示例: jdc yunding create-subnet --vpc-id xxx --subnet-name xxx --address-prefix xxx + ''', + ) + def create_subnet(self): + client_factory = ClientFactory('yunding') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.yunding.apis.CreateSubnetRequest import CreateSubnetRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateSubnetRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--subnet-id'], dict(help="""(string) Subnet ID """, dest='subnetId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询子网信息详情 ''', + description=''' + 查询子网信息详情。 + + 示例: jdc yunding describe-subnet --subnet-id xxx + ''', + ) + def describe_subnet(self): + client_factory = ClientFactory('yunding') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.yunding.apis.DescribeSubnetRequest import DescribeSubnetRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeSubnetRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--subnet-id'], dict(help="""(string) Subnet ID """, dest='subnetId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除子网 ''', + description=''' + 删除子网。 + + 示例: jdc yunding delete-subnet --subnet-id xxx + ''', + ) + def delete_subnet(self): + client_factory = ClientFactory('yunding') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.yunding.apis.DeleteSubnetRequest import DeleteSubnetRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteSubnetRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), - (['--force'], dict(help="""(bool) secondary ip被其他接口占用时,是否抢占。false:非抢占重分配,true:抢占重分配,默认抢占重分配。默认值:true """, dest='force', required=False)), + (['--force'], dict(help="""(bool) secondary ip被其他接口占用时,是否抢占。false:非抢占重分配,true:抢占重分配;按网段分配时,默认非抢占重分配,指定IP或者个数时,默认抢占重分配。 """, dest='force', type=bool, required=False)), (['--secondary-ips'], dict(help="""(array: string) 指定分配的secondaryIp地址 """, dest='secondaryIps', required=False)), (['--secondary-ip-count'], dict(help="""(int) 指定自动分配的secondaryIp个数 """, dest='secondaryIpCount', type=int, required=False)), + (['--secondary-ip-mask-len'], dict(help="""(int) 指定分配的网段掩码长度, 支持24-28位掩码长度,不能与secondaryIpCount或secondaryIps同时指定,不支持抢占重分配 """, dest='secondaryIpMaskLen', type=int, required=False)), + (['--secondary-ip-address'], dict(help="""(string) 指定分配的网段中第一个secondaryIp地址,不能与secondaryIpCount或secondaryIps同时指定,secondaryIpAddress与secondaryIpMaskLen需要保持一致,否则无法创建 """, dest='secondaryIpAddress', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -77,7 +300,9 @@ def assign_secondary_ips(self): (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), (['--secondary-ips'], dict(help="""(array: string) 指定删除的secondaryIp地址 """, dest='secondaryIps', required=False)), + (['--secondary-cidrs'], dict(help="""(array: string) 指定删除的secondaryIp网段 """, dest='secondaryCidrs', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -106,6 +331,185 @@ def unassign_secondary_ips(self): except Exception as e: print(e) + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询弹性网卡信息详情 ''', + description=''' + 查询弹性网卡信息详情。 + + 示例: jdc yunding describe-network-interface --network-interface-id xxx + ''', + ) + def describe_network_interface(self): + client_factory = ClientFactory('yunding') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.yunding.apis.DescribeNetworkInterfaceRequest import DescribeNetworkInterfaceRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeNetworkInterfaceRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--network-interface-id'], dict(help="""(string) networkInterface ID """, dest='networkInterfaceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 删除弹性网卡接口 ''', + description=''' + 删除弹性网卡接口。 + + 示例: jdc yunding delete-network-interface --network-interface-id xxx + ''', + ) + def delete_network_interface(self): + client_factory = ClientFactory('yunding') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.yunding.apis.DeleteNetworkInterfaceRequest import DeleteNetworkInterfaceRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DeleteNetworkInterfaceRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--filters'], dict(help="""(array: filter) networkInterfaceIds - 弹性网卡ID列表,支持多个; networkInterfaceNames - 弹性网卡名称列表,支持多个; vpcId - 弹性网卡所属vpc Id,支持单个; subnetId - 弹性网卡所属子网Id,支持单个; role - 网卡角色,取值范围:Primary(主网卡)、Secondary(辅助网卡)、Managed (受管网卡),支持单个; """, dest='filters', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 查询弹性网卡列表 ''', + description=''' + 查询弹性网卡列表。 + + 示例: jdc yunding describe-network-interfaces + ''', + ) + def describe_network_interfaces(self): + client_factory = ClientFactory('yunding') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.yunding.apis.DescribeNetworkInterfacesRequest import DescribeNetworkInterfacesRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeNetworkInterfacesRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) Region ID """, dest='regionId', required=False)), + (['--subnet-id'], dict(help="""(string) 子网ID """, dest='subnetId', required=True)), + (['--az'], dict(help="""(string) 可用区,用户的默认可用区,该参数无效,不建议使用 """, dest='az', required=False)), + (['--network-interface-name'], dict(help="""(string) 网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 """, dest='networkInterfaceName', required=False)), + (['--primary-ip-address'], dict(help="""(string) 网卡主IP,如果不指定,会自动从子网中分配 """, dest='primaryIpAddress', required=False)), + (['--secondary-ip-addresses'], dict(help="""(array: string) SecondaryIp列表 """, dest='secondaryIpAddresses', required=False)), + (['--secondary-ip-count'], dict(help="""(int) 自动分配的SecondaryIp数量 """, dest='secondaryIpCount', type=int, required=False)), + (['--security-groups'], dict(help="""(array: string) 要绑定的安全组ID列表,最多指定5个安全组 """, dest='securityGroups', required=False)), + (['--sanity-check'], dict(help="""(int) 源和目标IP地址校验,取值为0或者1,默认为1 """, dest='sanityCheck', type=int, required=False)), + (['--description'], dict(help="""(string) 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 """, dest='description', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 创建网卡接口,只能创建辅助网卡 ''', + description=''' + 创建网卡接口,只能创建辅助网卡。 + + 示例: jdc yunding create-network-interface --subnet-id xxx + ''', + ) + def create_network_interface(self): + client_factory = ClientFactory('yunding') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.yunding.apis.CreateNetworkInterfaceRequest import CreateNetworkInterfaceRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = CreateNetworkInterfaceRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + + @expose( + arguments=[ + (['--instance-id'], dict(help="""(string) 实例 Id """, dest='instanceId', required=True)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 云拔测-可用性agent任务查询接口 ''', + description=''' + 云拔测-可用性agent任务查询接口。 + + 示例: jdc yunding describe-tasks --instance-id xxx + ''', + ) + def describe_tasks(self): + client_factory = ClientFactory('yunding') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.yunding.apis.DescribeTasksRequest import DescribeTasksRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = DescribeTasksRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), @@ -114,6 +518,7 @@ def unassign_secondary_ips(self): (['--filters'], dict(help="""(array: filter) 过滤参数,多个过滤参数之间的关系为“与”(and); 支持以下属性的过滤:; instanceId, 支持operator选项:eq; instanceName, 支持operator选项:eq; engine, 支持operator选项:eq; engineVersion, 支持operator选项:eq; instanceStatus, 支持operator选项:eq; chargeMode, 支持operator选项:eq; vpcId, 支持operator选项:eq; """, dest='filters', required=False)), (['--type'], dict(help="""(int) 资源类型,MySQL:1,SqlServer:2 """, dest='type', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -147,6 +552,7 @@ def describe_rds_instances(self): (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -180,6 +586,7 @@ def describe_rds_instance(self): (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -213,6 +620,7 @@ def describe_instance_info(self): (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -247,6 +655,7 @@ def describe_rds_white_list(self): (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--ips'], dict(help="""(string) IP或IP段,不同的IP/IP段之间用英文逗号分隔,例如0.0.0.0/0,192.168.0.10 """, dest='ips', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -282,6 +691,7 @@ def modify_rds_white_list(self): (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为100,取值范围:[10,100],用于查询列表的接口 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -317,6 +727,7 @@ def describe_rds_accounts(self): (['--account-name'], dict(help="""(string) 账号名,在同一个RDS实例中,账号名不能重复。账号名的具体规则可参见帮助中心文档:[名称及密码限制](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='accountName', required=True)), (['--account-password'], dict(help="""(string) 密码,密码的具体规则可参见帮助中心文档:[名称及密码限制](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='accountPassword', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -351,6 +762,7 @@ def create_rds_account(self): (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--account-name'], dict(help="""(string) 账号名,在同一个实例中账号名不能重复 """, dest='accountName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -386,6 +798,7 @@ def delete_rds_account(self): (['--account-name'], dict(help="""(string) 账号名,在同一个实例中账号名不能重复 """, dest='accountName', required=True)), (['--account-privileges'], dict(help="""(array: accountPrivilege) 账号的访问权限 """, dest='accountPrivileges', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -414,6 +827,42 @@ def grant_rds_privilege(self): except Exception as e: print(e) + @expose( + arguments=[ + (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), + (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), + (['--account-name'], dict(help="""(string) 账号名,在同一个实例中账号名不能重复 """, dest='accountName', required=True)), + (['--db-names'], dict(help="""(array: string) 需要取消授权的数据库的名称。权限取消后,该账号将不能访问此数据库 """, dest='dbNames', required=False)), + (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), + (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), + ], + formatter_class=RawTextHelpFormatter, + help=''' 取消该账号对某个数据库的所有权限。权限取消后,该账号将不能访问此数据库。取消账号对某个数据库的访问权限,不影响该账号对其他数据库的访问权限 ''', + description=''' + 取消该账号对某个数据库的所有权限。权限取消后,该账号将不能访问此数据库。取消账号对某个数据库的访问权限,不影响该账号对其他数据库的访问权限。 + + 示例: jdc yunding revoke-privilege --instance-id xxx --account-name xxx + ''', + ) + def revoke_privilege(self): + client_factory = ClientFactory('yunding') + client = client_factory.get(self.app) + if client is None: + return + + try: + from jdcloud_sdk.services.yunding.apis.RevokePrivilegeRequest import RevokePrivilegeRequest + params_dict = collect_user_args(self.app) + headers = collect_user_headers(self.app) + req = RevokePrivilegeRequest(params_dict, headers) + resp = client.send(req) + Printer.print_result(resp) + except ImportError: + print('{"error":"This api is not supported, please use the newer version"}') + except Exception as e: + print(e) + @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), @@ -422,6 +871,7 @@ def grant_rds_privilege(self): (['--page-number'], dict(help="""(int) 显示数据的页码,默认为1,取值范围:[-1,∞)。pageNumber为-1时,返回所有数据页码;超过总页数时,显示最后一页; """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 每页显示的数据条数,默认为100,取值范围:[10,100],用于查询列表的接口 """, dest='pageSize', type=int, required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -457,6 +907,7 @@ def describe_rds_databases(self): (['--db-name'], dict(help="""(string) 数据库名,数据库名称的限制请参考[帮助中心文档](../../../documentation/Database-and-Cache-Service/RDS/Introduction/Restrictions/SQLServer-Restrictions.md) """, dest='dbName', required=True)), (['--character-set-name'], dict(help="""(string) 数据库的字符集名,当前支持的字符集请查看[枚举参数定义](../Enum-Definitions/Enum-Definitions.md) """, dest='characterSetName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -491,6 +942,7 @@ def create_rds_database(self): (['--instance-id'], dict(help="""(string) RDS 实例ID,唯一标识一个RDS实例 """, dest='instanceId', required=True)), (['--db-name'], dict(help="""(string) 库名称 """, dest='dbName', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -524,6 +976,7 @@ def delete_rds_database(self): (['--region-id'], dict(help="""(string) 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) """, dest='regionId', required=False)), (['--app-key'], dict(help="""(string) 应用appKey; """, dest='appKey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -554,7 +1007,7 @@ def describe_yd_rds_instances(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['assign-secondary-ips','unassign-secondary-ips','describe-rds-instances','describe-rds-instance','describe-instance-info','describe-rds-white-list','modify-rds-white-list','describe-rds-accounts','create-rds-account','delete-rds-account','grant-rds-privilege','describe-rds-databases','create-rds-database','delete-rds-database','describe-yd-rds-instances',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['put-product-metric-data','put-product-metric-data','describe-subnets','create-subnet','describe-subnet','delete-subnet','assign-secondary-ips','unassign-secondary-ips','describe-network-interface','delete-network-interface','describe-network-interfaces','create-network-interface','describe-tasks','describe-rds-instances','describe-rds-instance','describe-instance-info','describe-rds-white-list','modify-rds-white-list','describe-rds-accounts','create-rds-account','delete-rds-account','grant-rds-privilege','revoke-privilege','describe-rds-databases','create-rds-database','delete-rds-database','describe-yd-rds-instances',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/controllers/services/yundingdatapush.py b/jdcloud_cli/controllers/services/yundingdatapush.py index 972ebef..78b8a5a 100644 --- a/jdcloud_cli/controllers/services/yundingdatapush.py +++ b/jdcloud_cli/controllers/services/yundingdatapush.py @@ -46,6 +46,7 @@ class Meta: (['--vender-id'], dict(help="""(string) 商家ID """, dest='venderId', required=False)), (['--vender-name'], dict(help="""(string) 商家店铺名称 """, dest='venderName', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -78,6 +79,7 @@ def describe_datapush_venders(self): arguments=[ (['--datapush-vender'], dict(help="""(vender) 添加数据推送用户对象; """, dest='datapushVender', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -112,6 +114,7 @@ def add_datapush_vender(self): (['--yd-rds-instance-id'], dict(help="""(string) 云鼎数据库实例ID """, dest='ydRdsInstanceId', required=True)), (['--vender-id'], dict(help="""(string) 商家ID """, dest='venderId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -144,6 +147,7 @@ def delete_datapush_vender(self): arguments=[ (['--appkey'], dict(help="""(string) appkey """, dest='appkey', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, @@ -176,6 +180,7 @@ def describe_rds_instances(self): arguments=[ (['--order-sync-spec'], dict(help="""(orderSyncSpec) 历史订单同步对象; """, dest='orderSyncSpec', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, diff --git a/jdcloud_cli/controllers/services/zfs.py b/jdcloud_cli/controllers/services/zfs.py index 8170596..95bb467 100644 --- a/jdcloud_cli/controllers/services/zfs.py +++ b/jdcloud_cli/controllers/services/zfs.py @@ -41,30 +41,30 @@ class Meta: (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), - (['--filters'], dict(help="""(array: filter) fileSystemId - 文件系统ID,精确匹配,支持多个; name - 文件系统名称,模糊匹配,支持单个; status - 文件系统状态,精确匹配,支持多个 FileSystem Status/creating、available、in-use; """, dest='filters', required=False)), + (['--filters'], dict(help="""(array: filter) fileSystemId - 文件系统ID,精确匹配,支持多个; mountTargetId - 挂载目标ID,精确匹配,支持多个; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' - 查询文件系统列表。; - filters多个过滤条件之间是逻辑与(AND),每个条件内部的多个取值是逻辑或(OR); ''', + help=''' - 查询挂载目标列表。; ''', description=''' - - 查询文件系统列表。; - filters多个过滤条件之间是逻辑与(AND),每个条件内部的多个取值是逻辑或(OR); 。 + - 查询挂载目标列表。; 。 - 示例: jdc zfs describe-file-systems + 示例: jdc zfs describe-mount-targets ''', ) - def describe_file_systems(self): + def describe_mount_targets(self): client_factory = ClientFactory('zfs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.zfs.apis.DescribeFileSystemsRequest import DescribeFileSystemsRequest + from jdcloud_sdk.services.zfs.apis.DescribeMountTargetsRequest import DescribeMountTargetsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeFileSystemsRequest(params_dict, headers) + req = DescribeMountTargetsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -75,32 +75,34 @@ def describe_file_systems(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--name'], dict(help="""(string) 文件系统名称 """, dest='name', required=True)), - (['--description'], dict(help="""(string) 文件系统描述 """, dest='description', required=True)), + (['--file-system-id'], dict(help="""(string) 创建挂载目标的文件系统 """, dest='fileSystemId', required=True)), + (['--subnet-id'], dict(help="""(string) 子网id """, dest='subnetId', required=True)), + (['--vpc-id'], dict(help="""(string) vpcId """, dest='vpcId', required=True)), + (['--security-group-id'], dict(help="""(string) 安全组id """, dest='securityGroupId', required=False)), (['--client-token'], dict(help="""(string) 幂等性参数(只支持数字、大小写字母,且不能超过64字符) """, dest='clientToken', required=True)), - (['--file-system-type'], dict(help="""(string) 文件系统类型(通用型:gp1,容量型:std1),默认为通用型 """, dest='fileSystemType', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' - 创建一个新的文件系统,为这个文件系统分配一个Id; ''', + help=''' - 为一个文件系统创建一个挂载目标。通过这个挂载目标,你可以挂载将一个文件系统挂载到主机实例上。; - 创建一个挂载目标,为这个挂载目标分配一个Id; ''', description=''' - - 创建一个新的文件系统,为这个文件系统分配一个Id; 。 + - 为一个文件系统创建一个挂载目标。通过这个挂载目标,你可以挂载将一个文件系统挂载到主机实例上。; - 创建一个挂载目标,为这个挂载目标分配一个Id; 。 - 示例: jdc zfs create-file-system --name xxx --description xxx --client-token xxx + 示例: jdc zfs create-mount-target --file-system-id xxx --subnet-id xxx --vpc-id xxx --client-token xxx ''', ) - def create_file_system(self): + def create_mount_target(self): client_factory = ClientFactory('zfs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.zfs.apis.CreateFileSystemRequest import CreateFileSystemRequest + from jdcloud_sdk.services.zfs.apis.CreateMountTargetRequest import CreateMountTargetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateFileSystemRequest(params_dict, headers) + req = CreateMountTargetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -111,29 +113,30 @@ def create_file_system(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--file-system-id'], dict(help="""(string) 文件系统ID """, dest='fileSystemId', required=True)), + (['--mount-target-id'], dict(help="""(string) 挂载目标ID """, dest='mountTargetId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询文件系统详情 ''', + help=''' 查询挂载目标详情 ''', description=''' - 查询文件系统详情。 + 查询挂载目标详情。 - 示例: jdc zfs describe-file-system --file-system-id xxx + 示例: jdc zfs describe-mount-target --mount-target-id xxx ''', ) - def describe_file_system(self): + def describe_mount_target(self): client_factory = ClientFactory('zfs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.zfs.apis.DescribeFileSystemRequest import DescribeFileSystemRequest + from jdcloud_sdk.services.zfs.apis.DescribeMountTargetRequest import DescribeMountTargetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeFileSystemRequest(params_dict, headers) + req = DescribeMountTargetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -144,31 +147,30 @@ def describe_file_system(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--file-system-id'], dict(help="""(string) 文件系统ID """, dest='fileSystemId', required=True)), - (['--name'], dict(help="""(string) 文件系统名称(参数规则:不可为空,只支持中文、数字、大小写字母、英文下划线“_”及中划线“-”,且不能超过32字符) """, dest='name', required=False)), - (['--description'], dict(help="""(string) 文件系统描述(参数规则:不能超过256字符) """, dest='description', required=False)), + (['--mount-target-id'], dict(help="""(string) 挂载目标ID """, dest='mountTargetId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 修改文件系统属性(name 和 description 必须要指定一个) ''', + help=''' - 删除挂载目标的同时会删除相关的网络接口。; ''', description=''' - 修改文件系统属性(name 和 description 必须要指定一个)。 + - 删除挂载目标的同时会删除相关的网络接口。; 。 - 示例: jdc zfs modify-file-system-attribute --file-system-id xxx + 示例: jdc zfs delete-mount-target --mount-target-id xxx ''', ) - def modify_file_system_attribute(self): + def delete_mount_target(self): client_factory = ClientFactory('zfs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.zfs.apis.ModifyFileSystemAttributeRequest import ModifyFileSystemAttributeRequest + from jdcloud_sdk.services.zfs.apis.DeleteMountTargetRequest import DeleteMountTargetRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = ModifyFileSystemAttributeRequest(params_dict, headers) + req = DeleteMountTargetRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -179,29 +181,33 @@ def modify_file_system_attribute(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--file-system-id'], dict(help="""(string) 文件系统ID """, dest='fileSystemId', required=True)), + (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), + (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), + (['--tags'], dict(help="""(array: tagFilter) Tag筛选条件 """, dest='tags', required=False)), + (['--filters'], dict(help="""(array: filter) fileSystemId - 文件系统ID,精确匹配,支持多个; name - 文件系统名称,模糊匹配,支持单个; status - 文件系统状态,精确匹配,支持多个 FileSystem Status/creating、available、in-use; """, dest='filters', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' - 删除一个文件系统,一旦删除,该文件系统将不存在,也无法访问已删除的文件系统里的任何内容。; [MFA enabled] ''', + help=''' - 查询文件系统列表。; - filters多个过滤条件之间是逻辑与(AND),每个条件内部的多个取值是逻辑或(OR); ''', description=''' - - 删除一个文件系统,一旦删除,该文件系统将不存在,也无法访问已删除的文件系统里的任何内容。; [MFA enabled]。 + - 查询文件系统列表。; - filters多个过滤条件之间是逻辑与(AND),每个条件内部的多个取值是逻辑或(OR); 。 - 示例: jdc zfs delete-file-system --file-system-id xxx + 示例: jdc zfs describe-file-systems ''', ) - def delete_file_system(self): + def describe_file_systems(self): client_factory = ClientFactory('zfs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.zfs.apis.DeleteFileSystemRequest import DeleteFileSystemRequest + from jdcloud_sdk.services.zfs.apis.DescribeFileSystemsRequest import DescribeFileSystemsRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteFileSystemRequest(params_dict, headers) + req = DescribeFileSystemsRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -212,31 +218,34 @@ def delete_file_system(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--page-number'], dict(help="""(int) 页码, 默认为1, 取值范围:[1,∞) """, dest='pageNumber', type=int, required=False)), - (['--page-size'], dict(help="""(int) 分页大小,默认为20,取值范围:[10,100] """, dest='pageSize', type=int, required=False)), - (['--filters'], dict(help="""(array: filter) fileSystemId - 文件系统ID,精确匹配,支持多个; mountTargetId - 挂载目标ID,精确匹配,支持多个; """, dest='filters', required=False)), + (['--name'], dict(help="""(string) 文件系统名称 """, dest='name', required=True)), + (['--description'], dict(help="""(string) 文件系统描述 """, dest='description', required=True)), + (['--client-token'], dict(help="""(string) 幂等性参数(只支持数字、大小写字母,且不能超过64字符) """, dest='clientToken', required=True)), + (['--file-system-type'], dict(help="""(string) 文件系统类型(通用型:gp1,容量型:std1),默认为通用型 """, dest='fileSystemType', required=False)), + (['--service-code'], dict(help="""(string) 文件系统的serviceCode,默认为zfs """, dest='serviceCode', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' - 查询挂载目标列表。; ''', + help=''' - 创建一个新的文件系统,为这个文件系统分配一个Id; ''', description=''' - - 查询挂载目标列表。; 。 + - 创建一个新的文件系统,为这个文件系统分配一个Id; 。 - 示例: jdc zfs describe-mount-targets + 示例: jdc zfs create-file-system --name xxx --description xxx --client-token xxx ''', ) - def describe_mount_targets(self): + def create_file_system(self): client_factory = ClientFactory('zfs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.zfs.apis.DescribeMountTargetsRequest import DescribeMountTargetsRequest + from jdcloud_sdk.services.zfs.apis.CreateFileSystemRequest import CreateFileSystemRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeMountTargetsRequest(params_dict, headers) + req = CreateFileSystemRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -247,33 +256,30 @@ def describe_mount_targets(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--file-system-id'], dict(help="""(string) 创建挂载目标的文件系统 """, dest='fileSystemId', required=True)), - (['--subnet-id'], dict(help="""(string) 子网id """, dest='subnetId', required=True)), - (['--vpc-id'], dict(help="""(string) vpcId """, dest='vpcId', required=True)), - (['--security-group-id'], dict(help="""(string) 安全组id """, dest='securityGroupId', required=False)), - (['--client-token'], dict(help="""(string) 幂等性参数(只支持数字、大小写字母,且不能超过64字符) """, dest='clientToken', required=True)), + (['--file-system-id'], dict(help="""(string) 文件系统ID """, dest='fileSystemId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' - 为一个文件系统创建一个挂载目标。通过这个挂载目标,你可以挂载将一个文件系统挂载到主机实例上。; - 创建一个挂载目标,为这个挂载目标分配一个Id; ''', + help=''' 查询文件系统详情 ''', description=''' - - 为一个文件系统创建一个挂载目标。通过这个挂载目标,你可以挂载将一个文件系统挂载到主机实例上。; - 创建一个挂载目标,为这个挂载目标分配一个Id; 。 + 查询文件系统详情。 - 示例: jdc zfs create-mount-target --file-system-id xxx --subnet-id xxx --vpc-id xxx --client-token xxx + 示例: jdc zfs describe-file-system --file-system-id xxx ''', ) - def create_mount_target(self): + def describe_file_system(self): client_factory = ClientFactory('zfs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.zfs.apis.CreateMountTargetRequest import CreateMountTargetRequest + from jdcloud_sdk.services.zfs.apis.DescribeFileSystemRequest import DescribeFileSystemRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = CreateMountTargetRequest(params_dict, headers) + req = DescribeFileSystemRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -284,29 +290,32 @@ def create_mount_target(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--mount-target-id'], dict(help="""(string) 挂载目标ID """, dest='mountTargetId', required=True)), + (['--file-system-id'], dict(help="""(string) 文件系统ID """, dest='fileSystemId', required=True)), + (['--name'], dict(help="""(string) 文件系统名称(参数规则:不可为空,只支持中文、数字、大小写字母、英文下划线“_”及中划线“-”,且不能超过32字符) """, dest='name', required=False)), + (['--description'], dict(help="""(string) 文件系统描述(参数规则:不能超过256字符) """, dest='description', required=False)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' 查询挂载目标详情 ''', + help=''' 修改文件系统属性(name 和 description 必须要指定一个) ''', description=''' - 查询挂载目标详情。 + 修改文件系统属性(name 和 description 必须要指定一个)。 - 示例: jdc zfs describe-mount-target --mount-target-id xxx + 示例: jdc zfs modify-file-system-attribute --file-system-id xxx ''', ) - def describe_mount_target(self): + def modify_file_system_attribute(self): client_factory = ClientFactory('zfs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.zfs.apis.DescribeMountTargetRequest import DescribeMountTargetRequest + from jdcloud_sdk.services.zfs.apis.ModifyFileSystemAttributeRequest import ModifyFileSystemAttributeRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DescribeMountTargetRequest(params_dict, headers) + req = ModifyFileSystemAttributeRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -317,29 +326,30 @@ def describe_mount_target(self): @expose( arguments=[ (['--region-id'], dict(help="""(string) 地域ID """, dest='regionId', required=False)), - (['--mount-target-id'], dict(help="""(string) 挂载目标ID """, dest='mountTargetId', required=True)), + (['--file-system-id'], dict(help="""(string) 文件系统ID """, dest='fileSystemId', required=True)), (['--input-json'], dict(help='(json) 以json字符串或文件绝对路径形式作为输入参数。\n字符串方式举例:--input-json \'{"field":"value"}\';\n文件格式举例:--input-json file:///xxxx.json', dest='input_json', required=False)), + (['--jdcloud-header'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='jdcloudHeaders', required=False)), (['--headers'], dict(help="""(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""", dest='headers', required=False)), ], formatter_class=RawTextHelpFormatter, - help=''' - 删除挂载目标的同时会删除相关的网络接口。; ''', + help=''' - 删除一个文件系统,一旦删除,该文件系统将不存在,也无法访问已删除的文件系统里的任何内容。; [MFA enabled] ''', description=''' - - 删除挂载目标的同时会删除相关的网络接口。; 。 + - 删除一个文件系统,一旦删除,该文件系统将不存在,也无法访问已删除的文件系统里的任何内容。; [MFA enabled]。 - 示例: jdc zfs delete-mount-target --mount-target-id xxx + 示例: jdc zfs delete-file-system --file-system-id xxx ''', ) - def delete_mount_target(self): + def delete_file_system(self): client_factory = ClientFactory('zfs') client = client_factory.get(self.app) if client is None: return try: - from jdcloud_sdk.services.zfs.apis.DeleteMountTargetRequest import DeleteMountTargetRequest + from jdcloud_sdk.services.zfs.apis.DeleteFileSystemRequest import DeleteFileSystemRequest params_dict = collect_user_args(self.app) headers = collect_user_headers(self.app) - req = DeleteMountTargetRequest(params_dict, headers) + req = DeleteFileSystemRequest(params_dict, headers) resp = client.send(req) Printer.print_result(resp) except ImportError: @@ -349,7 +359,7 @@ def delete_mount_target(self): @expose( arguments=[ - (['--api'], dict(help="""(string) api name """, choices=['describe-file-systems','create-file-system','describe-file-system','modify-file-system-attribute','delete-file-system','describe-mount-targets','create-mount-target','describe-mount-target','delete-mount-target',], required=True)), + (['--api'], dict(help="""(string) api name """, choices=['describe-mount-targets','create-mount-target','describe-mount-target','delete-mount-target','describe-file-systems','create-file-system','describe-file-system','modify-file-system-attribute','delete-file-system',], required=True)), ], formatter_class=RawTextHelpFormatter, help=''' 生成单个API接口的json骨架空字符串 ''', diff --git a/jdcloud_cli/inputjson_parser.py b/jdcloud_cli/inputjson_parser.py index a1e77d3..6b9ebf6 100644 --- a/jdcloud_cli/inputjson_parser.py +++ b/jdcloud_cli/inputjson_parser.py @@ -36,7 +36,7 @@ def __init__(self, input_json): def get_param_obj(self): try: - return yaml.load(self.input_json) + return yaml.load(self.input_json, Loader=yaml.FullLoader) except yaml.YAMLError: print('Json is invalid!') sys.exit(1) @@ -52,7 +52,7 @@ def get_param_obj(self): try: with open(file_path) as f: content = f.read() - return yaml.load(content) + return yaml.load(content, Loader=yaml.FullLoader) except IOError: print('File is not accessible!') sys.exit(1) diff --git a/jdcloud_cli/jdc.py b/jdcloud_cli/jdc.py index de3de64..c0b1ab8 100644 --- a/jdcloud_cli/jdc.py +++ b/jdcloud_cli/jdc.py @@ -19,66 +19,66 @@ from jdcloud_cli.cement.core.foundation import CementApp from jdcloud_cli.controllers.base_controller import BaseController from jdcloud_cli.controllers.configure_controller import ConfigureController -from jdcloud_cli.controllers.services.rds import RdsController -from jdcloud_cli.controllers.services.kubernetes import KubernetesController from jdcloud_cli.controllers.services.vqd import VqdController from jdcloud_cli.controllers.services.streamcomputer import StreamcomputerController -from jdcloud_cli.controllers.services.ipanti import IpantiController from jdcloud_cli.controllers.services.ssl import SslController from jdcloud_cli.controllers.services.domainservice import DomainserviceController -from jdcloud_cli.controllers.services.jmr import JmrController from jdcloud_cli.controllers.services.oss import OssController from jdcloud_cli.controllers.services.redis import RedisController from jdcloud_cli.controllers.services.billing import BillingController -from jdcloud_cli.controllers.services.deploy import DeployController -from jdcloud_cli.controllers.services.sop import SopController -from jdcloud_cli.controllers.services.function import FunctionController from jdcloud_cli.controllers.services.portal import PortalController -from jdcloud_cli.controllers.services.jdccs import JdccsController -from jdcloud_cli.controllers.services.logs import LogsController from jdcloud_cli.controllers.services.clouddnsservice import ClouddnsserviceController -from jdcloud_cli.controllers.services.cps import CpsController from jdcloud_cli.controllers.services.cdn import CdnController from jdcloud_cli.controllers.services.streambus import StreambusController from jdcloud_cli.controllers.services.apigateway import ApigatewayController -from jdcloud_cli.controllers.services.httpdns import HttpdnsController -from jdcloud_cli.controllers.services.disk import DiskController from jdcloud_cli.controllers.services.sts import StsController -from jdcloud_cli.controllers.services.nc import NcController -from jdcloud_cli.controllers.services.vm import VmController from jdcloud_cli.controllers.services.nativecontainer import NativecontainerController -from jdcloud_cli.controllers.services.iotcore import IotcoreController from jdcloud_cli.controllers.services.pod import PodController -from jdcloud_cli.controllers.services.ams import AmsController -from jdcloud_cli.controllers.services.jdro import JdroController -from jdcloud_cli.controllers.services.zfs import ZfsController -from jdcloud_cli.controllers.services.vod import VodController -from jdcloud_cli.controllers.services.yundingdatapush import YundingdatapushController from jdcloud_cli.controllers.services.datastar import DatastarController from jdcloud_cli.controllers.services.kms import KmsController from jdcloud_cli.controllers.services.elite import EliteController -from jdcloud_cli.controllers.services.ossopenapi import OssopenapiController from jdcloud_cli.controllers.services.iam import IamController from jdcloud_cli.controllers.services.iothub import IothubController from jdcloud_cli.controllers.services.sms import SmsController -from jdcloud_cli.controllers.services.jcq import JcqController from jdcloud_cli.controllers.services.resourcetag import ResourcetagController -from jdcloud_cli.controllers.services.baseanti import BaseantiController +from jdcloud_cli.controllers.services.jcq import JcqController from jdcloud_cli.controllers.services.ias import IasController -from jdcloud_cli.controllers.services.mongodb import MongodbController from jdcloud_cli.controllers.services.jdfusion import JdfusionController -from jdcloud_cli.controllers.services.live import LiveController from jdcloud_cli.controllers.services.detection import DetectionController from jdcloud_cli.controllers.services.iotlink import IotlinkController from jdcloud_cli.controllers.services.renewal import RenewalController from jdcloud_cli.controllers.services.yunding import YundingController -from jdcloud_cli.controllers.services.vpc import VpcController -from jdcloud_cli.controllers.services.monitor import MonitorController -from jdcloud_cli.controllers.services.xdata import XdataController from jdcloud_cli.controllers.services.containerregistry import ContainerregistryController from jdcloud_cli.controllers.services.partner import PartnerController from jdcloud_cli.controllers.services.lb import LbController from jdcloud_cli.controllers.services.industrydata import IndustrydataController +from jdcloud_cli.controllers.services.rds import RdsController +from jdcloud_cli.controllers.services.kubernetes import KubernetesController +from jdcloud_cli.controllers.services.ipanti import IpantiController +from jdcloud_cli.controllers.services.jmr import JmrController +from jdcloud_cli.controllers.services.deploy import DeployController +from jdcloud_cli.controllers.services.sop import SopController +from jdcloud_cli.controllers.services.function import FunctionController +from jdcloud_cli.controllers.services.jdccs import JdccsController +from jdcloud_cli.controllers.services.logs import LogsController +from jdcloud_cli.controllers.services.cps import CpsController +from jdcloud_cli.controllers.services.httpdns import HttpdnsController +from jdcloud_cli.controllers.services.disk import DiskController +from jdcloud_cli.controllers.services.nc import NcController +from jdcloud_cli.controllers.services.vm import VmController +from jdcloud_cli.controllers.services.iotcore import IotcoreController +from jdcloud_cli.controllers.services.zfs import ZfsController +from jdcloud_cli.controllers.services.ams import AmsController +from jdcloud_cli.controllers.services.jdro import JdroController +from jdcloud_cli.controllers.services.vod import VodController +from jdcloud_cli.controllers.services.yundingdatapush import YundingdatapushController +from jdcloud_cli.controllers.services.ossopenapi import OssopenapiController +from jdcloud_cli.controllers.services.baseanti import BaseantiController +from jdcloud_cli.controllers.services.mongodb import MongodbController +from jdcloud_cli.controllers.services.live import LiveController +from jdcloud_cli.controllers.services.vpc import VpcController +from jdcloud_cli.controllers.services.monitor import MonitorController +from jdcloud_cli.controllers.services.xdata import XdataController class JDC(CementApp): @@ -92,65 +92,65 @@ def main(): with JDC() as app: app.handler.register(ConfigureController) - app.handler.register(RdsController) - app.handler.register(KubernetesController) app.handler.register(VqdController) app.handler.register(StreamcomputerController) - app.handler.register(IpantiController) app.handler.register(SslController) app.handler.register(DomainserviceController) - app.handler.register(JmrController) app.handler.register(OssController) app.handler.register(RedisController) app.handler.register(BillingController) - app.handler.register(DeployController) - app.handler.register(SopController) - app.handler.register(FunctionController) app.handler.register(PortalController) - app.handler.register(JdccsController) - app.handler.register(LogsController) app.handler.register(ClouddnsserviceController) - app.handler.register(CpsController) app.handler.register(CdnController) app.handler.register(StreambusController) app.handler.register(ApigatewayController) - app.handler.register(HttpdnsController) - app.handler.register(DiskController) app.handler.register(StsController) - app.handler.register(NcController) - app.handler.register(VmController) app.handler.register(NativecontainerController) - app.handler.register(IotcoreController) app.handler.register(PodController) - app.handler.register(AmsController) - app.handler.register(JdroController) - app.handler.register(ZfsController) - app.handler.register(VodController) - app.handler.register(YundingdatapushController) app.handler.register(DatastarController) app.handler.register(KmsController) app.handler.register(EliteController) - app.handler.register(OssopenapiController) app.handler.register(IamController) app.handler.register(IothubController) app.handler.register(SmsController) - app.handler.register(JcqController) app.handler.register(ResourcetagController) - app.handler.register(BaseantiController) + app.handler.register(JcqController) app.handler.register(IasController) - app.handler.register(MongodbController) app.handler.register(JdfusionController) - app.handler.register(LiveController) app.handler.register(DetectionController) app.handler.register(IotlinkController) app.handler.register(RenewalController) app.handler.register(YundingController) - app.handler.register(VpcController) - app.handler.register(MonitorController) - app.handler.register(XdataController) app.handler.register(ContainerregistryController) app.handler.register(PartnerController) app.handler.register(LbController) app.handler.register(IndustrydataController) + app.handler.register(RdsController) + app.handler.register(KubernetesController) + app.handler.register(IpantiController) + app.handler.register(JmrController) + app.handler.register(DeployController) + app.handler.register(SopController) + app.handler.register(FunctionController) + app.handler.register(JdccsController) + app.handler.register(LogsController) + app.handler.register(CpsController) + app.handler.register(HttpdnsController) + app.handler.register(DiskController) + app.handler.register(NcController) + app.handler.register(VmController) + app.handler.register(IotcoreController) + app.handler.register(ZfsController) + app.handler.register(AmsController) + app.handler.register(JdroController) + app.handler.register(VodController) + app.handler.register(YundingdatapushController) + app.handler.register(OssopenapiController) + app.handler.register(BaseantiController) + app.handler.register(MongodbController) + app.handler.register(LiveController) + app.handler.register(VpcController) + app.handler.register(MonitorController) + app.handler.register(XdataController) app.run() diff --git a/jdcloud_cli/parameter_builder.py b/jdcloud_cli/parameter_builder.py index 7442be6..70972fd 100644 --- a/jdcloud_cli/parameter_builder.py +++ b/jdcloud_cli/parameter_builder.py @@ -32,16 +32,22 @@ def collect_user_args(app): params_dict.update(input_dict) _append_region_id(params_dict) + if 'input_json' in params_dict.keys(): + del params_dict["input_json"] + if 'jdcloudHeaders' in params_dict.keys(): + del params_dict["jdcloudHeaders"] return params_dict def collect_user_headers(app): - headers = app.pargs.headers + headers = app.pargs.jdcloudHeaders + if headers is None: + headers = app.pargs.headers if headers is None: return None try: - obj = yaml.load(headers) + obj = yaml.load(headers, Loader=yaml.FullLoader) if not isinstance(obj, dict): raise yaml.YAMLError except yaml.YAMLError: @@ -74,12 +80,12 @@ def _get_input_args(pargs_dict): return result -def _parse_json(string): +def _parse_json(json_data): try: - obj = yaml.load(string) + obj = yaml.load(json_data, Loader=yaml.FullLoader) return obj except ValueError: - return string + return json_data def _append_region_id(param_dict): diff --git a/jdcloud_cli/resources/jdc.rc b/jdcloud_cli/resources/jdc.rc index 9787c41..7386650 100644 --- a/jdcloud_cli/resources/jdc.rc +++ b/jdcloud_cli/resources/jdc.rc @@ -27,7 +27,7 @@ _jdc_complete() # SETUP THE BASE LEVEL if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $(compgen \ - -W "--debug -v --version -h --help configure rds kubernetes vqd streamcomputer ipanti ssl domainservice jmr oss redis billing deploy sop function portal jdccs logs clouddnsservice cps cdn streambus apigateway httpdns disk sts nc vm nativecontainer iotcore pod ams jdro zfs vod yundingdatapush datastar kms elite ossopenapi iam iothub sms jcq resourcetag baseanti ias mongodb jdfusion live detection iotlink renewal yunding vpc monitor xdata containerregistry partner lb industrydata " \ + -W "--debug -v --version -h --help configure vqd streamcomputer ssl domainservice oss redis billing portal clouddnsservice cdn streambus apigateway sts nativecontainer pod datastar kms elite iam iothub sms resourcetag jcq ias jdfusion detection iotlink renewal yunding containerregistry partner lb industrydata rds kubernetes ipanti jmr deploy sop function jdccs logs cps httpdns disk nc vm iotcore zfs ams jdro vod yundingdatapush ossopenapi baseanti mongodb live vpc monitor xdata " \ -- $cur) ) @@ -36,304 +36,304 @@ _jdc_complete() case "$prev" in # HANDLE EVERYTHING AFTER THE SECOND LEVEL NAMESPACE - "rds") + "vqd") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-accounts create-account describe-account-privilege delete-account grant-privilege revoke-privilege reset-password create-super-account grant-account-privilege describe-audit create-audit delete-audit describe-audit-options modify-audit describe-audit-files describe-audit-download-url enable-audit disable-audit describe-audit-result describe-azs describe-backups create-backup delete-backup describe-backup-download-url describe-backup-synchronicities create-backup-synchronicity delete-backup-synchronicity create-instance-by-time-in-cross-region describe-binlogs describe-binlog-download-url clear-binlogs alter-table-with-online-ddl describe-privilege describe-databases create-database delete-database restore-database-from-backup restore-database-from-file restore-database-from-oss describe-error-logs describe-import-files get-upload-key set-import-file-shared delete-import-file describe-instances create-instance describe-instance-attributes delete-instance describe-backup-policy modify-backup-policy modify-instance-name failover-instance reboot-instance enable-internet-access disable-internet-access restore-instance create-instance-from-backup modify-instance-spec create-instance-by-time create-roinstance modify-connection-mode describe-latest-restore-time modify-parameter-group exchange-instance-dns modify-instance-az describe-ssl enable-ssl restore-instance-by-time enable-intercept disable-intercept describe-intercept-result describe-intercept describe-logs update-log-download-urlinternal describe-log-download-url describe-parameters modify-parameters delete-parameter-group modify-parameter-group-attribute describe-parameter-groups create-parameter-group describe-parameter-group-parameters modify-parameter-group-parameters describe-parameter-modify-records copy-parameter-group describe-parameter-group-attached-instances describe-index-performance describe-query-performance describe-slow-log-attributes describe-slow-logs describe-active-query-performance describe-error-log describe-tables describe-tde enable-tde describe-white-list modify-white-list " -- $cur) ) + -W "-v --version -h --help generate-skeleton set-callback query-callback list-vqd-templates create-vqd-template get-vqd-template update-vqd-template delete-vqd-template submit-vqd-task batch-submit-vqd-tasks list-vqd-tasks get-vqd-task delete-vqd-task query-vqd-task-result batch-delete-vqd-tasks " -- $cur) ) ;; - "kubernetes") + "streamcomputer") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-clusters create-cluster describe-cluster modify-cluster delete-cluster set-user-metrics abort-upgrade describe-progress set-auto-upgrade upgrade-cluster set-addons describe-node-groups create-node-group describe-node-group modify-node-group delete-node-group set-node-group-size set-auto-repair rollback-node-group-upgrade set-node-group-ca delete-node-instances describe-quotas describe-server-config describe-versions describe-node-version describe-upgradable-master-versions describe-upgradable-node-versions " -- $cur) ) + -W "-v --version -h --help generate-skeleton query-namespaces query-namespace-detail create-namespace update-namespace delete-namespace describe-storage add-or-update-storage delete-storage get-storage-list describe-job add-or-update-job delete-job get-job-list start-job stop-job " -- $cur) ) ;; - "vqd") + "ssl") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton set-callback query-callback submit-vqd-task batch-submit-vqd-tasks list-vqd-tasks get-vqd-task delete-vqd-task query-vqd-task-result batch-delete-vqd-tasks list-vqd-templates create-vqd-template get-vqd-template update-vqd-template delete-vqd-template " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-certs describe-cert delete-certs upload-cert download-cert update-cert-name update-cert " -- $cur) ) ;; - "streamcomputer") + "domainservice") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-job add-or-update-job delete-job get-job-list start-job stop-job query-namespaces query-namespace-detail create-namespace update-namespace delete-namespace describe-storage add-or-update-storage delete-storage get-storage-list " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-resource-record create-resource-record modify-resource-record delete-resource-record modify-resource-record-status describe-view-tree batch-set-resource-records describe-domains create-domain modify-domain delete-domain describe-domain-query-count describe-domain-query-traffic describe-action-log describe-user-view create-user-view delete-user-view describe-user-view-ip create-user-view-ip delete-user-view-ip describe-monitor create-monitor modify-monitor describe-monitor-target create-monitor-target modify-monitor-status delete-monitor describe-monitor-alarm " -- $cur) ) ;; - "ipanti") + "oss") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-ddo-sattack-logs describe-ccattack-logs describe-ccattack-log-details describe-attack-statistics describe-attack-type-count describe-ddo-sgraph describe-fwd-graph describe-ccgraph describe-forward-rules create-forward-rule describe-forward-rule modify-forward-rule delete-forward-rule switch-forward-rule-protect switch-forward-rule-origin describe-protection-rule-of-forward-rule modify-protection-rule-of-forward-rule describe-geo-areas describe-black-list-rule-of-forward-rule modify-black-list-rule-of-forward-rule enable-black-list-rule-of-forward-rule disable-black-list-rule-of-forward-rule describe-white-list-rule-of-forward-rule modify-white-list-rule-of-forward-rule enable-white-list-rule-of-forward-rule disable-white-list-rule-of-forward-rule describe-instances create-instance describe-instance modify-instance-name modify-epb describe-alarm-config modify-alarm-config describe-name-list describe-protection-statistics check-name describe-vpc-ip-list describe-cps-ip-list describe-ip-sets create-ip-set describe-ip-set delete-ip-set describe-ip-set-usage describe-web-rules create-web-rule describe-web-rule modify-web-rule delete-web-rule bind-cert switch-web-rule-protect switch-web-rule-origin enable-web-rule-cc disable-web-rule-cc enable-web-rule-ccobserver-mode disable-web-rule-ccobserver-mode describe-ccprotection-rules-of-web-rule create-ccprotection-rule-of-web-rule describe-ccprotection-rule-of-web-rule modify-ccprotection-rule-of-web-rule delete-ccprotection-rule-of-web-rule enable-ccprotection-rule-of-web-rule disable-ccprotection-rule-of-web-rule describe-ccprotection-config-of-web-rule modify-ccprotection-config-of-web-rule describe-ccprotection-default-config-of-web-rule modify-cert-info describe-web-rule-black-list-usage describe-black-list-rules-of-web-rule create-black-list-rule-of-web-rule describe-black-list-rule-of-web-rule modify-black-list-rule-of-web-rule delete-black-list-rule-of-web-rule enable-web-rule-black-list enable-black-list-rule-of-web-rule disable-web-rule-black-list disable-black-list-rule-of-web-rule describe-web-rule-white-list-usage describe-white-list-rules-of-web-rule create-white-list-rule-of-web-rule describe-white-list-rule-of-web-rule modify-white-list-rule-of-web-rule delete-white-list-rule-of-web-rule enable-web-rule-white-list enable-white-list-rule-of-web-rule disable-web-rule-white-list disable-white-list-rule-of-web-rule describe-web-rule-black-list-geo-areas describe-web-rule-white-list-geo-areas describe-web-rule-rsgeo-areas " -- $cur) ) + -W "-v --version -h --help generate-skeleton list-buckets put-bucket delete-bucket head-bucket " -- $cur) ) ;; - "ssl") + "redis") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-certs describe-cert delete-certs upload-cert download-cert update-cert-name update-cert " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-spec-config describe-available-resource describe-available-resource2 describe-cache-instances create-cache-instance describe-cache-instance modify-cache-instance-attribute delete-cache-instance modify-cache-instance-class reset-cache-instance-password describe-instance-config modify-instance-config describe-analysis-time modify-analysis-time describe-cache-analysis-list create-cache-analysis describe-cache-analysis-result describe-client-list describe-client-ip-detail describe-backups create-backup describe-backup-policy modify-backup-policy restore-instance describe-download-url describe-cluster-info describe-ip-white-list modify-ip-white-list describe-slow-log describe-task-progress-list get-disable-commands set-disable-commands describe-accounts create-account modify-account delete-account modify-accounts start-clear-data stop-clear-data describe-clear-data describe-big-key-list create-big-key-analysis describe-big-key-detail describe-big-key-analysis-time modify-big-key-analysis-time stop-cache-analysis describe-analysis-threshold modify-analysis-threshold create-big-key-analysis2 describe-big-key-list2 describe-big-key-detail2 describe-big-key-analysis-time2 modify-big-key-analysis-time2 describe-analysis-threshold2 modify-analysis-threshold2 describe-hot-key-result2 describe-hot-key-detail2 describe-instance-class describe-available-region describe-user-quota " -- $cur) ) ;; - "domainservice") + "billing") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-action-log describe-domains create-domain modify-domain delete-domain describe-domain-query-count describe-domain-query-traffic describe-resource-record create-resource-record modify-resource-record delete-resource-record modify-resource-record-status describe-view-tree batch-set-resource-records describe-user-view create-user-view delete-user-view describe-user-view-ip create-user-view-ip delete-user-view-ip describe-monitor create-monitor modify-monitor describe-monitor-target create-monitor-target modify-monitor-status delete-monitor describe-monitor-alarm " -- $cur) ) + -W "-v --version -h --help generate-skeleton query-bill-summary query-bill-detail calculate-total-price " -- $cur) ) ;; - "jmr") + "portal") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-cluster delete-cluster describe-clusters create-cluster " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-product describe-products-by-id " -- $cur) ) ;; - "oss") + "clouddnsservice") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton list-buckets put-bucket delete-bucket head-bucket " -- $cur) ) + -W "-v --version -h --help generate-skeleton search-rr get-view-tree add-rr update-rr operate-rr batch-set-dns-resolve get-domains add-domain del-domain update-domain get-domain-query-count get-domain-query-traffic get-action-log add-user-view del-user-view get-user-view add-user-view-ip del-user-view-ip get-user-view-ip get-monitor add-monitor get-targets add-monitor-target operate-monitor update-monitor get-monitor-alarm-info " -- $cur) ) ;; - "redis") + "cdn") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-cache-instances create-cache-instance describe-cache-instance modify-cache-instance-attribute delete-cache-instance modify-cache-instance-class reset-cache-instance-password describe-instance-config modify-instance-config describe-analysis-time modify-analysis-time describe-cache-analysis-list create-cache-analysis describe-cache-analysis-result describe-backups create-backup describe-backup-policy modify-backup-policy restore-instance describe-download-url describe-cluster-info describe-ip-white-list modify-ip-white-list describe-slow-log describe-instance-class describe-user-quota describe-spec-config " -- $cur) ) + -W "-v --version -h --help generate-skeleton query-forbidden-info-list create-forbidden-info delete-forbidden-info query-un-forbidden-status create-live-domain-prefecth-task query-live-prefetch-task query-area-isp-list query-area-isp-list-v2 query-mix-statistics-data query-mix-statistics-with-area-data query-mix-traffic-group-sum query-statistics-data query-statistics-data-group-by-area query-statistics-data-group-sum query-live-statistics-data query-live-statistics-area-data-group-by query-live-traffic-group-sum query-statistics-top-ip query-statistics-top-url query-dir-bandwidth query-dir-stats-data query-customized-dir-band-width query-stream-info query-domain-temp-inst-list query-domain-temp-pro-keys modify-domain-temp-inst query-domain-temp-inst del-domain-temp-instance get-domain-list get-domain-list-by-filter get-domain-detail create-domain delete-domain start-domain stop-domain query-oss-buckets batch-create query-domain-config config-service-notice query-service-notice query-online-billing-type set-online-billing-type query-domain-config-status check-whether-ip-belong-to-jcloud query-service-ip get-all-upper-node-ip-list query-domain-group-list query-domain-group-detail query-domains-not-in-group update-domain-group create-domain-group batch-delete-domain-group query-waf-switch set-waf-switch query-waf-white-rule-switch set-waf-white-rule-switch querywaf-white-rules create-waf-white-rule update-waf-white-rule enable-waf-white-rules disable-waf-white-rules delete-waf-white-rules query-waf-black-rule-switch set-waf-black-rule-switch querywaf-black-rules create-waf-black-rule update-waf-black-rule enable-waf-black-rules disable-waf-black-rules delete-waf-black-rules query-ccprotect-switch set-ccprotect-switch query-ccprotect-rules create-ccprotect-rule update-ccprotect-rule enable-ccprotect-rule disable-ccprotect-rule delete-ccprotect-rule query-web-protect-switch set-web-protect-switch query-web-protect-settings update-web-protect-settings query-waf-regions query-ip-black-setting-status bat-create-prefetch-task update-prefetch-task query-prefetch-task stop-prefetch-task operate-purge-task query-purge-task query-net-protection-rules set-net-protection-rules query-net-protection-rules-switch set-net-protection-rules-switch query-geo-areas query-attack-type-count query-ddos-graph search-attack-log preview-certificate query-default-http-header-key query-ip-black-list set-ip-black-list operate-ip-black-list query-custom-error-page set-custom-error-page create-cache-rule update-cache-rule delete-cache-rule set-cache-rules query-http-header set-http-header delete-http-header set-video-draft set-range set-ignore-query-string set-filter-args query-filter-args query-user-agent set-user-agent-config query-accesskey-config set-accesskey-config set-refer query-monitor set-monitor stop-monitor set-source operate-share-cache set-http-type query-follow-redirect set-follow-redirect query-follow-source-protocol set-follow-source-protocol set-domain-config query-domain-all-config-classify execute-domain-copy query-extra-cache-time set-extra-cache-time delete-extra-cache-time batch-set-extra-cache-time set-gzip config-back-source-rule query-back-source-rule config-url-rule query-url-rule config-http2 query-http2 config-back-source-path query-back-source-path set-accelerate-region config-back-source-rules query-back-source-rules config-back-source-oss query-back-source-oss speed-limit query-band query-band-with-area query-cdn-user-quota query-refresh-task-by-ids set-refresh-limit query-refresh-limit query-refresh-task-by-id create-refresh-task-for-callback create-refresh-task-for-callback-v2 query-refresh-task create-refresh-task get-ssl-cert-list get-ssl-cert-detail upload-cert query-avg-bandwidth-for-pcdn query-device-status-for-pcdn query-jdbox-statistics-data query-jdbox-statistics-data-with-group query-jbox-avg-bandwidth query-domains-log query-domain-log waf-query-pv-for-area-and-ip waf-query-pv waf-query-attack-details set-auth-config set-source-auth-config set-live-domain-back-source set-live-domain-ip-black-list set-live-domain-refer operate-live-domain-ip-black-list set-live-domain-back-source-host set-live-domain-access-key set-protocol-convert delete-forbidden-stream query-push-domain-orapp-or-stream query-live-domain-ip-black-white-list batch-create-live-domain query-live-domain-detail query-live-domain-apps " -- $cur) ) ;; - "billing") + "streambus") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton query-bill-summary query-bill-detail calculate-total-price " -- $cur) ) + -W "-v --version -h --help generate-skeleton get-topic-list describe-topic add-topic update-topic delete-topic get-consumer-group-list create-consumer-group delete-consumer-group " -- $cur) ) ;; - "deploy") + "apigateway") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-apps describe-app create-deploy describe-deploy describe-groups describe-group " -- $cur) ) + -W "-v --version -h --help generate-skeleton query-user-domains create-user-domain delete-user-domain create-backend-config describe-backend-configs describe-backend-config update-backend-config delete-backend-config query-uc-access-keys query-keys create-key reset-key update-key query-key-info describe-api-groups create-api-group check-group-name-exist describe-api-group modify-api-group-attribute delete-api-group describe-is-deploy-api-groups query-rate-limit-policies create-rate-limit-policy check-policy-name query-rate-limit-policy update-rate-limit-policy delete-rate-limit-policy query-bind-group-policy bind-group-policy query-policy-group-list query-subscription-keys create-subscription-key query-subscription-key update-subscription-key delete-subscription-key query-access-keys create-access-key check-key-exist query-access-key update-access-key delete-access-key query-bind-group-key bind-group-key query-key-group-list check-pin query-apis create-apis check-api-name-exist query-api update-api delete-api update-api-by-name delete-api-by-name describe-deployments deploy describe-deployment offline batch-offline describe-revisions create-revision get-revision-ids check-revision-exist query-revision modify-revision delete-revision query-access-auths create-access-auth check-auth-exist query-access-auth update-access-auth delete-access-auth query-bind-group-auth bind-group-auth query-auth-group-list authorized-api-group-list " -- $cur) ) ;; - "sop") + "sts") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton get-security-token get-sensitive-op-setting " -- $cur) ) + -W "-v --version -h --help generate-skeleton assume-role " -- $cur) ) ;; - "function") + "nativecontainer") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton list-alias create-alias get-alias update-alias delete-alias list-function create-function get-function update-function delete-function invoke async-invoke get-trigger list-version create-version get-version delete-version " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-secrets create-secret describe-secret delete-secret describe-quota describe-containers create-containers describe-container delete-container start-container stop-container modify-container-attribute associate-elastic-ip disassociate-elastic-ip get-logs rebuild-container resize-container exec-create exec-get-exit-code resize-tty describe-instance-types " -- $cur) ) ;; - "portal") + "pod") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-product describe-products-by-id " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-secrets create-secret describe-secret delete-secret create-config-file describe-config-file delete-config-file update-config-file describe-quota describe-container attach exec-create exec-get-exit-code resize-tty describe-pods create-pods check-pod-name describe-pod delete-pod start-pod stop-pod modify-pod-attribute associate-elastic-ip disassociate-elastic-ip get-container-logs rebuild-pod resize-pod describe-instance-types " -- $cur) ) ;; - "jdccs") + "datastar") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-alarms describe-alarm describe-alarm-history describe-metrics describe-metric-data last-downsample describe-bandwidth-traffics describe-bandwidth-traffic describe-traffic-sampling describe-idcs describe-rooms describe-cabinets describe-cabinet describe-devices describe-device describe-ips describe-bandwidths describe-bandwidth describe-tickets describe-ticket " -- $cur) ) + -W "-v --version -h --help generate-skeleton get-large-screen-data " -- $cur) ) ;; - "logs") + "kms") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-collect-info update-collect-info describe-collect-resources update-collect-resources create-collect-info describe-logd-ca describe-instance-collect-confs describe-logsets create-logset describe-logset update-logset delete-logset describe-logtopics create-logtopic delete-logtopic describe-logtopic update-logtopic put search-log-context search " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-key-list create-key describe-key update-key-description enable-key disable-key schedule-key-deletion cancel-key-deletion key-rotation encrypt decrypt get-public-key sign validate generate-data-key describe-key-detail enable-key-version disable-key-version schedule-key-version-deletion cancel-key-version-deletion describe-secret-list create-secret describe-secret-version-list update-secret enable-secret disable-secret delete-secret create-secret-version describe-secret-version-info update-secret-version enable-secret-version disable-secret-version delete-secret-version " -- $cur) ) ;; - "clouddnsservice") + "elite") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton get-action-log get-domains add-domain del-domain update-domain get-domain-query-count get-domain-query-traffic search-rr get-view-tree add-rr update-rr operate-rr batch-set-dns-resolve add-user-view del-user-view get-user-view add-user-view-ip del-user-view-ip get-user-view-ip get-monitor add-monitor get-targets add-monitor-target operate-monitor update-monitor get-monitor-alarm-info " -- $cur) ) + -W "-v --version -h --help generate-skeleton jdx-query-delivery-info get-store-service jdx-query-product list-sale-service get-sale-service-by-deliver-number confirm-sale-service-delivery jdx-report-order jdx-create-order jdx-query-price " -- $cur) ) ;; - "cps") + "iam") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-elastic-ips apply-elastic-ips describe-elastic-ip modify-elastic-ip-bandwidth describe-device-types describe-os describe-device-raids describe-instance describe-instances create-instances describe-instance-name modify-instance describe-instance-raid describe-instance-status restart-instance stop-instance start-instance reinstall-instance modify-bandwidth associate-elastic-ip disassociate-elastic-ip reset-password describe-instance-monitor-info describe-keypairs create-keypairs import-keypairs describe-keypair delete-keypairs describe-listeners create-listener modify-listener describe-listener delete-listener start-listener stop-listener describe-load-balancers create-load-balancer modify-load-balancer describe-load-balancer start-load-balancer stop-load-balancer associate-elastic-ip-lb disassociate-elastic-ip-lb describe-regiones describe-cpslbregions describe-route-table describe-route-tables describe-servers add-servers modify-server remove-server describe-server-groups create-server-group describe-server-group modify-server-group delete-server-group describe-basic-subnet describe-subnets create-subnet describe-subnet modify-subnet delete-subnet describe-vpc modify-vpc delete-vpc describe-vpcs create-vpc " -- $cur) ) + -W "-v --version -h --help generate-skeleton create-sub-user describe-sub-user update-sub-user delete-sub-user describe-sub-users describe-sub-user-groups describe-attached-sub-user-policies detach-sub-user-policy attach-sub-user-policy create-permission describe-permission-detail update-permission describe-permissions describe-sub-user-permissions add-permissions-to-sub-user remove-permission-of-sub-user enable-sub-user-access-key disable-sub-user-access-key delete-sub-user-access-key create-policy describe-policy update-policy delete-policy update-policy-description describe-policies create-group describe-group update-group delete-group describe-group-sub-users describe-groups describe-attached-group-policies detach-group-policy attach-group-policy remove-sub-user-from-group add-sub-user-to-group create-role describe-role delete-role update-assume-role-policy describe-roles attach-role-policy detach-role-policy describe-role-policies describe-user-access-keys create-user-access-key enabled-user-access-key disabled-user-access-key delete-user-access-key " -- $cur) ) ;; - "cdn") + "iothub") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton query-domains-log query-domain-log query-online-billing-type set-online-billing-type query-band query-band-with-area query-domain-config-status query-area-isp-list preview-certificate query-default-http-header-key query-ip-black-list set-ip-black-list operate-ip-black-list create-cache-rule update-cache-rule delete-cache-rule query-http-header set-http-header delete-http-header set-video-draft set-range set-ignore-query-string query-user-agent set-user-agent-config query-accesskey-config set-accesskey-config set-refer query-monitor set-monitor stop-monitor set-source operate-share-cache set-http-type query-follow-redirect set-follow-redirect query-follow-source-protocol set-follow-source-protocol set-domain-config query-domain-all-config-classify execute-domain-copy query-domain-group-list query-domain-group-detail query-domains-not-in-group update-domain-group create-domain-group batch-delete-domain-group get-domain-list get-domain-list-by-filter get-domain-detail create-domain delete-domain start-domain stop-domain query-oss-buckets batch-create query-domain-config check-whether-ip-belong-to-jcloud set-live-domain-back-source set-live-domain-ip-black-list set-live-domain-refer operate-live-domain-ip-black-list set-live-domain-back-source-host set-live-domain-access-key set-protocol-convert delete-forbidden-stream query-push-domain-orapp-or-stream batch-create-live-domain query-live-domain-detail query-live-domain-apps create-live-domain-prefecth-task query-live-prefetch-task query-refresh-task-by-ids query-refresh-task-by-id create-refresh-task-for-callback create-refresh-task-for-callback-v2 query-refresh-task create-refresh-task query-net-protection-rules set-net-protection-rules query-net-protection-rules-switch set-net-protection-rules-switch query-geo-areas query-attack-type-count query-ddos-graph search-attack-log get-all-upper-node-ip-list get-ssl-cert-list get-ssl-cert-detail upload-cert query-mix-statistics-data query-mix-statistics-with-area-data query-mix-traffic-group-sum query-statistics-data query-statistics-data-group-by-area query-statistics-data-group-sum query-live-statistics-data query-live-statistics-area-data-group-by query-live-traffic-group-sum query-statistics-top-ip query-statistics-top-url query-dir-bandwidth query-waf-switch set-waf-switch query-waf-white-rule-switch set-waf-white-rule-switch querywaf-white-rules create-waf-white-rule update-waf-white-rule enable-waf-white-rules disable-waf-white-rules delete-waf-white-rules query-waf-black-rule-switch set-waf-black-rule-switch querywaf-black-rules create-waf-black-rule update-waf-black-rule enable-waf-black-rules disable-waf-black-rules delete-waf-black-rules query-ccprotect-switch set-ccprotect-switch query-ccprotect-rules create-ccprotect-rule update-ccprotect-rule enable-ccprotect-rule disable-ccprotect-rule delete-ccprotect-rule query-web-protect-switch set-web-protect-switch query-web-protect-settings update-web-protect-settings query-waf-regions query-ip-black-setting-status waf-query-pv-for-area-and-ip waf-query-pv waf-query-attack-details " -- $cur) ) + -W "-v --version -h --help generate-skeleton list-product-abilities import-thing-model export-thing-model describe-thing-shadow update-thing-shadow invoke-thing-service query-device-page update-device add-device query-device-detail remove-device remove-device-by-id list-products create-product describe-product update-product delete-product " -- $cur) ) ;; - "streambus") + "sms") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton get-topic-list describe-topic add-topic update-topic delete-topic get-consumer-group-list create-consumer-group delete-consumer-group " -- $cur) ) + -W "-v --version -h --help generate-skeleton batch-send status-report reply " -- $cur) ) ;; - "apigateway") + "resourcetag") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton query-access-auths create-access-auth check-auth-exist query-access-auth update-access-auth delete-access-auth query-bind-group-auth bind-group-auth query-auth-group-list authorized-api-group-list query-access-keys create-access-key check-key-exist query-access-key update-access-key delete-access-key query-bind-group-key bind-group-key query-key-group-list query-apis create-apis check-api-name-exist query-api update-api delete-api update-api-by-name delete-api-by-name describe-api-groups create-api-group check-group-name-exist describe-api-group modify-api-group-attribute delete-api-group describe-is-deploy-api-groups create-backend-config describe-backend-configs describe-backend-config update-backend-config delete-backend-config describe-deployments deploy describe-deployment offline batch-offline query-keys create-key reset-key update-key query-key-info query-rate-limit-policies create-rate-limit-policy check-policy-name query-rate-limit-policy update-rate-limit-policy delete-rate-limit-policy query-bind-group-policy bind-group-policy query-policy-group-list describe-revisions create-revision get-revision-ids check-revision-exist query-revision modify-revision delete-revision query-subscription-keys create-subscription-key query-subscription-key update-subscription-key delete-subscription-key query-uc-access-keys check-pin query-user-domains create-user-domain delete-user-domain " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-resources describe-tags describe-keys describe-values tag-resources un-tag-resources query-resource " -- $cur) ) ;; - "httpdns") + "jcq") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton get-account-id create-account get-account-info operate-key get-domains add-domains del-domains " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-access-point describe-topics create-topic describe-topic delete-topic describe-dead-letter-numbers describe-dead-letter-numbers-with-topic list-dead-letters delete-dead-letters resend-dead-letters describe-permission add-permission remove-permission describe-consumer-group-ids describe-subscriptions create-subscription describe-subscription modify-subscription-attribute delete-subscription clean-messages reset-consume-offset describe-messages describe-message describe-message-trace describe-messages-by-business-id " -- $cur) ) ;; - "disk") + "ias") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-disks create-disks describe-disk modify-disk-attribute delete-disk restore-disk extend-disk describe-snapshots create-snapshot delete-snapshots describe-snapshot modify-snapshot-attribute delete-snapshot " -- $cur) ) + -W "-v --version -h --help generate-skeleton apps app-detail state create-app get-app update-app delete-app get-apps " -- $cur) ) ;; - "sts") + "jdfusion") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton assume-role " -- $cur) ) + -W "-v --version -h --help generate-skeleton get-vpc-by-id delete-vpc-by-id get-vpcs create-vpc get-vm-instances-by-id delete-vm-instance-by-id get-vm-instances create-vm-instance stop-vm-instance-by-id start-vm-instance-by-id reboot-vm-instance-by-id get-vpc-vserver-groups create-vpc-vserver-group get-vserver-groups-by-id delete-vserver-group get-cloud-infos regist-cloud-info get-cloud-info-by-id unregist-cloud-info valid-cloud-info get-rds-databases-by-inst-id create-rds-database get-rds-database-by-inst-id-and-db-name delete-rds-database get-buckets create-bucket get-bucket-by-name delete-bucket get-bucket-files get-vpc-slb-by-id delete-vpc-slb-by-id get-vpc-slbs create-vpc-slb start-slb stop-slb delete-slbs-listener start-slb-listener stop-slb-listener get-rds-specification get-vm-instance-types get-vpc-network-interface-by-id delete-vpc-network-interface-by-id get-vpc-network-interfaces create-vpc-network-interface attach-vpc-network-interface-by-id detach-vpc-network-interface-by-id get-disks create-disk get-disk-by-id remove-disk-by-id attach-disk-to-vm-instance-by-disk-id detach-disk-to-vm-instance-by-disk-id get-rds-accounts-by-inst-id create-rds-accounts get-rds-accounts-by-inst-id-and-account-name delete-rds-account grant-rds-account revoke-rds-account grant-rds-accounts-by-task get-vpc-eips create-vpc-eip get-vpc-eip-by-id delete-vpc-eip-by-id associate-vpc-eip-by-id disassociate-vpc-eip-by-id get-task-info-history-by-id get-task-info-by-id get-transfer-tasks create-transfer-task get-transfer-task-by-id edit-transfer-task delete-transfer-task start-transfer-task stop-transfer-task get-transfer-task-progress get-transfer-task-failed-files get-vm-keypairs-by-name delete-vm-keypair-by-name get-vm-keypairs create-vm-keypair get-vpc-security-group-by-id delete-vpc-security-group-by-id get-vpc-security-groups create-vpc-security-group create-security-groups-rule delete-security-groups-rule get-lb-http-listener create-vpc-lbhttp-listener get-vm-images get-vpc-subnet-by-id delete-vpc-subnet-by-id get-vpc-subnets create-vpc-subnet get-rds-instances create-rds-instance get-rds-by-inst-id delete-rds-by-inst-id get-deployments create-deployment reverse-deployment get-deployments-by-id edit-deployment delete-deployment clone-deployment dryrun-deployment apply-deployment get-deployment-result get-deployment-versions get-deployments-version rollback-deployments-version get-deployments-results-by-id-record get-regions get-regions-available-zones get-channels create-channel delete-channel start-channel stop-channel get-datasources create-datasource delete-datasource " -- $cur) ) ;; - "nc") + "detection") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-containers create-containers describe-container delete-container start-container stop-container modify-container-attribute associate-elastic-ip disassociate-elastic-ip get-logs describe-quota describe-secrets create-secret describe-secret delete-secret " -- $cur) ) + -W "-v --version -h --help generate-skeleton get-site-monitor create-site-monitor update-site-monitor delete-site-monitor enable-site-monitor validate-site-monitor-address get-site-monitor-data-points get-site-monitor-source test-site-monitor describe-agent-status describe-metric-data-am create-probe-task delete-probe-task describe-probe-task update-probe-task describe-probe-history discribe-probes probe-task-enable describe-probe-tasks " -- $cur) ) ;; - "vm") + "iotlink") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-image delete-image describe-images describe-image-constraints describe-image-constraints-batch share-image un-share-image release-image un-release-image describe-image-members copy-images modify-image-attribute import-image export-image image-tasks describe-instances create-instances describe-brief-instances describe-instance delete-instance describe-instance-status describe-instance-private-ip-address stop-instance start-instance reboot-instance attach-network-interface detach-network-interface modify-instance-network-attribute associate-elastic-ip disassociate-elastic-ip create-image attach-disk detach-disk modify-instance-disk-attribute modify-instance-attribute modify-instance-password describe-instance-vnc-url resize-instance rebuild-instance describe-instance-templates create-instance-template describe-instance-template update-instance-template delete-instance-template verify-instance-template describe-instance-types describe-keypairs create-keypair import-keypair delete-keypair describe-quotas " -- $cur) ) + -W "-v --version -h --help generate-skeleton card-info real-name-query-iot gprs-status-by-imsi on-off-status-by-imsi life-status-by-imsi gprs-realtime-info-by-imsi gprs-status on-off-status life-status gprs-realtime-info open-iot-card close-iot-card open-iot-flow close-iot-flow search operate " -- $cur) ) ;; - "nativecontainer") + "renewal") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-containers create-containers describe-container delete-container start-container stop-container modify-container-attribute associate-elastic-ip disassociate-elastic-ip get-logs rebuild-container resize-container exec-create exec-get-exit-code resize-tty describe-instance-types describe-quota describe-secrets create-secret describe-secret delete-secret " -- $cur) ) + -W "-v --version -h --help generate-skeleton set-renewal query-instance renew-instance " -- $cur) ) ;; - "iotcore") + "yunding") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton device-query thing-type-list thing-type-describe describe-thing-model device-register download-certificate delete-device device-property-set invoke-function event-list function-list invoke-thing-topic describe-thing-shadow update-thing-shadow invoke-thing-service add-device-links query-device-page update-device add-device query-device-detail remove-device elevator-operating-status collector-read-message read-holding-registers collector-write-message update-loo-device add-loo-device loongray-query-page remove-loongray-device describe-product-with-admin update-product-with-admin delete-product-with-admin list-products-with-admin create-admin-product list-products create-product describe-product update-product delete-product list-product-abilities import-thing-model export-thing-model describe-product-topics create-product-topic describe-product-topic " -- $cur) ) + -W "-v --version -h --help generate-skeleton put-product-metric-data put-product-metric-data describe-subnets create-subnet describe-subnet delete-subnet assign-secondary-ips unassign-secondary-ips describe-network-interface delete-network-interface describe-network-interfaces create-network-interface describe-tasks describe-rds-instances describe-rds-instance describe-instance-info describe-rds-white-list modify-rds-white-list describe-rds-accounts create-rds-account delete-rds-account grant-rds-privilege revoke-privilege describe-rds-databases create-rds-database delete-rds-database describe-yd-rds-instances " -- $cur) ) ;; - "pod") + "containerregistry") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-container attach exec-create exec-get-exit-code resize-tty describe-instance-types describe-pods create-pods check-pod-name describe-pod delete-pod start-pod stop-pod modify-pod-attribute associate-elastic-ip disassociate-elastic-ip get-container-logs rebuild-pod resize-pod describe-quota describe-secrets create-secret describe-secret delete-secret " -- $cur) ) + -W "-v --version -h --help generate-skeleton create-repository describe-repositories delete-repository check-repository-name describe-images delete-image describe-registries create-registry describe-registry delete-registry check-registry-name describe-quotas get-authorization-token describe-authorization-tokens release-authorization-token " -- $cur) ) ;; - "ams") + "partner") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-streams-input describe-authenticate " -- $cur) ) + -W "-v --version -h --help generate-skeleton query-my-customer-list get-total-consumption get-each-consumption describe-customer-bill-by-product " -- $cur) ) ;; - "jdro") + "lb") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-resource-type-list describe-resource-type-specification describe-stacks create-stack describe-stack delete-stack create-change-set execute-change-set describe-stack-events describe-stack-resources describe-stack-template validate-template " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-url-maps create-url-map describe-url-map update-url-map delete-url-map add-rules update-rules delete-rules describe-target-groups create-target-group describe-target-group update-target-group delete-target-group register-targets de-register-targets update-targets describe-targets describe-backends create-backend describe-backend update-backend delete-backend describe-target-health describe-load-balancers create-load-balancer describe-load-balancer update-load-balancer delete-load-balancer associate-elastic-ip disassociate-elastic-ip associate-security-group disassociate-security-group describe-listeners create-listener describe-listener update-listener delete-listener add-listener-certificates update-listener-certificates delete-listener-certificates " -- $cur) ) ;; - "zfs") + "industrydata") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-file-systems create-file-system describe-file-system modify-file-system-attribute delete-file-system describe-mount-targets create-mount-target describe-mount-target delete-mount-target " -- $cur) ) + -W "-v --version -h --help generate-skeleton get-large-screen-data " -- $cur) ) ;; - "vod") + "rds") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton list-categories create-category get-category-with-children get-category update-category delete-category list-domains create-domain get-domain delete-domain enable-domain disable-domain set-default-domain set-header list-headers delete-header set-referer-rule get-referer-rule set-urlrule get-urlrule set-iprule get-iprule set-http-ssl get-http-ssl create-live-to-vod-task create-video-upload-task refresh-video-upload-task create-image-upload-task submit-quality-detection-job batch-submit-quality-detection-jobs list-quality-detection-templates create-quality-detection-template get-quality-detection-template update-quality-detection-template delete-quality-detection-template submit-transcode-job batch-submit-transcode-jobs list-transcode-templates create-transcode-template get-transcode-template update-transcode-template delete-transcode-template list-videos get-video update-video delete-video batch-delete-videos batch-update-videos get-video-play-info delete-video-streams video-audit list-watermarks create-watermark get-watermark update-watermark delete-watermark " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-binlogs describe-binlog-download-url clear-binlogs describe-accounts create-account describe-account-privilege delete-account grant-privilege revoke-privilege reset-password create-super-account grant-account-privilege describe-accounts-for-ops create-account-for-ops modify-account-for-ops describe-instances create-instance describe-instance-attributes delete-instance describe-backup-policy modify-backup-policy enable-enhanced-backup describe-backup-space describe-backup-charge modify-instance-name failover-instance reboot-instance enable-internet-access disable-internet-access restore-instance create-instance-from-backup modify-instance-spec create-instance-by-time create-roinstance modify-connection-mode describe-latest-restore-time modify-parameter-group exchange-instance-dns modify-instance-az describe-ssl enable-ssl disable-ssl restore-instance-by-time modify-active-directory modify-instance-maintain-time describe-instance-maintain-time switch-for-modifying-instance-spec describe-upgrade-versions describe-upgrade-plan upgrade-engine-version describe-import-files get-upload-key set-import-file-shared delete-import-file describe-logs update-log-download-urlinternal describe-log-download-url describe-databases create-database delete-database restore-database-from-backup restore-database-from-file restore-database-from-oss modify-database-comment enable-intercept disable-intercept describe-intercept-result describe-intercept describe-read-write-proxies create-read-write-proxy describe-read-write-proxy-attribute delete-read-write-proxy enable-read-write-proxy-internet-access disable-read-write-proxy-internet-access modify-read-write-proxy delete-parameter-group modify-parameter-group-attribute describe-parameter-groups create-parameter-group describe-parameter-group-parameters modify-parameter-group-parameters describe-parameter-modify-records copy-parameter-group describe-parameter-group-attached-instances describe-backups create-backup delete-backup describe-backup-download-url describe-tables describe-tde enable-tde describe-white-list modify-white-list describe-audit create-audit delete-audit describe-audit-options modify-audit describe-audit-files describe-audit-download-url enable-audit disable-audit describe-audit-result describe-azs alter-table-with-online-ddl describe-parameters modify-parameters describe-backup-synchronicities create-backup-synchronicity delete-backup-synchronicity create-instance-by-time-in-cross-region describe-error-logs describe-privilege describe-index-performance describe-query-performance describe-slow-log-attributes describe-slow-logs describe-active-query-performance describe-error-log " -- $cur) ) ;; - "yundingdatapush") + "kubernetes") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-datapush-venders add-datapush-vender delete-datapush-vender describe-rds-instances create-order-sync " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-node-groups create-node-group describe-node-group modify-node-group delete-node-group set-node-group-size set-auto-repair rollback-node-group-upgrade set-node-group-ca delete-node-instances describe-server-config describe-versions describe-node-version describe-upgradable-master-versions describe-upgradable-node-versions describe-quotas describe-clusters create-cluster describe-cluster modify-cluster delete-cluster set-user-metrics abort-upgrade describe-progress set-auto-upgrade upgrade-cluster set-addons " -- $cur) ) ;; - "datastar") + "ipanti") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton get-large-screen-data " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-forward-rules create-forward-rule create-forward-rules describe-forward-rule modify-forward-rule delete-forward-rule switch-forward-rule-protect switch-forward-rule-origin describe-protection-rule-of-forward-rule modify-protection-rule-of-forward-rule describe-geo-areas describe-black-list-rule-of-forward-rule modify-black-list-rule-of-forward-rule enable-black-list-rule-of-forward-rule disable-black-list-rule-of-forward-rule describe-white-list-rule-of-forward-rule modify-white-list-rule-of-forward-rule enable-white-list-rule-of-forward-rule disable-white-list-rule-of-forward-rule describe-ddo-sgraph describe-fwd-graph describe-business-graph describe-ccgraph describe-status-graph describe-conn-stat-graph describe-ddo-sattack-logs describe-ddo-sip-attack-logs describe-ccattack-logs describe-ccattack-log-details describe-attack-statistics describe-attack-type-count describe-dispatch-rules create-dispatch-rule create-dispatch-rules modify-dispatch-rule delete-dispatch-rule switch-dispatch-rule-protect switch-dispatch-rule-origin describe-instance-acl modify-instance-acl recover-instance-acl describe-custom-pages create-custom-page modify-custom-page delete-custom-page modify-instance-custom-page modify-instance-custom-page-default enable-instance-custom-page disable-instance-custom-page describe-instances create-instance describe-instance modify-instance-name modify-epb describe-alarm-config modify-alarm-config describe-origin-white-ip-list describe-service-ip-list describe-instance-id-by-resource-id describe-name-list describe-protection-statistics describe-protection-outline check-name describe-vpc-ip-list describe-cps-ip-list describe-ccs-ip-list describe-ip-sets create-ip-set describe-ip-set delete-ip-set describe-ip-set-usage describe-web-rules create-web-rule create-web-rules describe-web-rule modify-web-rule delete-web-rule bind-cert switch-web-rule-protect switch-web-rule-origin enable-web-rule-cc disable-web-rule-cc enable-web-rule-ccobserver-mode disable-web-rule-ccobserver-mode describe-js-pages-of-web-rule create-js-page-of-web-rule create-js-pages-of-web-rule modify-js-page-of-web-rule delete-js-page-of-web-rule disable-web-rule-js-page enable-web-rule-js-page modify-web-rule-js-page-to-all modify-web-rule-js-page-to-custom describe-ccprotection-rules-of-web-rule create-ccprotection-rule-of-web-rule describe-ccprotection-rule-of-web-rule modify-ccprotection-rule-of-web-rule delete-ccprotection-rule-of-web-rule enable-ccprotection-rule-of-web-rule disable-ccprotection-rule-of-web-rule enable-web-rule-ccprotection-rule disable-web-rule-ccprotection-rule describe-ccprotection-config-of-web-rule modify-ccprotection-config-of-web-rule describe-ccprotection-default-config-of-web-rule modify-cert-info describe-web-rule-black-list-usage describe-black-list-rules-of-web-rule create-black-list-rule-of-web-rule describe-black-list-rule-of-web-rule modify-black-list-rule-of-web-rule delete-black-list-rule-of-web-rule enable-web-rule-black-list enable-black-list-rule-of-web-rule disable-web-rule-black-list disable-black-list-rule-of-web-rule describe-web-rule-white-list-usage describe-white-list-rules-of-web-rule create-white-list-rule-of-web-rule describe-white-list-rule-of-web-rule modify-white-list-rule-of-web-rule delete-white-list-rule-of-web-rule enable-web-rule-white-list enable-white-list-rule-of-web-rule disable-web-rule-white-list disable-white-list-rule-of-web-rule describe-web-rule-black-list-geo-areas describe-web-rule-white-list-geo-areas describe-web-rule-rsgeo-areas " -- $cur) ) ;; - "kms") + "jmr") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-key-list create-key describe-key update-key-description enable-key disable-key schedule-key-deletion cancel-key-deletion key-rotation encrypt decrypt get-public-key sign validate generate-data-key describe-key-detail enable-key-version disable-key-version schedule-key-version-deletion cancel-key-version-deletion describe-secret-list create-secret import-secret describe-secret-version-list update-secret enable-secret disable-secret delete-secret create-secret-version export-secret describe-secret-version-info update-secret-version enable-secret-version disable-secret-version delete-secret-version " -- $cur) ) + -W "-v --version -h --help generate-skeleton idata-cluster get-software-info get-jmr-version-list monitor-label-list describe-cluster describe-clusters release-cluster cluster-expansion cluster-reduction create-cluster " -- $cur) ) ;; - "elite") + "deploy") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton jdx-query-delivery-info jdx-report-order jdx-create-order jdx-query-price jdx-query-product list-sale-service get-sale-service-by-deliver-number confirm-sale-service-delivery get-store-service " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-apps describe-app describe-groups describe-group create-deploy describe-deploy " -- $cur) ) ;; - "ossopenapi") + "sop") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton get-single-bucket-capacity get-back-source-configuration put-back-source-configuration delete-back-source-configuration " -- $cur) ) + -W "-v --version -h --help generate-skeleton get-sensitive-op-setting get-security-token " -- $cur) ) ;; - "iam") + "function") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton enable-sub-user-access-key disable-sub-user-access-key delete-sub-user-access-key create-group describe-group update-group delete-group describe-group-sub-users describe-groups describe-attached-group-policies detach-group-policy attach-group-policy remove-sub-user-from-group add-sub-user-to-group create-permission describe-permission-detail update-permission describe-permissions describe-sub-user-permissions add-permissions-to-sub-user remove-permission-of-sub-user create-policy describe-policy update-policy delete-policy update-policy-description describe-policies create-role describe-role delete-role update-assume-role-policy describe-roles attach-role-policy detach-role-policy describe-role-policies create-sub-user describe-sub-user update-sub-user delete-sub-user describe-sub-users describe-sub-user-groups describe-attached-sub-user-policies detach-sub-user-policy attach-sub-user-policy describe-user-access-keys create-user-access-key enabled-user-access-key disabled-user-access-key delete-user-access-key " -- $cur) ) + -W "-v --version -h --help generate-skeleton list-function create-function get-function update-function delete-function invoke async-invoke list-version create-version get-version delete-version list-alias create-alias get-alias update-alias delete-alias get-trigger " -- $cur) ) ;; - "iothub") + "jdccs") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-thing-shadow update-thing-shadow invoke-thing-service query-device-page update-device add-device query-device-detail remove-device remove-device-by-id list-products create-product describe-product update-product delete-product list-product-abilities import-thing-model export-thing-model " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-metrics describe-metric-data last-downsample describe-bandwidth-traffics describe-bandwidth-traffic describe-traffic-sampling describe-open-devices describe-open-devices-data describe-rangetime-cabinet-current describe-realtime-cabinet-current describe-alarms create-alarm describe-alarm update-alarm delete-alarm describe-alarm-history switch-alarm describe-tickets describe-ticket create-general-services-ticket describe-idcs describe-rooms describe-cabinets describe-cabinet describe-devices describe-device describe-ips describe-bandwidths describe-bandwidth describe-idc-overview " -- $cur) ) ;; - "sms") + "logs") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton batch-send status-report reply " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-collect-info update-collect-info describe-collect-resources update-collect-resources create-collect-info create-parser describe-parser update-parser validate-parser histograms get-logs search describe-logtopics create-logtopic delete-logtopic describe-logtopic update-logtopic test-metric-task describe-metric-tasks create-metric-task describe-metric-task update-metric-task delete-metric-task create-parser describe-subscribe create-subscribe update-subscribe describe-logsets create-logset describe-logset update-logset delete-logset " -- $cur) ) ;; - "jcq") + "cps") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-access-point describe-consumer-group-ids describe-dead-letter-numbers describe-dead-letter-numbers-with-topic list-dead-letters delete-dead-letters resend-dead-letters describe-messages describe-message describe-message-trace describe-messages-by-business-id describe-permission add-permission remove-permission describe-subscriptions create-subscription describe-subscription modify-subscription-attribute delete-subscription clean-messages reset-consume-offset describe-topics create-topic describe-topic delete-topic " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-ipv6address describe-ipv6addresses assign-ipv6addresses-bandwidth modify-ipv6address-bandwidth describe-certs create-cert describe-cert remove-cert modify-cert describe-alias-ips create-alias-ip delete-alias-ip describe-secondary-cidrs create-secondary-cidr delete-secondary-cidr describe-elastic-ips apply-elastic-ips describe-elastic-ip modify-elastic-ip-bandwidth describe-elastic-ip-name describe-server-groups create-server-group describe-server-group modify-server-group delete-server-group describe-keypairs create-keypairs import-keypairs describe-keypair delete-keypairs describe-load-balancers create-load-balancer modify-load-balancer describe-load-balancer start-load-balancer stop-load-balancer associate-elastic-ip-lb disassociate-elastic-ip-lb describe-slbs-name describe-servers add-servers modify-server remove-server describe-ipv6gateways describe-ipv6gateway modify-ipv6gateway describe-basic-subnet describe-subnets create-subnet assign-ipv6cidr describe-subnet modify-subnet delete-subnet describe-vpc modify-vpc delete-vpc describe-vpcs create-vpc assign-ipv6gateway describe-listeners create-listener modify-listener describe-listener delete-listener start-listener stop-listener describe-device-types describe-os describe-device-raids describe-instance describe-instances create-instances describe-instance-name assign-ipv6address modify-instance describe-instance-raid describe-instance-status restart-instance stop-instance start-instance restart-instances stop-instances start-instances reinstall-instance modify-bandwidth associate-elastic-ip disassociate-elastic-ip reset-password describe-available-private-ip describe-instance-monitor-info describe-event-logs describe-route-table describe-route-tables describe-regiones describe-cpslbregions " -- $cur) ) ;; - "resourcetag") + "httpdns") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-resources describe-tags tag-resources un-tag-resources query-resource " -- $cur) ) + -W "-v --version -h --help generate-skeleton get-account-id create-account get-account-info operate-key get-domains add-domains del-domains " -- $cur) ) ;; - "baseanti") + "disk") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-attack-logs describe-attack-statistics describe-attack-type-count describe-ip-monitor-flow describe-ip-resources describe-elastic-ip-resources describe-cps-ip-resources describe-ccs-ip-resources describe-ip-resource-info describe-ip-safety-info set-clean-threshold set-ip-clean-threshold describe-ip-clean-threshold-range describe-ip-resource-protect-info describe-ip-resource-flow " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-disks create-disks describe-disk modify-disk-attribute delete-disk restore-disk extend-disk describe-volumes-ignore-service-code describe-quota describe-snapshots create-snapshot delete-snapshots describe-snapshot modify-snapshot-attribute delete-snapshot describe-snapshots-capacity describe-snapshot-chain describe-soldout create-snapshot-policy update-snapshot-policy delete-snapshot-policy describe-snapshot-policies describe-snap-polices apply-snapshot-policies describe-snapshot-policy-disk-relations " -- $cur) ) ;; - "ias") + "nc") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton apps app-detail state create-app get-app update-app delete-app get-apps " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-secrets create-secret describe-secret delete-secret describe-quota describe-containers create-containers describe-container delete-container start-container stop-container modify-container-attribute associate-elastic-ip disassociate-elastic-ip get-logs " -- $cur) ) ;; - "mongodb") + "vm") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-instances create-instance delete-instance reset-password modify-instance-spec modify-instance-name describe-backup-policy modify-backup-policy restore-instance describe-flavors describe-available-zones restart-instance create-sharding-instance modify-node-spec restart-node describe-backups create-backup delete-backup backup-download-url describe-backup-synchronicities create-backup-synchronicity delete-backup-synchronicities describe-security-ips modify-security-ips " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-instance-templates create-instance-template describe-instance-template update-instance-template delete-instance-template verify-instance-template describe-instance-templates-customdata describe-keypairs create-keypair import-keypair delete-keypair attach-keypair detach-keypair describe-image delete-image describe-images describe-image-constraints describe-image-constraints-batch share-image un-share-image release-image un-release-image describe-image-members copy-images modify-image-attribute import-image export-image image-tasks describe-quotas describe-instances create-instances describe-brief-instances describe-instance delete-instance describe-instance-status describe-instance-private-ip-address stop-instance start-instance reboot-instance attach-network-interface detach-network-interface modify-instance-network-attribute associate-elastic-ip disassociate-elastic-ip create-image attach-disk detach-disk modify-instance-disk-attribute modify-instance-attribute modify-instance-vpc-attribute modify-instance-password describe-instance-vnc-url resize-instance rebuild-instance describe-instances-custom-data modify-instance-placement describe-instance-types " -- $cur) ) ;; - "jdfusion") + "iotcore") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton get-cloud-infos regist-cloud-info get-cloud-info-by-id unregist-cloud-info valid-cloud-info get-deployments create-deployment reverse-deployment get-deployments-by-id edit-deployment delete-deployment clone-deployment dryrun-deployment apply-deployment get-deployment-result get-deployment-versions get-deployments-version rollback-deployments-version get-deployments-results-by-id-record get-disks create-disk get-disk-by-id remove-disk-by-id attach-disk-to-vm-instance-by-disk-id detach-disk-to-vm-instance-by-disk-id get-buckets create-bucket get-bucket-by-name delete-bucket get-bucket-files get-transfer-tasks create-transfer-task get-transfer-task-by-id edit-transfer-task delete-transfer-task start-transfer-task stop-transfer-task get-transfer-task-progress get-transfer-task-failed-files get-rds-accounts-by-inst-id create-rds-accounts get-rds-accounts-by-inst-id-and-account-name delete-rds-account grant-rds-account revoke-rds-account grant-rds-accounts-by-task get-rds-databases-by-inst-id create-rds-database get-rds-database-by-inst-id-and-db-name delete-rds-database get-rds-instances create-rds-instance get-rds-by-inst-id delete-rds-by-inst-id get-channels create-channel delete-channel start-channel stop-channel get-datasources create-datasource delete-datasource get-rds-specification get-regions get-regions-available-zones get-task-info-history-by-id get-task-info-by-id get-vm-images get-vm-instances-by-id delete-vm-instance-by-id get-vm-instances create-vm-instance stop-vm-instance-by-id start-vm-instance-by-id reboot-vm-instance-by-id get-vm-instance-types get-vm-keypairs-by-name delete-vm-keypair-by-name get-vm-keypairs create-vm-keypair get-vpc-eips create-vpc-eip get-vpc-eip-by-id delete-vpc-eip-by-id associate-vpc-eip-by-id disassociate-vpc-eip-by-id get-lb-http-listener create-vpc-lbhttp-listener get-vpc-network-interface-by-id delete-vpc-network-interface-by-id get-vpc-network-interfaces create-vpc-network-interface attach-vpc-network-interface-by-id detach-vpc-network-interface-by-id get-vpc-security-group-by-id delete-vpc-security-group-by-id get-vpc-security-groups create-vpc-security-group create-security-groups-rule delete-security-groups-rule get-vpc-slb-by-id delete-vpc-slb-by-id get-vpc-slbs create-vpc-slb start-slb stop-slb delete-slbs-listener start-slb-listener stop-slb-listener get-vpc-subnet-by-id delete-vpc-subnet-by-id get-vpc-subnets create-vpc-subnet get-vpc-by-id delete-vpc-by-id get-vpcs create-vpc get-vpc-vserver-groups create-vpc-vserver-group get-vserver-groups-by-id delete-vserver-group " -- $cur) ) + -W "-v --version -h --help generate-skeleton list-product-abilities import-thing-model export-thing-model invoke-thing-topic describe-thing-shadow update-thing-shadow invoke-thing-service add-device-links query-device-page update-device add-device query-device-detail remove-device list-products create-product describe-product update-product delete-product update-loo-device add-loo-device loongray-query-page query-admin-statistics remove-loongray-device register-device download-device-certificate delete-device describe-device describe-thing-type-list describe-thing-type describe-thing-model set-device-property invoke-function describe-event-list describe-function-list describe-property describe-property-snapshot create-device-topo describe-device-topo update-device-topo delete-device-topo describe-product-with-admin update-product-with-admin delete-product-with-admin list-products-with-admin create-admin-product describe-product-topics create-product-topic describe-product-topic get-device-group get-device-group-list find-device-group-link-page elevator-operating-status collector-read-message read-holding-registers collector-write-message " -- $cur) ) ;; - "live") + "zfs") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-live-app add-live-app stop-live-app describe-live-play-auth-key set-live-play-auth-key describe-live-restart-auth-key set-live-restart-auth-key describe-live-bill-data describe-live-domain-certificate set-live-domain-certificate describe-live-restart-domain-certificate set-live-restart-domain-certificate describe-live-domains add-live-domain start-live-domain stop-live-domain describe-live-domain-detail delete-live-domain add-live-restart-domain add-custom-live-stream-quality-detection-template describe-custom-live-stream-quality-detection-templates add-live-stream-app-quality-detection add-live-stream-domain-quality-detection set-live-stream-quality-detection-notify-config delete-custom-live-stream-quality-detection-template delete-live-stream-app-quality-detection delete-live-stream-domain-quality-detection describe-live-stream-quality-detection-notify-config delete-live-stream-quality-detection-notify-config describe-quality-detection-binding open-live-p2p close-live-p2p describe-live-p2p-configs describe-custom-live-stream-record-templates add-custom-live-stream-record-template add-live-stream-app-record add-live-stream-domain-record describe-custom-live-stream-record-config set-live-stream-record-notify-config delete-custom-live-stream-record-template delete-live-stream-app-record delete-live-stream-domain-record describe-live-stream-record-notify-config delete-live-stream-record-notify-config add-live-record-task describe-record-binding describe-live-statistic-group-by-stream describe-live-statistic-group-by-area describe-live-statistic-group-by-area-isp describe-publish-stream-info-data describe-live-stream-history-user-num describe-live-publish-stream-num describe-live-stream-player-ranking-data describe-live-transcode-stream-list describe-live-transcode-stream-num describe-live-transcode-stream-player-user-num describe-live-transcode-stream-bandwidth describe-domain-online-stream describe-domains-log describe-url-ranking describe-live-transcoding-duration-data describe-live-file-storage-data describe-live-stream-bandwidth-data describe-live-stream-publish-bandwidth-data describe-live-stream-traffic-data describe-live-stream-publish-traffic-data describe-live-snapshot-data describe-live-porn-data add-custom-live-stream-snapshot-template describe-custom-live-stream-snapshot-config describe-custom-live-stream-snapshot-templates add-live-stream-app-snapshot add-live-stream-domain-snapshot set-live-stream-snapshot-notify-config delete-custom-live-stream-snapshot-template delete-live-stream-app-snapshot delete-live-stream-domain-snapshot describe-live-stream-snapshot-notify-config delete-live-stream-snapshot-notify-config describe-snapshot-binding forbid-live-stream resume-live-stream interrupt-live-stream describe-live-stream-info set-live-stream-notify-config describe-live-stream-notify-config delete-live-stream-notify-config describe-live-stream-online-list describe-live-stream-publish-list open-live-restart close-live-restart describe-live-restart-configs open-live-timeshift close-live-timeshift describe-live-timeshift-configs add-live-stream-domain-transcode add-live-stream-app-transcode add-custom-live-stream-transcode-template describe-custom-live-stream-transcode-templates describe-system-live-stream-transcode-templates describe-live-stream-transcode-config delete-live-stream-domain-transcode delete-live-stream-app-transcode describe-custom-live-stream-transcode-template delete-custom-live-stream-transcode-template describe-transcode-binding add-custom-live-stream-watermark-template describe-custom-live-stream-watermark-templates add-live-stream-app-watermark add-live-stream-domain-watermark describe-custom-live-stream-watermark-config delete-custom-live-stream-watermark-template delete-live-stream-app-watermark delete-live-stream-domain-watermark describe-watermark-binding " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-mount-targets create-mount-target describe-mount-target delete-mount-target describe-file-systems create-file-system describe-file-system modify-file-system-attribute delete-file-system " -- $cur) ) ;; - "detection") + "ams") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-agent-status describe-metric-data-am create-probe-task delete-probe-task describe-probe-task update-probe-task describe-probe-history discribe-probes probe-task-enable describe-probe-tasks get-site-monitor create-site-monitor update-site-monitor delete-site-monitor enable-site-monitor validate-site-monitor-address get-site-monitor-data-points get-site-monitor-source test-site-monitor " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-streams-input describe-authenticate " -- $cur) ) ;; - "iotlink") + "jdro") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton gprs-status on-off-status life-status gprs-realtime-info open-iot-card close-iot-card open-iot-flow close-iot-flow search operate " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-resource-type-list describe-resource-type-specification describe-stacks create-stack describe-stack delete-stack create-change-set execute-change-set describe-stack-events describe-stack-resources describe-stack-template validate-template " -- $cur) ) ;; - "renewal") + "vod") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton set-renewal query-instance renew-instance " -- $cur) ) + -W "-v --version -h --help generate-skeleton list-transcode-template-groups create-transcode-template-group get-transcode-template-group update-transcode-template-group delete-transcode-template-group delete-grouped-transcode-templates list-quality-detection-templates create-quality-detection-template get-quality-detection-template update-quality-detection-template delete-quality-detection-template create-video-upload-task refresh-video-upload-task create-image-upload-task create-live-to-vod-task list-videos get-video update-video delete-video batch-delete-videos batch-update-videos get-video-play-info delete-video-streams video-audit get-video-source-info submit-quality-detection-job batch-submit-quality-detection-jobs create-vedit-job submit-vedit-job list-vedit-projects create-vedit-project get-vedit-project update-vedit-project delete-vedit-project list-domains create-domain get-domain delete-domain enable-domain disable-domain set-default-domain set-header list-headers delete-header set-referer-rule get-referer-rule set-urlrule get-urlrule set-iprule get-iprule set-http-ssl get-http-ssl list-categories create-category list-all-categories get-category-with-children get-category update-category delete-category submit-snapshot-task list-snapshot-tasks list-transcode-templates create-transcode-template get-transcode-template update-transcode-template delete-transcode-template list-snapshot-templates create-snapshot-template get-snapshot-template update-snapshot-template delete-snapshot-template submit-transcode-job batch-submit-transcode-jobs get-transcode-summaries get-transcode-job-summaries get-transcode-task-summaries list-watermarks create-watermark get-watermark update-watermark delete-watermark submit-transcode-job batch-submit-transcode-jobs " -- $cur) ) ;; - "yunding") + "yundingdatapush") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton assign-secondary-ips unassign-secondary-ips describe-rds-instances describe-rds-instance describe-instance-info describe-rds-white-list modify-rds-white-list describe-rds-accounts create-rds-account delete-rds-account grant-rds-privilege describe-rds-databases create-rds-database delete-rds-database describe-yd-rds-instances " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-datapush-venders add-datapush-vender delete-datapush-vender describe-rds-instances create-order-sync " -- $cur) ) ;; - "vpc") + "ossopenapi") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-elastic-ips create-elastic-ips describe-elastic-ip modify-elastic-ip delete-elastic-ip describe-network-acls create-network-acl describe-network-acl modify-network-acl delete-network-acl associate-network-acl disassociate-network-acl add-network-acl-rules remove-network-acl-rules modify-network-acl-rules describe-network-interfaces create-network-interface describe-network-interface modify-network-interface delete-network-interface associate-elastic-ip disassociate-elastic-ip assign-secondary-ips unassign-secondary-ips describe-network-security-groups create-network-security-group describe-network-security-group modify-network-security-group delete-network-security-group add-network-security-group-rules remove-network-security-group-rules modify-network-security-group-rules describe-quota describe-route-tables create-route-table describe-route-table modify-route-table delete-route-table add-route-table-rules remove-route-table-rules modify-route-table-rules associate-route-table disassociate-route-table describe-edge-ip-providers describe-subnets create-subnet describe-subnet modify-subnet delete-subnet describe-vpcs create-vpc describe-vpc modify-vpc delete-vpc describe-vpc-peerings create-vpc-peering describe-vpc-peering modify-vpc-peering delete-vpc-peering " -- $cur) ) + -W "-v --version -h --help generate-skeleton get-single-bucket-capacity get-back-source-configuration put-back-source-configuration delete-back-source-configuration get-historical-replicat-task abort-historical-replicat-task list-historical-replicat-tasks create-historical-replicat-task " -- $cur) ) ;; - "monitor") + "baseanti") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-alarms create-alarm describe-alarm update-alarm delete-alarms describe-alarm-contacts describe-metrics-for-alarm describe-products-for-alarm enable-alarms describe-alarm-history describe-metrics describe-one-data-point describe-metric-data describe-services put-custom-metric-data put-custom-metric-data " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-ip-resources describe-elastic-ip-resources describe-cps-ip-resources describe-ccs-ip-resources describe-waf-ip-resources describe-ip-resource-info describe-ip-safety-info set-clean-threshold set-ip-clean-threshold describe-ip-clean-threshold-range describe-ip-resource-protect-info describe-ip-resource-flow describe-attack-logs describe-attack-statistics describe-attack-type-count describe-ip-monitor-flow " -- $cur) ) ;; - "xdata") + "mongodb") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton list-database-info get-database-info create-database delete-database list-instance-info execute-ras-query execute-py-spark-query get-ras-query-state get-py-spark-execute-state get-ras-query-log get-ras-query-result get-py-spark-execute-result cancel-ras-query cancel-py-spark-job list-table-info create-table get-table-info delete-table " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-security-ips modify-security-ips describe-backups create-backup delete-backup backup-download-url describe-instances create-instance delete-instance reset-password modify-instance-spec modify-instance-name describe-backup-policy modify-backup-policy restore-instance describe-flavors describe-available-zones restart-instance create-sharding-instance modify-node-spec restart-node describe-backup-synchronicities create-backup-synchronicity delete-backup-synchronicities " -- $cur) ) ;; - "containerregistry") + "live") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton get-authorization-token describe-authorization-tokens release-authorization-token describe-images delete-image describe-quotas describe-registries create-registry describe-registry delete-registry check-registry-name create-repository describe-repositories delete-repository check-repository-name " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-publish-stream-info-data describe-live-stream-history-user-num describe-live-publish-stream-num describe-live-stream-player-ranking-data describe-live-transcode-stream-list describe-live-transcode-stream-num describe-live-transcode-stream-player-user-num describe-live-transcode-stream-bandwidth describe-domain-online-stream describe-domains-log describe-url-ranking describe-live-stream-publish-info-by-page describe-live-stream-play-info-by-page describe-live-domain-certificate set-live-domain-certificate describe-live-restart-domain-certificate set-live-restart-domain-certificate add-live-stream-domain-transcode add-live-stream-app-transcode add-custom-live-stream-transcode-template describe-custom-live-stream-transcode-templates describe-system-live-stream-transcode-templates describe-live-stream-transcode-config delete-live-stream-domain-transcode delete-live-stream-app-transcode describe-custom-live-stream-transcode-template delete-custom-live-stream-transcode-template describe-transcode-binding add-custom-live-stream-quality-detection-template describe-custom-live-stream-quality-detection-templates add-live-stream-app-quality-detection add-live-stream-domain-quality-detection set-live-stream-quality-detection-notify-config delete-custom-live-stream-quality-detection-template delete-live-stream-app-quality-detection delete-live-stream-domain-quality-detection describe-live-stream-quality-detection-notify-config delete-live-stream-quality-detection-notify-config describe-quality-detection-binding describe-live-play-auth-key set-live-play-auth-key describe-live-restart-auth-key set-live-restart-auth-key add-custom-live-stream-watermark-template describe-custom-live-stream-watermark-templates add-live-stream-app-watermark add-live-stream-domain-watermark describe-custom-live-stream-watermark-config delete-custom-live-stream-watermark-template delete-live-stream-app-watermark delete-live-stream-domain-watermark describe-watermark-binding create-live-forward-task update-live-forward-task query-live-forward-task start-live-forward-task stop-live-forward-task delete-live-forward-task delete-live-recordings add-live-stream-domain-translate add-live-stream-app-translate add-live-stream-translate describe-system-live-stream-translate-templates describe-live-stream-translate-config describe-live-domain-translate-config delete-live-stream-domain-translate delete-live-stream-app-translate delete-live-stream-translate describe-translate-binding pause-live-stream-translate resume-live-stream-translate forbid-live-stream resume-live-stream interrupt-live-stream describe-live-stream-info set-live-stream-notify-config describe-live-stream-notify-config delete-live-stream-notify-config describe-live-stream-online-list describe-live-stream-publish-list describe-live-bill-data open-live-restart close-live-restart describe-live-restart-configs open-live-p2p close-live-p2p describe-live-p2p-configs add-custom-live-stream-snapshot-template describe-custom-live-stream-snapshot-config describe-custom-live-stream-snapshot-templates add-live-stream-app-snapshot add-live-stream-domain-snapshot set-live-stream-snapshot-notify-config delete-custom-live-stream-snapshot-template delete-live-stream-app-snapshot delete-live-stream-domain-snapshot describe-live-stream-snapshot-notify-config delete-live-stream-snapshot-notify-config describe-snapshot-binding describe-live-domains add-live-domain start-live-domain stop-live-domain describe-live-domain-detail delete-live-domain add-live-restart-domain describe-custom-live-stream-record-templates add-custom-live-stream-record-template add-live-stream-app-record add-live-stream-domain-record describe-custom-live-stream-record-config set-live-stream-record-notify-config delete-custom-live-stream-record-template delete-live-stream-app-record delete-live-stream-domain-record describe-live-stream-record-notify-config delete-live-stream-record-notify-config add-live-record-task describe-record-binding describe-live-app add-live-app stop-live-app describe-live-transcoding-duration-data describe-live-file-storage-data describe-live-stream-bandwidth-data describe-live-stream-publish-bandwidth-data describe-live-stream-traffic-data describe-live-stream-publish-traffic-data describe-live-snapshot-data describe-live-porn-data describe-live-statistic-group-by-stream describe-live-statistic-group-by-area describe-live-statistic-group-by-area-isp describe-live-publish-statistic-group-by-stream open-live-timeshift close-live-timeshift describe-live-timeshift-configs " -- $cur) ) ;; - "partner") + "vpc") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton query-my-customer-list get-total-consumption get-each-consumption describe-customer-bill-by-product " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-vpc-peerings create-vpc-peering describe-vpc-peering modify-vpc-peering delete-vpc-peering describe-route-tables create-route-table describe-route-table modify-route-table delete-route-table add-route-table-rules remove-route-table-rules modify-route-table-rules associate-route-table disassociate-route-table describe-subnets create-subnet describe-subnet modify-subnet delete-subnet describe-network-acls create-network-acl describe-network-acl modify-network-acl delete-network-acl associate-network-acl disassociate-network-acl add-network-acl-rules remove-network-acl-rules modify-network-acl-rules describe-vpcs create-vpc describe-vpc modify-vpc delete-vpc describe-network-interfaces create-network-interface describe-network-interface modify-network-interface delete-network-interface associate-elastic-ip disassociate-elastic-ip assign-secondary-ips unassign-secondary-ips describe-bandwidth-packages create-bandwidth-package describe-bandwidth-package modify-bandwidth-package delete-bandwidth-package add-bandwidth-package-ip remove-bandwidth-package-ip modify-bandwidth-package-ip-bandwidth describe-network-security-groups create-network-security-group describe-network-security-group modify-network-security-group delete-network-security-group add-network-security-group-rules remove-network-security-group-rules modify-network-security-group-rules describe-quota describe-elastic-ips create-elastic-ips describe-elastic-ip modify-elastic-ip delete-elastic-ip describe-edge-ip-providers " -- $cur) ) ;; - "lb") + "monitor") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton describe-backends create-backend describe-backend update-backend delete-backend describe-target-health describe-listeners create-listener describe-listener update-listener delete-listener describe-load-balancers create-load-balancer describe-load-balancer update-load-balancer delete-load-balancer associate-elastic-ip disassociate-elastic-ip associate-security-group disassociate-security-group describe-target-groups create-target-group describe-target-group update-target-group delete-target-group register-targets de-register-targets update-targets describe-targets describe-url-maps create-url-map describe-url-map update-url-map delete-url-map add-rules update-rules delete-rules " -- $cur) ) + -W "-v --version -h --help generate-skeleton describe-alarms create-alarm describe-alarm update-alarm delete-alarms describe-alarm-contacts describe-metrics-for-alarm describe-products-for-alarm enable-alarms describe-alarm-history describe-metrics last-downsample describe-metric-data describe-tag-values describe-services put-product-metric-data put-product-metric-data put-custom-metric-data put-custom-metric-data describe-custom-metric-data " -- $cur) ) ;; - "industrydata") + "xdata") COMPREPLY=( $(compgen \ - -W "-v --version -h --help generate-skeleton get-large-screen-data " -- $cur) ) + -W "-v --version -h --help generate-skeleton list-instance-info list-table-info create-table get-table-info delete-table execute-ras-query execute-py-spark-query get-ras-query-state get-py-spark-execute-state get-ras-query-log get-ras-query-result get-py-spark-execute-result cancel-ras-query cancel-py-spark-job list-database-info get-database-info create-database delete-database " -- $cur) ) ;; @@ -349,580 +349,610 @@ _jdc_complete() prev=${COMP_WORDS[2]} case "$service" in - "rds") + "vqd") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-accounts") + "set-callback") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --callback-type --http-url --callback-events " -- $cur) ) ;; - "create-account") + "query-callback") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --account-name --account-password --notes " -- $cur) ) + -W "-h --help --headers --input-json " -- $cur) ) ;; - "describe-account-privilege") + "list-vqd-templates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --account-name " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --filters " -- $cur) ) ;; - "delete-account") + "create-vqd-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --account-name " -- $cur) ) + -W "-h --help --headers --input-json --template-name --threshold --detections " -- $cur) ) ;; - "grant-privilege") + "get-vqd-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --account-name --account-privileges " -- $cur) ) + -W "-h --help --headers --input-json --template-id " -- $cur) ) ;; - "revoke-privilege") + "update-vqd-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --account-name --db-names " -- $cur) ) + -W "-h --help --headers --input-json --template-id --template-name --threshold --detections " -- $cur) ) ;; - "reset-password") + "delete-vqd-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --account-name --account-password " -- $cur) ) + -W "-h --help --headers --input-json --template-id " -- $cur) ) ;; - "create-super-account") + "submit-vqd-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --account-name --account-password " -- $cur) ) + -W "-h --help --headers --input-json --media --template-id " -- $cur) ) ;; - "grant-account-privilege") + "batch-submit-vqd-tasks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --account-name --database-privileges --global-privileges " -- $cur) ) + -W "-h --help --headers --input-json --media-list --template-id " -- $cur) ) ;; - "describe-audit") + "list-vqd-tasks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --filters " -- $cur) ) ;; - "create-audit") + "get-vqd-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --enabled " -- $cur) ) + -W "-h --help --headers --input-json --task-id " -- $cur) ) ;; - "delete-audit") + "delete-vqd-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --task-id " -- $cur) ) ;; - "describe-audit-options") + "query-vqd-task-result") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --name " -- $cur) ) + -W "-h --help --headers --input-json --task-id " -- $cur) ) ;; - "modify-audit") + "batch-delete-vqd-tasks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --add --drop " -- $cur) ) + -W "-h --help --headers --input-json --task-ids " -- $cur) ) ;; - "describe-audit-files") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; - "describe-audit-download-url") + esac + ;; + + "streamcomputer") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "query-namespaces") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --file-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --keyword " -- $cur) ) ;; - "enable-audit") + "query-namespace-detail") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --namespace-id " -- $cur) ) ;; - "disable-audit") + "create-namespace") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --namespace-str " -- $cur) ) ;; - "describe-audit-result") + "update-namespace") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --start-time --end-time --db-name --account-name --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --namespace-str " -- $cur) ) ;; - "describe-azs") + "delete-namespace") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --engine " -- $cur) ) + -W "-h --help --headers --input-json --region-id --namespace-id " -- $cur) ) ;; - "describe-backups") + "describe-storage") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --auto --backup-type-filter --db-name-filter --backup-time-range-start-filter --backup-time-range-end-filter --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --storage-id " -- $cur) ) ;; - "create-backup") + "add-or-update-storage") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --backup-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --storage-str " -- $cur) ) ;; - "delete-backup") + "delete-storage") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --backup-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --storage-id " -- $cur) ) ;; - "describe-backup-download-url") + "get-storage-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --backup-id --file-name --url-expiration-second " -- $cur) ) + -W "-h --help --headers --input-json --region-id --storage-type --namespace-id " -- $cur) ) ;; - "describe-backup-synchronicities") + "describe-job") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --job-id --namespace-id " -- $cur) ) ;; - "create-backup-synchronicity") + "add-or-update-job") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --dest-region " -- $cur) ) + -W "-h --help --headers --input-json --region-id --job-str " -- $cur) ) ;; - "delete-backup-synchronicity") + "delete-job") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --service-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --namespace-id --job-id " -- $cur) ) ;; - "create-instance-by-time-in-cross-region") + "get-job-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --restore-time --service-id --instance-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --namespace-id " -- $cur) ) ;; - "describe-binlogs") + "start-job") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --namespace-id --job-id " -- $cur) ) ;; - "describe-binlog-download-url") + "stop-job") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --binlog-backup-id --seconds " -- $cur) ) + -W "-h --help --headers --input-json --region-id --namespace-id --job-id " -- $cur) ) ;; - "clear-binlogs") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; - "alter-table-with-online-ddl") + esac + ;; + + "ssl") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-certs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --database --table --command " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --domain-name --cert-ids " -- $cur) ) ;; - "describe-privilege") + "describe-cert") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --engine " -- $cur) ) + -W "-h --help --headers --input-json --cert-id --page-number --page-size " -- $cur) ) ;; - "describe-databases") + "delete-certs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --db-name --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --cert-id " -- $cur) ) ;; - "create-database") + "upload-cert") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --db-name --character-set-name " -- $cur) ) + -W "-h --help --headers --input-json --cert-name --key-file --cert-file --alias-name " -- $cur) ) ;; - "delete-database") + "download-cert") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --db-name " -- $cur) ) + -W "-h --help --headers --input-json --cert-id --server-type " -- $cur) ) ;; - "restore-database-from-backup") + "update-cert-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --db-name --backup-id --backup-file-name " -- $cur) ) + -W "-h --help --headers --input-json --cert-id --cert-name " -- $cur) ) ;; - "restore-database-from-file") + "update-cert") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --db-name --shared-file-gid --file-name " -- $cur) ) + -W "-h --help --headers --input-json --cert-id --key-file --cert-file " -- $cur) ) ;; - "restore-database-from-oss") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --db-name --oss-url " -- $cur) ) + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; - "describe-error-logs") + esac + ;; + + "domainservice") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-resource-record") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --page-number --page-size --search " -- $cur) ) ;; - "describe-import-files") + "create-resource-record") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) ;; - "get-upload-key") + "modify-resource-record") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --resource-record-id --req " -- $cur) ) ;; - "set-import-file-shared") + "delete-resource-record") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --file-name --shared " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --resource-record-id " -- $cur) ) ;; - "delete-import-file") + "modify-resource-record-status") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --file-name --shared-file-gid " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --resource-record-id --action " -- $cur) ) ;; - "describe-instances") + "describe-view-tree") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tag-filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --load-mode --pack-id --view-id " -- $cur) ) ;; - "create-instance") + "batch-set-resource-records") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) ;; - "describe-instance-attributes") + "describe-domains") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --domain-name --domain-id " -- $cur) ) ;; - "delete-instance") + "create-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --pack-id --domain-name --domain-id --buy-type --time-span --time-unit --billing-type " -- $cur) ) ;; - "describe-backup-policy") + "modify-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --domain-name " -- $cur) ) ;; - "modify-backup-policy") + "delete-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --start-window " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id " -- $cur) ) ;; - "modify-instance-name") + "describe-domain-query-count") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --instance-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --domain-name --start --end " -- $cur) ) ;; - "failover-instance") + "describe-domain-query-traffic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --domain-name --start --end " -- $cur) ) ;; - "reboot-instance") + "describe-action-log") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --reboot-master --reboot-slave " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --start-time --end-time --key-word --success --type " -- $cur) ) ;; - "enable-internet-access") + "describe-user-view") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --view-id --view-name --page-number --page-size " -- $cur) ) ;; - "disable-internet-access") + "create-user-view") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) ;; - "restore-instance") + "delete-user-view") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --backup-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) ;; - "create-instance-from-backup") + "describe-user-view-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --backup-id --engine --instance-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --view-id --view-name --page-number --page-size " -- $cur) ) ;; - "modify-instance-spec") + "create-user-view-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --new-instance-class --new-instance-storage-gb --new-instance-storage-type --storage-encrypted " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) ;; - "create-instance-by-time") + "delete-user-view-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --restore-time --instance-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) ;; - "create-roinstance") + "describe-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --instance-name --instance-class --instance-storage-type --instance-storage-gb --az-id --vpc-id --subnet-id --parameter-group --storage-encrypted --count " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --page-index --page-size --search-value " -- $cur) ) ;; - "modify-connection-mode") + "create-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --connection-mode " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --sub-domain-name " -- $cur) ) ;; - "describe-latest-restore-time") + "modify-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --update-monitor " -- $cur) ) ;; - "modify-parameter-group") + "describe-monitor-target") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --parameter-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --sub-domain-name " -- $cur) ) ;; - "exchange-instance-dns") + "create-monitor-target") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --target-instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --sub-domain-name --targets " -- $cur) ) ;; - "modify-instance-az") + "modify-monitor-status") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --new-az-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --monitor-id --action --switch-target " -- $cur) ) ;; - "describe-ssl") + "delete-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --monitor-id " -- $cur) ) ;; - "enable-ssl") + "describe-monitor-alarm") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --page-index --page-size --search-value " -- $cur) ) ;; - "restore-instance-by-time") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --restore-time --restore-schema " -- $cur) ) + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; - "enable-intercept") + esac + ;; + + "oss") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "list-buckets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "disable-intercept") + "put-bucket") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bucketname " -- $cur) ) ;; - "describe-intercept-result") + "delete-bucket") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bucketname " -- $cur) ) ;; - "describe-intercept") + "head-bucket") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bucketname " -- $cur) ) ;; - "describe-logs") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --filters " -- $cur) ) + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; - "update-log-download-urlinternal") + esac + ;; + + "redis") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-spec-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --log-id --seconds " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-log-download-url") + "describe-available-resource") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --log-id --seconds " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-parameters") + "describe-available-resource2") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "modify-parameters") + "describe-cache-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --parameters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --sorts --tag-filters --resource-group-ids " -- $cur) ) ;; - "delete-parameter-group") + "create-cache-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --parameter-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance --charge " -- $cur) ) ;; - "modify-parameter-group-attribute") + "describe-cache-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --parameter-group-id --parameter-group-name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "describe-parameter-groups") + "modify-cache-instance-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --cache-instance-name --cache-instance-description " -- $cur) ) ;; - "create-parameter-group") + "delete-cache-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --engine --engine-version --parameter-group-name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "describe-parameter-group-parameters") + "modify-cache-instance-class") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --parameter-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --cache-instance-class --shard-number " -- $cur) ) ;; - "modify-parameter-group-parameters") + "reset-cache-instance-password") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --parameter-group-id --parameters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --password " -- $cur) ) ;; - "describe-parameter-modify-records") + "describe-instance-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --parameter-group-id --page-number --page-size --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "copy-parameter-group") + "modify-instance-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --parameter-group-id --parameter-group-name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --instance-config " -- $cur) ) ;; - "describe-parameter-group-attached-instances") + "describe-analysis-time") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --parameter-group-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "describe-index-performance") + "modify-analysis-time") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --query-type --db --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --analysis-time " -- $cur) ) ;; - "describe-query-performance") + "describe-cache-analysis-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --query-type --threshold --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --date " -- $cur) ) ;; - "describe-slow-log-attributes") + "create-cache-analysis") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --start-time --end-time --db-name --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "describe-slow-logs") + "describe-cache-analysis-result") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --start-time --end-time --db-name --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --task-id " -- $cur) ) ;; - "describe-active-query-performance") + "describe-client-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --db --threshold --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "describe-error-log") + "describe-client-ip-detail") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --start-time --end-time --db-name --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --ip " -- $cur) ) ;; - "describe-tables") + "describe-backups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --db-name --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --page-number --page-size --start-time --end-time --base-id " -- $cur) ) ;; - "describe-tde") + "create-backup") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --file-name --backup-type " -- $cur) ) ;; - "enable-tde") + "describe-backup-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "describe-white-list") + "modify-backup-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --auto-backup --backup-time --backup-period " -- $cur) ) ;; - "modify-white-list") + "restore-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --ips " -- $cur) ) - ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --base-id " -- $cur) ) ;; - esac - ;; - - "kubernetes") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-clusters") + "describe-download-url") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --base-id " -- $cur) ) ;; - "create-cluster") + "describe-cluster-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name --description --basic-auth --client-certificate --version --azs --node-group --master-cidr --access-key --secret-key --user-metrics --addons-config " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "describe-cluster") + "describe-ip-white-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "modify-cluster") + "modify-ip-white-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --ip-white-list " -- $cur) ) ;; - "delete-cluster") + "describe-slow-log") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --page-number --page-size --start-time --end-time --shard-id --shard-addr " -- $cur) ) ;; - "set-user-metrics") + "describe-task-progress-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id --enabled " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --task-type " -- $cur) ) ;; - "abort-upgrade") + "get-disable-commands") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "describe-progress") + "set-disable-commands") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id --node-group-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --disable-commands " -- $cur) ) ;; - "set-auto-upgrade") + "describe-accounts") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id --auto-upgrade --maintenance-window " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "upgrade-cluster") + "create-account") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id --scope --node-group-ids --version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --account-name --account-password --account-privilege --account-description " -- $cur) ) ;; - "set-addons") + "modify-account") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id --addons-config " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --account-name --account-password --account-privilege --account-description " -- $cur) ) ;; - "describe-node-groups") + "delete-account") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --tags --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --account-name " -- $cur) ) ;; - "create-node-group") + "modify-accounts") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name --description --cluster-id --node-config --azs --initial-node-count --vpc-id --node-cidr --auto-repair --ca-config --node-group-network " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --accounts " -- $cur) ) ;; - "describe-node-group") + "start-clear-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --node-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --clear-type --key-pattern --key-filter --qps-limit " -- $cur) ) ;; - "modify-node-group") + "stop-clear-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --node-group-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "delete-node-group") + "describe-clear-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --node-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "set-node-group-size") + "describe-big-key-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --node-group-id --expect-count " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --date " -- $cur) ) ;; - "set-auto-repair") + "create-big-key-analysis") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --node-group-id --enabled " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --string-size --list-size --hash-size --set-size --zset-size --top " -- $cur) ) ;; - "rollback-node-group-upgrade") + "describe-big-key-detail") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --node-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --task-id " -- $cur) ) ;; - "set-node-group-ca") + "describe-big-key-analysis-time") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --node-group-id --ca-config " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "delete-node-instances") + "modify-big-key-analysis-time") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --node-group-id --instance-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --analysis-time " -- $cur) ) ;; - "describe-quotas") + "stop-cache-analysis") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "describe-server-config") + "describe-analysis-threshold") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "describe-versions") + "modify-analysis-threshold") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --master-version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --string-size --list-size --hash-size --set-size --zset-size --top " -- $cur) ) ;; - "describe-node-version") + "create-big-key-analysis2") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --node-version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --string-size --list-size --hash-size --set-size --zset-size " -- $cur) ) ;; - "describe-upgradable-master-versions") + "describe-big-key-list2") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --page-number --page-size " -- $cur) ) ;; - "describe-upgradable-node-versions") + "describe-big-key-detail2") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id --node-group-ids " -- $cur) ) - ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --task-id " -- $cur) ) ;; - esac - ;; - - "vqd") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "set-callback") + "describe-big-key-analysis-time2") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --callback-type --http-url --callback-events " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "query-callback") + "modify-big-key-analysis-time2") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --analysis-time " -- $cur) ) ;; - "submit-vqd-task") + "describe-analysis-threshold2") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --media --template-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "batch-submit-vqd-tasks") + "modify-analysis-threshold2") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --media-list --template-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --string-size --list-size --hash-size --set-size --zset-size " -- $cur) ) ;; - "list-vqd-tasks") + "describe-hot-key-result2") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) ;; - "get-vqd-task") + "describe-hot-key-detail2") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --task-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cache-instance-id --node-id --page-number --page-size " -- $cur) ) ;; - "delete-vqd-task") + "describe-instance-class") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --task-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --redis-version " -- $cur) ) ;; - "query-vqd-task-result") + "describe-available-region") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --task-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "batch-delete-vqd-tasks") + "describe-user-quota") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --task-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "list-vqd-templates") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "billing") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "query-bill-summary") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --start-time --end-time --app-code --service-code --resource-ids --tags --page-index --page-size " -- $cur) ) ;; - "create-vqd-template") + "query-bill-detail") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template-name --threshold --detections " -- $cur) ) + -W "-h --help --headers --input-json --region-id --start-time --end-time --app-code --service-code --billing-type --resource-ids --tags --page-index --page-size " -- $cur) ) ;; - "get-vqd-template") + "calculate-total-price") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cmd --order-list --operate-time --promotion-info --client-type --package-count --process-type --renew-mode --unify-expire-day --total-price-rule " -- $cur) ) ;; - "update-vqd-template") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "portal") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-product") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template-id --template-name --threshold --detections " -- $cur) ) + -W "-h --help --headers --input-json --region-id --url --lang --ak " -- $cur) ) ;; - "delete-vqd-template") + "describe-products-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --ak " -- $cur) ) ;; "generate-skeleton") @@ -931,594 +961,1962 @@ _jdc_complete() esac ;; - "streamcomputer") + "clouddnsservice") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-job") + "search-rr") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --job-id --namespace-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --page-number --page-size " -- $cur) ) ;; - "add-or-update-job") + "get-view-tree") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --job-str " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --load-mode --pack-id --view-id " -- $cur) ) ;; - "delete-job") + "add-rr") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --namespace-id --job-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) ;; - "get-job-list") + "update-rr") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --namespace-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) ;; - "start-job") + "operate-rr") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --namespace-id --job-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --ids --action " -- $cur) ) ;; - "stop-job") + "batch-set-dns-resolve") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --namespace-id --job-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --req " -- $cur) ) ;; - "query-namespaces") + "get-domains") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --keyword " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --domain-name " -- $cur) ) ;; - "query-namespace-detail") + "add-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --namespace-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --pack-id --domain-name --domain-id --buy-type --time-span --time-unit --billing-type " -- $cur) ) ;; - "create-namespace") + "del-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --namespace-str " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id " -- $cur) ) ;; - "update-namespace") + "update-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --namespace-str " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-name --id " -- $cur) ) ;; - "delete-namespace") + "get-domain-query-count") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --namespace-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --domain-name --start --end " -- $cur) ) ;; - "describe-storage") + "get-domain-query-traffic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --storage-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --domain-name --start --end " -- $cur) ) ;; - "add-or-update-storage") + "get-action-log") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --storage-str " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --start-time --end-time --key-word --success --type " -- $cur) ) ;; - "delete-storage") + "add-user-view") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --storage-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --req " -- $cur) ) ;; - "get-storage-list") + "del-user-view") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --storage-type --namespace-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --req " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "get-user-view") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --domain-id --view-id --view-name --page-number --page-size " -- $cur) ) ;; - esac - ;; - - "ipanti") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-ddo-sattack-logs") + "add-user-view-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --start-time --end-time --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --req " -- $cur) ) ;; - "describe-ccattack-logs") + "del-user-view-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --start-time --end-time --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --req " -- $cur) ) ;; - "describe-ccattack-log-details") + "get-user-view-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --start-time --end-time --instance-id --sub-domain --attack-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --view-id --view-name --page-number --page-size " -- $cur) ) ;; - "describe-attack-statistics") + "get-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id --type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --page-index --page-size --search-value " -- $cur) ) ;; - "describe-attack-type-count") + "add-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --sub-domain-name " -- $cur) ) ;; - "describe-ddo-sgraph") + "get-targets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --sub-domain-name " -- $cur) ) ;; - "describe-fwd-graph") + "add-monitor-target") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --sub-domain-name --targets " -- $cur) ) ;; - "describe-ccgraph") + "operate-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id --sub-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --action --ids --switch-target " -- $cur) ) ;; - "describe-forward-rules") + "update-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --search-type --search-value " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --update-monitor " -- $cur) ) ;; - "create-forward-rule") + "get-monitor-alarm-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-id --page-index --page-size --search-value " -- $cur) ) ;; - "describe-forward-rule") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "cdn") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "query-forbidden-info-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --query-domain --forbidden-url --page-number --page-size " -- $cur) ) ;; - "modify-forward-rule") + "create-forbidden-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id --forward-rule-spec " -- $cur) ) + -W "-h --help --headers --input-json --forbidden-type --forbidden-domain --forbidden-url --reason --link-other --share-cache-domain-flag --token " -- $cur) ) ;; - "delete-forward-rule") + "delete-forbidden-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --forbidden-type --forbidden-domain --forbidden-url --share-cache-domain-flag --token " -- $cur) ) ;; - "switch-forward-rule-protect") + "query-un-forbidden-status") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --domain --url --task-id --page-number --page-size " -- $cur) ) ;; - "switch-forward-rule-origin") + "create-live-domain-prefecth-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --url-list --prefetch-time --action " -- $cur) ) ;; - "describe-protection-rule-of-forward-rule") + "query-live-prefetch-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --url-list " -- $cur) ) ;; - "modify-protection-rule-of-forward-rule") + "query-area-isp-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id --forward-protection-rule-spec " -- $cur) ) + -W "-h --help --headers --input-json " -- $cur) ) ;; - "describe-geo-areas") + "query-area-isp-list-v2") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json " -- $cur) ) ;; - "describe-black-list-rule-of-forward-rule") + "query-mix-statistics-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --fields --area --isp --period --scheme --cache-type " -- $cur) ) ;; - "modify-black-list-rule-of-forward-rule") + "query-mix-statistics-with-area-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id --modify-spec " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --fields --area --isp --period --cache-type " -- $cur) ) ;; - "enable-black-list-rule-of-forward-rule") + "query-mix-traffic-group-sum") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --fields --area --isp --period --group-by --cache-type " -- $cur) ) ;; - "disable-black-list-rule-of-forward-rule") + "query-statistics-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --sub-domain --fields --area --isp --origin --period --abroad --cache-type " -- $cur) ) ;; - "describe-white-list-rule-of-forward-rule") + "query-statistics-data-group-by-area") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --sub-domain --fields --area --isp --origin --period --group-by --scheme --abroad --cache-type " -- $cur) ) ;; - "modify-white-list-rule-of-forward-rule") + "query-statistics-data-group-sum") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id --modify-spec " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --sub-domain --fields --area --isp --origin --period --group-by --abroad --cache-type " -- $cur) ) ;; - "enable-white-list-rule-of-forward-rule") + "query-live-statistics-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --app-name --stream-name --sub-domain --fields --area --isp --req-method --scheme --cache-level --period --cache-type " -- $cur) ) ;; - "disable-white-list-rule-of-forward-rule") + "query-live-statistics-area-data-group-by") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --app-name --fields --area --isp --stream-name --period --group-by --sub-domain --scheme --req-method --cache-level --cache-type " -- $cur) ) ;; - "describe-instances") + "query-live-traffic-group-sum") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --name " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --sub-domain --app-name --stream-name --fields --area --isp --scheme --period --group-by --req-method --cache-level --cache-type " -- $cur) ) ;; - "create-instance") + "query-statistics-top-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --create-instance-spec " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --sub-domain --size --top-by " -- $cur) ) ;; - "describe-instance") + "query-statistics-top-url") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --sub-domain --size --top-by " -- $cur) ) ;; - "modify-instance-name") + "query-dir-bandwidth") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --rename-instance-spec " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --dirs --regions --cache-type " -- $cur) ) ;; - "modify-epb") + "query-dir-stats-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --modify-instance-epbspec " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --dirs --cache-type " -- $cur) ) ;; - "describe-alarm-config") + "query-customized-dir-band-width") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --domain --dir " -- $cur) ) ;; - "modify-alarm-config") + "query-stream-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --alarm-config-spec " -- $cur) ) + -W "-h --help --headers --input-json --domain --start-time --end-time --app-name --stream-name --page-num --page-size " -- $cur) ) ;; - "describe-name-list") + "query-domain-temp-inst-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --name --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --inst-name --page-number --page-size " -- $cur) ) ;; - "describe-protection-statistics") + "query-domain-temp-pro-keys") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json " -- $cur) ) ;; - "check-name") + "modify-domain-temp-inst") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --temp-id --inst-id --inst-name --inst-pro-info-map " -- $cur) ) ;; - "describe-vpc-ip-list") + "query-domain-temp-inst") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --inst-id " -- $cur) ) ;; - "describe-cps-ip-list") + "del-domain-temp-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --inst-id " -- $cur) ) ;; - "describe-ip-sets") + "get-domain-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --key-word --page-number --page-size --status --type --accelerate-region " -- $cur) ) ;; - "create-ip-set") + "get-domain-list-by-filter") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --ip-set-spec " -- $cur) ) + -W "-h --help --headers --input-json --key-word --page-number --page-size --status --type --accelerate-region --filter-by --tag-filters " -- $cur) ) ;; - "describe-ip-set") + "get-domain-detail") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --ip-set-id " -- $cur) ) + -W "-h --help --headers --input-json --domain " -- $cur) ) ;; - "delete-ip-set") + "create-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --ip-set-id " -- $cur) ) + -W "-h --help --headers --input-json --domain --source-type --cdn-type --back-source-type --daily-band-width --quaility --max-file-size --min-file-size --sum-file-size --avg-file-size --default-source-host --http-type --ip-source --domain-source --oss-source --accelerate-region --temp-inst-id " -- $cur) ) ;; - "describe-ip-set-usage") + "delete-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --domain " -- $cur) ) ;; - "describe-web-rules") + "start-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --search-type --search-value " -- $cur) ) + -W "-h --help --headers --input-json --domain " -- $cur) ) ;; - "create-web-rule") + "stop-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-spec " -- $cur) ) + -W "-h --help --headers --input-json --domain " -- $cur) ) ;; - "describe-web-rule") + "query-oss-buckets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json " -- $cur) ) ;; - "modify-web-rule") + "batch-create") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-rule-spec " -- $cur) ) + -W "-h --help --headers --input-json --domains --source-type --cdn-type --back-source-type --daily-band-width --quaility --max-file-size --min-file-size --sum-file-size --avg-file-size --default-source-host --http-type --ip-source --domain-source --oss-source --accelerate-region --temp-inst-id " -- $cur) ) ;; - "delete-web-rule") + "query-domain-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --domain " -- $cur) ) ;; - "bind-cert") + "config-service-notice") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cert-id " -- $cur) ) + -W "-h --help --headers --input-json --id --notice-type --notice-way --notice-to --notice-cc --notice-content --notice-period --notice-status " -- $cur) ) ;; - "switch-web-rule-protect") + "query-service-notice") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --notice-type --notice-way " -- $cur) ) ;; - "switch-web-rule-origin") + "query-online-billing-type") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json " -- $cur) ) ;; - "enable-web-rule-cc") + "set-online-billing-type") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --all-type " -- $cur) ) ;; - "disable-web-rule-cc") + "query-domain-config-status") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --task-id " -- $cur) ) ;; - "enable-web-rule-ccobserver-mode") + "check-whether-ip-belong-to-jcloud") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --ips " -- $cur) ) ;; - "disable-web-rule-ccobserver-mode") + "query-service-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --domain-list " -- $cur) ) ;; - "describe-ccprotection-rules-of-web-rule") + "get-all-upper-node-ip-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json " -- $cur) ) ;; - "create-ccprotection-rule-of-web-rule") + "query-domain-group-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-rule-spec " -- $cur) ) + -W "-h --help --headers --input-json --share-cache --page-number --page-size --primary-domain --domain-group-name " -- $cur) ) ;; - "describe-ccprotection-rule-of-web-rule") + "query-domain-group-detail") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --id " -- $cur) ) ;; - "modify-ccprotection-rule-of-web-rule") + "query-domains-not-in-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-rule-id --cc-protection-rule-spec " -- $cur) ) + -W "-h --help --headers --input-json " -- $cur) ) ;; - "delete-ccprotection-rule-of-web-rule") + "update-domain-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --id --domains --primary-domain --share-cache --domain-group-name " -- $cur) ) ;; - "enable-ccprotection-rule-of-web-rule") + "create-domain-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --share-cache --primary-domain --domain-group-name --domains " -- $cur) ) ;; - "disable-ccprotection-rule-of-web-rule") + "batch-delete-domain-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --ids " -- $cur) ) + ;; + "query-waf-switch") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-waf-switch") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --switch-status " -- $cur) ) + ;; + "query-waf-white-rule-switch") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-waf-white-rule-switch") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --switch-status " -- $cur) ) + ;; + "querywaf-white-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --rule-type --id --page-size --page-index " -- $cur) ) + ;; + "create-waf-white-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --rule-type --match-op --val --actions " -- $cur) ) + ;; + "update-waf-white-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --id --rule-type --match-op --val --actions " -- $cur) ) + ;; + "enable-waf-white-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --ids --rule-type " -- $cur) ) + ;; + "disable-waf-white-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --ids --rule-type " -- $cur) ) + ;; + "delete-waf-white-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --ids --rule-type " -- $cur) ) + ;; + "query-waf-black-rule-switch") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-waf-black-rule-switch") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --switch-status " -- $cur) ) + ;; + "querywaf-black-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --rule-type --id --page-size --page-index " -- $cur) ) + ;; + "create-waf-black-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --rule-type --match-op --val --at-op --at-val " -- $cur) ) + ;; + "update-waf-black-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --id --rule-type --match-op --val --at-op --at-val " -- $cur) ) + ;; + "enable-waf-black-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --ids --rule-type " -- $cur) ) + ;; + "disable-waf-black-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --ids --rule-type " -- $cur) ) + ;; + "delete-waf-black-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --ids --rule-type " -- $cur) ) + ;; + "query-ccprotect-switch") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-ccprotect-switch") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --switch-status " -- $cur) ) + ;; + "query-ccprotect-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --id --page-size --page-index " -- $cur) ) + ;; + "create-ccprotect-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --uri --detect-period --single-ip-limit --block-type --block-time " -- $cur) ) + ;; + "update-ccprotect-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --id --uri --detect-period --single-ip-limit --block-type --block-time " -- $cur) ) + ;; + "enable-ccprotect-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --ids " -- $cur) ) + ;; + "disable-ccprotect-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --ids " -- $cur) ) + ;; + "delete-ccprotect-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --ids " -- $cur) ) + ;; + "query-web-protect-switch") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-web-protect-switch") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --switch-status " -- $cur) ) + ;; + "query-web-protect-settings") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "update-web-protect-settings") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --waf-mode --waf-level --redirection " -- $cur) ) + ;; + "query-waf-regions") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --skip-type " -- $cur) ) + ;; + "query-ip-black-setting-status") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "bat-create-prefetch-task") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --tasks " -- $cur) ) + ;; + "update-prefetch-task") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --url --region --isp --copy-num " -- $cur) ) + ;; + "query-prefetch-task") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --url --region --isp --status --file-id --page-number --page-size --task-type --domain " -- $cur) ) + ;; + "stop-prefetch-task") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --urls --region --isp " -- $cur) ) + ;; + "operate-purge-task") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --urls --opt-type " -- $cur) ) + ;; + "query-purge-task") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --url --status --file-id --page-number --page-size --domain " -- $cur) ) + ;; + "query-net-protection-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json " -- $cur) ) + ;; + "set-net-protection-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --src-new-conn-limit-enable --dst-new-conn-limit-enable --datagram-range-min --datagram-range-max --dst-new-conn-limit-value --src-new-conn-limit-value --geo-black --ip-black --ip-white " -- $cur) ) + ;; + "query-net-protection-rules-switch") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json " -- $cur) ) + ;; + "set-net-protection-rules-switch") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --switch-status " -- $cur) ) + ;; + "query-geo-areas") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json " -- $cur) ) + ;; + "query-attack-type-count") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --start-time --end-time " -- $cur) ) + ;; + "query-ddos-graph") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --start-time --end-time " -- $cur) ) + ;; + "search-attack-log") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --start-time --end-time --page-number --page-size --sort-field --sort-rule " -- $cur) ) + ;; + "preview-certificate") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --content " -- $cur) ) + ;; + "query-default-http-header-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json " -- $cur) ) + ;; + "query-ip-black-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-ip-black-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --ips --ip-list-type " -- $cur) ) + ;; + "operate-ip-black-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --status " -- $cur) ) + ;; + "query-custom-error-page") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-custom-error-page") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --error-page-configs " -- $cur) ) + ;; + "create-cache-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --weight --ttl --contents --cache-type " -- $cur) ) + ;; + "update-cache-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --weight --ttl --contents --cache-type --config-id " -- $cur) ) + ;; + "delete-cache-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --config-id " -- $cur) ) + ;; + "set-cache-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --cache-rules " -- $cur) ) + ;; + "query-http-header") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --edge-type " -- $cur) ) + ;; + "set-http-header") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --edge-type --header-type --header-name --header-value " -- $cur) ) + ;; + "delete-http-header") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --edge-type --header-type --header-name " -- $cur) ) + ;; + "set-video-draft") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --status " -- $cur) ) + ;; + "set-range") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --status " -- $cur) ) + ;; + "set-ignore-query-string") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --status " -- $cur) ) + ;; + "set-filter-args") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --retain-args --status " -- $cur) ) + ;; + "query-filter-args") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "query-user-agent") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-user-agent-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --user-agent-type --user-agent-list " -- $cur) ) + ;; + "query-accesskey-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-accesskey-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --accesskey-type --accesskey-key --accesskey-keep " -- $cur) ) + ;; + "set-refer") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --refer-type --refer-list --allow-no-refer-header --allow-null-refer-header " -- $cur) ) + ;; + "query-monitor") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-monitor") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --cycle --monitor-path --http-request-header " -- $cur) ) + ;; + "stop-monitor") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-source") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --source-type --back-source-type --accelerate-region --ip-source --domain-source --oss-source --default-source-host " -- $cur) ) + ;; + "operate-share-cache") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --status " -- $cur) ) + ;; + "set-http-type") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --http-type --certificate --rsa-key --jump-type --cert-from --ssl-cert-id --sync-to-ssl --cert-name " -- $cur) ) + ;; + "query-follow-redirect") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-follow-redirect") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --status " -- $cur) ) + ;; + "query-follow-source-protocol") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-follow-source-protocol") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --status " -- $cur) ) + ;; + "set-domain-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --http-type --back-source-type --jump-type --jcdn-time-anti --hdr-ctrl --toutiao-header " -- $cur) ) + ;; + "query-domain-all-config-classify") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "execute-domain-copy") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --copy-domains --config-keys " -- $cur) ) + ;; + "query-extra-cache-time") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-extra-cache-time") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --http-code --cache-time " -- $cur) ) + ;; + "delete-extra-cache-time") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --http-code " -- $cur) ) + ;; + "batch-set-extra-cache-time") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --content " -- $cur) ) + ;; + "set-gzip") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --status --gzip-types " -- $cur) ) + ;; + "config-back-source-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --before-regex --after-regex " -- $cur) ) + ;; + "query-back-source-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "config-url-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --before-regex --after-regex " -- $cur) ) + ;; + "query-url-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "config-http2") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --status " -- $cur) ) + ;; + "query-http2") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "config-back-source-path") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --configs " -- $cur) ) + ;; + "query-back-source-path") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "set-accelerate-region") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --accelerate-region " -- $cur) ) + ;; + "config-back-source-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --status --rules " -- $cur) ) + ;; + "query-back-source-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "config-back-source-oss") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --status --access-key --secret-key --bucket --suffix --domain2 " -- $cur) ) + ;; + "query-back-source-oss") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "speed-limit") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --limit-rate " -- $cur) ) + ;; + "query-band") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --start-time --end-time --domain --area --isp --period " -- $cur) ) + ;; + "query-band-with-area") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --start-time --end-time --domain --area --isp --period " -- $cur) ) + ;; + "query-cdn-user-quota") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json " -- $cur) ) + ;; + "query-refresh-task-by-ids") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --task-ids --keyword " -- $cur) ) + ;; + "set-refresh-limit") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --sub-users --refresh-count --prefetch-count --dir-count " -- $cur) ) + ;; + "query-refresh-limit") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --sub-users --page-number --page-size " -- $cur) ) + ;; + "query-refresh-task-by-id") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --task-id " -- $cur) ) + ;; + "create-refresh-task-for-callback") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --task-type --url-items " -- $cur) ) + ;; + "create-refresh-task-for-callback-v2") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --task-type --url-items " -- $cur) ) + ;; + "query-refresh-task") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --start-time --end-time --keyword --task-id --task-status --task-type --page-number --page-size --account-type --sub-users " -- $cur) ) + ;; + "create-refresh-task") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --task-type --urls " -- $cur) ) + ;; + "get-ssl-cert-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --page-number --page-size --domain " -- $cur) ) + ;; + "get-ssl-cert-detail") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --ssl-cert-id " -- $cur) ) + ;; + "upload-cert") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --cert-name --key-file --cert-file --alias-name " -- $cur) ) + ;; + "query-avg-bandwidth-for-pcdn") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --starttime --stoptime --clientid --page --size " -- $cur) ) + ;; + "query-device-status-for-pcdn") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --mac-addr " -- $cur) ) + ;; + "query-jdbox-statistics-data") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --start-time --end-time --fields --area --isp --period --category --mac-addr --plugin-pin " -- $cur) ) + ;; + "query-jdbox-statistics-data-with-group") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --start-time --end-time --group-by --fields --area --isp --period --category --mac-addr --plugin-pin " -- $cur) ) + ;; + "query-jbox-avg-bandwidth") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --starttime --stoptime --plugin-pin --clientid --page --size " -- $cur) ) + ;; + "query-domains-log") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domains --start-time --end-time --interval --log-type " -- $cur) ) + ;; + "query-domain-log") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --start-time --end-time --interval --log-type --page-size --page-number " -- $cur) ) + ;; + "waf-query-pv-for-area-and-ip") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --start-time --end-time --domain " -- $cur) ) + ;; + "waf-query-pv") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --start-time --end-time --domain " -- $cur) ) + ;; + "waf-query-attack-details") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --start-time --end-time --domain --sort-field --sort-rule --page-number --page-size " -- $cur) ) + ;; + "set-auth-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --enable-url-auth --auth-key --age --enc-algorithm --time-format --uri-type --rule " -- $cur) ) + ;; + "set-source-auth-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --enable --origin-role --auth-type --tos-auth-info --oss-auth-info " -- $cur) ) + ;; + "set-live-domain-back-source") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --source-type --back-source-type --default-source-host --domain-source --ip-source " -- $cur) ) + ;; + "set-live-domain-ip-black-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --ips --ip-list-type " -- $cur) ) + ;; + "set-live-domain-refer") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --refer-type --refer-list --allow-no-refer-header --allow-null-refer-header " -- $cur) ) + ;; + "operate-live-domain-ip-black-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --black-ips-enable " -- $cur) ) + ;; + "set-live-domain-back-source-host") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --source-host " -- $cur) ) + ;; + "set-live-domain-access-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --accesskey-type --accesskey-key --auth-life-time " -- $cur) ) + ;; + "set-protocol-convert") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --certificate --rsa-key --cert-from --ssl-cert-id --sync-to-ssl --cert-name --protocol-converts " -- $cur) ) + ;; + "delete-forbidden-stream") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --delete-streams " -- $cur) ) + ;; + "query-push-domain-orapp-or-stream") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain --app --stream --limit " -- $cur) ) + ;; + "query-live-domain-ip-black-white-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "batch-create-live-domain") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --play-domain --publish-domain --source-type --back-http-type --default-source-host --site-type --back-source-type --ip-source --domain-source --accelerate-region " -- $cur) ) + ;; + "query-live-domain-detail") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + "query-live-domain-apps") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --domain " -- $cur) ) + ;; + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "streambus") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "get-topic-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --keyword " -- $cur) ) + ;; + "describe-topic") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + ;; + "add-topic") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --topic-model " -- $cur) ) + ;; + "update-topic") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --topic-model " -- $cur) ) + ;; + "delete-topic") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + ;; + "get-consumer-group-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --topic-id " -- $cur) ) + ;; + "create-consumer-group") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --consumer-group-str " -- $cur) ) + ;; + "delete-consumer-group") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --topic-id --consumer-group-id " -- $cur) ) + ;; + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "apigateway") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "query-user-domains") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --order-by --api-group-id " -- $cur) ) + ;; + "create-user-domain") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --domain --protocol --api-group-id " -- $cur) ) + ;; + "delete-user-domain") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --domain-ids --api-group-id " -- $cur) ) + ;; + "create-backend-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --backend-config-id --base-group-id --environment --backend-url --backend-service-type --header-params --query-params --description --create-time --sort --user-sort --jdsf-id --jdsf-param --jdsf-region --jdsf-pin " -- $cur) ) + ;; + "describe-backend-configs") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --environment --page-number --page-size --filters " -- $cur) ) + ;; + "describe-backend-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --backend-config-id " -- $cur) ) + ;; + "update-backend-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --backend-config-id --base-group-id --environment --backend-url --backend-service-type --header-params --query-params --description --create-time --sort --user-sort --jdsf-id --jdsf-param --jdsf-region --jdsf-pin " -- $cur) ) + ;; + "delete-backend-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --backend-config-id " -- $cur) ) + ;; + "query-uc-access-keys") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + ;; + "query-keys") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --order-by --user-type --key-id " -- $cur) ) + ;; + "create-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --key-name --key-desc " -- $cur) ) + ;; + "reset-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --key-id " -- $cur) ) + ;; + "update-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --key-id --key-name --key-desc " -- $cur) ) + ;; + "query-key-info") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --key-id " -- $cur) ) + ;; + "describe-api-groups") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tag-filters " -- $cur) ) + ;; + "create-api-group") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --group-name --description --prefix --key-check --auth-type --prefix-strip --group-type --jdsf-name --jdsf-registry-name --jdsf-id " -- $cur) ) + ;; + "check-group-name-exist") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --group-name " -- $cur) ) + ;; + "describe-api-group") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id " -- $cur) ) + ;; + "modify-api-group-attribute") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --group-name --description --prefix --key-check --auth-type --prefix-strip --group-type --jdsf-name --jdsf-registry-name --jdsf-id " -- $cur) ) + ;; + "delete-api-group") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id " -- $cur) ) + ;; + "describe-is-deploy-api-groups") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --filters " -- $cur) ) + ;; + "query-rate-limit-policies") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + ;; + "create-rate-limit-policy") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --rate-limit-policy-view " -- $cur) ) + ;; + "check-policy-name") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --policy-name " -- $cur) ) + ;; + "query-rate-limit-policy") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --policy-id " -- $cur) ) + ;; + "update-rate-limit-policy") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --policy-id --rate-limit-policy-view " -- $cur) ) + ;; + "delete-rate-limit-policy") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --policy-id " -- $cur) ) + ;; + "query-bind-group-policy") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --policy-id " -- $cur) ) + ;; + "bind-group-policy") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --policy-id --deployment-ids " -- $cur) ) + ;; + "query-policy-group-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --policy-id " -- $cur) ) + ;; + "query-subscription-keys") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + ;; + "create-subscription-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --description --name " -- $cur) ) + ;; + "query-subscription-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --subscription-key-id " -- $cur) ) + ;; + "update-subscription-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --subscription-key-id --description --name " -- $cur) ) + ;; + "delete-subscription-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --subscription-key-id " -- $cur) ) + ;; + "query-access-keys") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + ;; + "create-access-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --description --access-key-type --access-key " -- $cur) ) + ;; + "check-key-exist") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-key --access-key-type " -- $cur) ) + ;; + "query-access-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-key-id " -- $cur) ) + ;; + "update-access-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-key-id --description --access-key-type --access-key " -- $cur) ) + ;; + "delete-access-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-key-id " -- $cur) ) + ;; + "query-bind-group-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-key-id " -- $cur) ) + ;; + "bind-group-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-key-id --deployment-ids " -- $cur) ) + ;; + "query-key-group-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-key-id " -- $cur) ) + ;; + "check-pin") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pin " -- $cur) ) + ;; + "query-apis") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision --page-number --page-size --filters " -- $cur) ) + ;; + "create-apis") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision --api " -- $cur) ) + ;; + "check-api-name-exist") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision --api-name " -- $cur) ) + ;; + "query-api") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision --api-id --filters " -- $cur) ) + ;; + "update-api") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision --api-id --api " -- $cur) ) + ;; + "delete-api") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision --api-id " -- $cur) ) + ;; + "update-api-by-name") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision --api-name --api " -- $cur) ) + ;; + "delete-api-by-name") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision --api-name " -- $cur) ) + ;; + "describe-deployments") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --filters " -- $cur) ) + ;; + "deploy") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision --environment --backend-service-type --backend-url --description --jdsf-name --jdsf-registry-name --jdsf-id " -- $cur) ) + ;; + "describe-deployment") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --deployment-id " -- $cur) ) + ;; + "offline") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --deployment-id " -- $cur) ) + ;; + "batch-offline") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --deployment-ids " -- $cur) ) + ;; + "describe-revisions") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --page-number --page-size --filters " -- $cur) ) + ;; + "create-revision") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision --base-revision --revision-note " -- $cur) ) + ;; + "get-revision-ids") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id " -- $cur) ) + ;; + "check-revision-exist") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision " -- $cur) ) + ;; + "query-revision") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision-id --page-number --page-size --filters " -- $cur) ) + ;; + "modify-revision") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision-id --revision-note " -- $cur) ) + ;; + "delete-revision") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --api-group-id --revision-id " -- $cur) ) + ;; + "query-access-auths") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + ;; + "create-access-auth") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-auth-view " -- $cur) ) + ;; + "check-auth-exist") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-key --auth-user-type " -- $cur) ) + ;; + "query-access-auth") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-auth-id " -- $cur) ) + ;; + "update-access-auth") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-auth-id --access-auth-view " -- $cur) ) + ;; + "delete-access-auth") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-auth-id " -- $cur) ) + ;; + "query-bind-group-auth") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-auth-id " -- $cur) ) + ;; + "bind-group-auth") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --access-auth-id --deployment-ids " -- $cur) ) + ;; + "query-auth-group-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --auth-user-type " -- $cur) ) + ;; + "authorized-api-group-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + ;; + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "sts") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "assume-role") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --assume-role-info " -- $cur) ) + ;; + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "nativecontainer") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-secrets") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + ;; + "create-secret") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --name --secret-type --data " -- $cur) ) + ;; + "describe-secret") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + ;; + "delete-secret") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + ;; + "describe-quota") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --resource-type " -- $cur) ) + ;; + "describe-containers") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tags " -- $cur) ) + ;; + "create-containers") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-spec --max-count --client-token " -- $cur) ) + ;; + "describe-container") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) + ;; + "delete-container") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) + ;; + "start-container") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) + ;; + "stop-container") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) + ;; + "modify-container-attribute") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id --name --description " -- $cur) ) + ;; + "associate-elastic-ip") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id --elastic-ip-id " -- $cur) ) + ;; + "disassociate-elastic-ip") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id --elastic-ip-id " -- $cur) ) + ;; + "get-logs") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id --tail-lines --since-seconds --limit-bytes " -- $cur) ) + ;; + "rebuild-container") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id --image --secret --command --args --tty --working-dir --envs " -- $cur) ) + ;; + "resize-container") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id --instance-type " -- $cur) ) + ;; + "exec-create") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id --command --tty " -- $cur) ) + ;; + "exec-get-exit-code") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id --exec-id " -- $cur) ) + ;; + "resize-tty") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --container-id --height --width --exec-id " -- $cur) ) + ;; + "describe-instance-types") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --filters " -- $cur) ) + ;; + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "pod") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-secrets") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + ;; + "create-secret") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --name --secret-type --data " -- $cur) ) + ;; + "describe-secret") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + ;; + "delete-secret") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + ;; + "create-config-file") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --name --data " -- $cur) ) + ;; + "describe-config-file") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + ;; + "delete-config-file") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + ;; + "update-config-file") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --name --name --data " -- $cur) ) + ;; + "describe-quota") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --resource-type " -- $cur) ) + ;; + "describe-container") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id --container-name " -- $cur) ) + ;; + "attach") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id --container-name " -- $cur) ) + ;; + "exec-create") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id --container-name --command --tty " -- $cur) ) + ;; + "exec-get-exit-code") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id --container-name --exec-id " -- $cur) ) + ;; + "resize-tty") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id --container-name --height --width --exec-id " -- $cur) ) + ;; + "describe-pods") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tags " -- $cur) ) + ;; + "create-pods") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-spec --max-count --client-token " -- $cur) ) + ;; + "check-pod-name") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-name --max-count " -- $cur) ) + ;; + "describe-pod") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id " -- $cur) ) + ;; + "delete-pod") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id " -- $cur) ) + ;; + "start-pod") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id " -- $cur) ) + ;; + "stop-pod") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id " -- $cur) ) + ;; + "modify-pod-attribute") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id --description " -- $cur) ) + ;; + "associate-elastic-ip") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id --elastic-ip-id " -- $cur) ) + ;; + "disassociate-elastic-ip") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id --elastic-ip-id " -- $cur) ) + ;; + "get-container-logs") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id --container-name --tail-lines --since-seconds --limit-bytes --start-time --end-time " -- $cur) ) + ;; + "rebuild-pod") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id --containers " -- $cur) ) + ;; + "resize-pod") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --pod-id --instance-type --container-resources " -- $cur) ) + ;; + "describe-instance-types") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --filters " -- $cur) ) + ;; + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "datastar") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "get-large-screen-data") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --region --industry --start-date --end-date --first-index --second-index " -- $cur) ) + ;; + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "kms") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-key-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --page-number --page-size " -- $cur) ) + ;; + "create-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-cfg " -- $cur) ) + ;; + "describe-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id " -- $cur) ) + ;; + "update-key-description") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id --key-cfg " -- $cur) ) + ;; + "enable-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id " -- $cur) ) + ;; + "disable-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id " -- $cur) ) + ;; + "schedule-key-deletion") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id --delay-days " -- $cur) ) + ;; + "cancel-key-deletion") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id " -- $cur) ) + ;; + "key-rotation") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id " -- $cur) ) + ;; + "encrypt") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id --plaintext " -- $cur) ) + ;; + "decrypt") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id --ciphertext-blob " -- $cur) ) + ;; + "get-public-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id " -- $cur) ) + ;; + "sign") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id --plaintext " -- $cur) ) + ;; + "validate") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id --plaintext --signature " -- $cur) ) + ;; + "generate-data-key") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id " -- $cur) ) + ;; + "describe-key-detail") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id --page-number --page-size " -- $cur) ) + ;; + "enable-key-version") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id --version " -- $cur) ) + ;; + "disable-key-version") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id --version " -- $cur) ) + ;; + "schedule-key-version-deletion") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id --version --delay-days " -- $cur) ) + ;; + "cancel-key-version-deletion") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --key-id --version " -- $cur) ) + ;; + "describe-secret-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --page-number --page-size " -- $cur) ) + ;; + "create-secret") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --secret-cfg " -- $cur) ) + ;; + "describe-secret-version-list") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --secret-id --page-number --page-size " -- $cur) ) + ;; + "update-secret") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --secret-id --secret-desc-cfg " -- $cur) ) + ;; + "enable-secret") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --secret-id " -- $cur) ) + ;; + "disable-secret") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --secret-id " -- $cur) ) + ;; + "delete-secret") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --secret-id " -- $cur) ) + ;; + "create-secret-version") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --secret-id --secret-version-cfg " -- $cur) ) + ;; + "describe-secret-version-info") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --secret-id --version " -- $cur) ) + ;; + "update-secret-version") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --secret-id --version --secret-time-cfg " -- $cur) ) + ;; + "enable-secret-version") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --secret-id --version " -- $cur) ) + ;; + "disable-secret-version") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --secret-id --version " -- $cur) ) + ;; + "delete-secret-version") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --secret-id --version " -- $cur) ) + ;; + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "elite") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "jdx-query-delivery-info") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --order-number " -- $cur) ) + ;; + "get-store-service") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --buyer-pin --business-data --query-all " -- $cur) ) + ;; + "jdx-query-product") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-no --page-size " -- $cur) ) + ;; + "list-sale-service") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-no --page-size --deliver-number --deliver-status --create-dt-start --create-dt-end " -- $cur) ) + ;; + "get-sale-service-by-deliver-number") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --deliver-number " -- $cur) ) + ;; + "confirm-sale-service-delivery") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --confirm-delivery-info " -- $cur) ) + ;; + "jdx-report-order") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --report-order-info " -- $cur) ) + ;; + "jdx-create-order") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --create-order-info " -- $cur) ) + ;; + "jdx-query-price") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --query-price-param " -- $cur) ) + ;; + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "iam") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "create-sub-user") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --create-sub-user-info " -- $cur) ) + ;; + "describe-sub-user") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --sub-user " -- $cur) ) ;; - "describe-ccprotection-config-of-web-rule") + "update-sub-user") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --sub-user --update-sub-user-info " -- $cur) ) ;; - "modify-ccprotection-config-of-web-rule") + "delete-sub-user") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-config-spec " -- $cur) ) + -W "-h --help --headers --input-json --sub-user " -- $cur) ) ;; - "describe-ccprotection-default-config-of-web-rule") + "describe-sub-users") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --keyword --sort " -- $cur) ) ;; - "modify-cert-info") + "describe-sub-user-groups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cert-info-modify-spec " -- $cur) ) + -W "-h --help --headers --input-json --sub-user " -- $cur) ) ;; - "describe-web-rule-black-list-usage") + "describe-attached-sub-user-policies") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --sub-user " -- $cur) ) ;; - "describe-black-list-rules-of-web-rule") + "detach-sub-user-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --sub-user --policy-name " -- $cur) ) ;; - "create-black-list-rule-of-web-rule") + "attach-sub-user-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-black-list-rule-spec " -- $cur) ) + -W "-h --help --headers --input-json --sub-user --policy-name " -- $cur) ) ;; - "describe-black-list-rule-of-web-rule") + "create-permission") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-black-list-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --create-permission-info " -- $cur) ) ;; - "modify-black-list-rule-of-web-rule") + "describe-permission-detail") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-black-list-rule-id --web-black-list-rule-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --permission-id " -- $cur) ) ;; - "delete-black-list-rule-of-web-rule") + "update-permission") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-black-list-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --permission-id --update-permission-info " -- $cur) ) ;; - "enable-web-rule-black-list") + "describe-permissions") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --keyword --query-type " -- $cur) ) ;; - "enable-black-list-rule-of-web-rule") + "describe-sub-user-permissions") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-black-list-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --sub-user --page-number --page-size " -- $cur) ) ;; - "disable-web-rule-black-list") + "add-permissions-to-sub-user") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --sub-user --add-permissions-info " -- $cur) ) ;; - "disable-black-list-rule-of-web-rule") + "remove-permission-of-sub-user") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-black-list-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --permission-id --sub-user " -- $cur) ) ;; - "describe-web-rule-white-list-usage") + "enable-sub-user-access-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --sub-user --access-key " -- $cur) ) ;; - "describe-white-list-rules-of-web-rule") + "disable-sub-user-access-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --sub-user --access-key " -- $cur) ) ;; - "create-white-list-rule-of-web-rule") + "delete-sub-user-access-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-white-list-rule-spec " -- $cur) ) + -W "-h --help --headers --input-json --sub-user --access-key " -- $cur) ) ;; - "describe-white-list-rule-of-web-rule") + "create-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-white-list-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --create-policy-info " -- $cur) ) ;; - "modify-white-list-rule-of-web-rule") + "describe-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-white-list-rule-id --web-white-list-rule-spec " -- $cur) ) + -W "-h --help --headers --input-json --policy-name " -- $cur) ) ;; - "delete-white-list-rule-of-web-rule") + "update-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-white-list-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --policy-name --update-policy-info " -- $cur) ) ;; - "enable-web-rule-white-list") + "delete-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --policy-name " -- $cur) ) ;; - "enable-white-list-rule-of-web-rule") + "update-policy-description") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-white-list-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --policy-name --update-policy-description-info " -- $cur) ) ;; - "disable-web-rule-white-list") + "describe-policies") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --keyword --query-type --sort " -- $cur) ) ;; - "disable-white-list-rule-of-web-rule") + "create-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-white-list-rule-id " -- $cur) ) + -W "-h --help --headers --input-json --create-group-info " -- $cur) ) ;; - "describe-web-rule-black-list-geo-areas") + "describe-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --group-name " -- $cur) ) ;; - "describe-web-rule-white-list-geo-areas") + "update-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --group-name --update-group-info " -- $cur) ) ;; - "describe-web-rule-rsgeo-areas") + "delete-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --group-name " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-group-sub-users") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --group-name --page-number --page-size " -- $cur) ) ;; - esac - ;; - - "ssl") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-certs") + "describe-groups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --domain-name --cert-ids " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --keyword --sort " -- $cur) ) ;; - "describe-cert") + "describe-attached-group-policies") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --cert-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --group-name " -- $cur) ) ;; - "delete-certs") + "detach-group-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --cert-id " -- $cur) ) + -W "-h --help --headers --input-json --group-name --policy-name " -- $cur) ) ;; - "upload-cert") + "attach-group-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --cert-name --key-file --cert-file --alias-name " -- $cur) ) + -W "-h --help --headers --input-json --group-name --policy-name " -- $cur) ) ;; - "download-cert") + "remove-sub-user-from-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --cert-id --server-type " -- $cur) ) + -W "-h --help --headers --input-json --group-name --sub-user " -- $cur) ) ;; - "update-cert-name") + "add-sub-user-to-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --cert-id --cert-name " -- $cur) ) + -W "-h --help --headers --input-json --group-name --sub-user " -- $cur) ) ;; - "update-cert") + "create-role") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --cert-id --key-file --cert-file " -- $cur) ) + -W "-h --help --headers --input-json --create-role-info " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-role") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --role-name " -- $cur) ) ;; - esac - ;; - - "domainservice") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-action-log") + "delete-role") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --start-time --end-time --key-word --success --type " -- $cur) ) + -W "-h --help --headers --input-json --role-name " -- $cur) ) ;; - "describe-domains") + "update-assume-role-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --domain-name --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --role-name --update-assume-role-policy-info " -- $cur) ) ;; - "create-domain") + "describe-roles") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pack-id --domain-name --domain-id --buy-type --time-span --time-unit --billing-type " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --role-name --type --sort " -- $cur) ) ;; - "modify-domain") + "attach-role-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --domain-name " -- $cur) ) + -W "-h --help --headers --input-json --role-name --policy-name " -- $cur) ) ;; - "delete-domain") + "detach-role-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --role-name --policy-name " -- $cur) ) ;; - "describe-domain-query-count") + "describe-role-policies") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --domain-name --start --end " -- $cur) ) + -W "-h --help --headers --input-json --role-name --page-number --page-size --keyword --sort " -- $cur) ) ;; - "describe-domain-query-traffic") + "describe-user-access-keys") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --domain-name --start --end " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-resource-record") + "create-user-access-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --page-number --page-size --search " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "create-resource-record") + "enabled-user-access-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --access-key " -- $cur) ) ;; - "modify-resource-record") + "disabled-user-access-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --resource-record-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --access-key " -- $cur) ) ;; - "delete-resource-record") + "delete-user-access-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --resource-record-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --access-key " -- $cur) ) ;; - "modify-resource-record-status") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "iothub") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "list-product-abilities") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --resource-record-id --action " -- $cur) ) + -W "-h --help --headers --input-json --region-id --product-key --page-number --page-size --filters " -- $cur) ) ;; - "describe-view-tree") + "import-thing-model") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --load-mode --pack-id --view-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --product-key --thing-model " -- $cur) ) ;; - "batch-set-resource-records") + "export-thing-model") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --product-key " -- $cur) ) ;; - "describe-user-view") + "describe-thing-shadow") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --view-id --view-name --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --identifier --product-key " -- $cur) ) ;; - "create-user-view") + "update-thing-shadow") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --identifier --product-key --state --version " -- $cur) ) ;; - "delete-user-view") + "invoke-thing-service") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --identifier --product-key --name --input " -- $cur) ) ;; - "describe-user-view-ip") + "query-device-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --view-id --view-name --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --device-name --status --product-key --device-type --now-page --page-size --order --direction --parent-id " -- $cur) ) ;; - "create-user-view-ip") + "update-device") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --device-id --model --manufacturer --description --status " -- $cur) ) ;; - "delete-user-view-ip") + "add-device") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --device-name --product-key --model --manufacturer --description " -- $cur) ) ;; - "describe-monitor") + "query-device-detail") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --page-index --page-size --search-value " -- $cur) ) + -W "-h --help --headers --input-json --device-name --region-id --product-key " -- $cur) ) ;; - "create-monitor") + "remove-device") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --sub-domain-name " -- $cur) ) + -W "-h --help --headers --input-json --device-name --region-id --product-key " -- $cur) ) ;; - "modify-monitor") + "remove-device-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --update-monitor " -- $cur) ) + -W "-h --help --headers --input-json --region-id --device-id " -- $cur) ) ;; - "describe-monitor-target") + "list-products") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --sub-domain-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "create-monitor-target") + "create-product") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --sub-domain-name --targets " -- $cur) ) + -W "-h --help --headers --input-json --region-id --product-name --product-type --product-description " -- $cur) ) ;; - "modify-monitor-status") + "describe-product") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --monitor-id --action --switch-target " -- $cur) ) + -W "-h --help --headers --input-json --region-id --product-key " -- $cur) ) ;; - "delete-monitor") + "update-product") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --monitor-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --product-key --product-name --product-description --dynamic-register " -- $cur) ) ;; - "describe-monitor-alarm") + "delete-product") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --page-index --page-size --search-value " -- $cur) ) + -W "-h --help --headers --input-json --region-id --product-key " -- $cur) ) ;; "generate-skeleton") @@ -1527,24 +2925,20 @@ _jdc_complete() esac ;; - "jmr") + "sms") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-cluster") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) - ;; - "delete-cluster") + "batch-send") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --template-id --sign-id --phone-list --params " -- $cur) ) ;; - "describe-clusters") + "status-report") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --sequence-number --phone-list " -- $cur) ) ;; - "create-cluster") + "reply") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cluster-spec --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --app-id --data-date --phone-list " -- $cur) ) ;; "generate-skeleton") @@ -1553,24 +2947,36 @@ _jdc_complete() esac ;; - "oss") + "resourcetag") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "list-buckets") + "describe-resources") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --resource-vo " -- $cur) ) ;; - "put-bucket") + "describe-tags") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --bucketname " -- $cur) ) + -W "-h --help --headers --input-json --region-id --tag-keys-vo " -- $cur) ) ;; - "delete-bucket") + "describe-keys") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --bucketname " -- $cur) ) + -W "-h --help --headers --input-json --region-id --tag-keys-vo " -- $cur) ) ;; - "head-bucket") + "describe-values") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --bucketname " -- $cur) ) + -W "-h --help --headers --input-json --region-id --tag-values-vo " -- $cur) ) + ;; + "tag-resources") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --tag-resources " -- $cur) ) + ;; + "un-tag-resources") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --un-tag-resources " -- $cur) ) + ;; + "query-resource") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --query-resource " -- $cur) ) ;; "generate-skeleton") @@ -1579,138 +2985,108 @@ _jdc_complete() esac ;; - "redis") + "jcq") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-cache-instances") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --sorts --tag-filters " -- $cur) ) - ;; - "create-cache-instance") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance --charge " -- $cur) ) - ;; - "describe-cache-instance") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) - ;; - "modify-cache-instance-attribute") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --cache-instance-name --cache-instance-description " -- $cur) ) - ;; - "delete-cache-instance") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) - ;; - "modify-cache-instance-class") + "describe-access-point") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --cache-instance-class --shard-number " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name " -- $cur) ) ;; - "reset-cache-instance-password") + "describe-topics") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --password " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-size --page-number --topic-filter --tag-filters " -- $cur) ) ;; - "describe-instance-config") + "create-topic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --type --description " -- $cur) ) ;; - "modify-instance-config") + "describe-topic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --instance-config " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name " -- $cur) ) ;; - "describe-analysis-time") + "delete-topic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name " -- $cur) ) ;; - "modify-analysis-time") + "describe-dead-letter-numbers") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --analysis-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --consumer-group-id --page-number --page-size " -- $cur) ) ;; - "describe-cache-analysis-list") + "describe-dead-letter-numbers-with-topic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --date " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --page-number --page-size " -- $cur) ) ;; - "create-cache-analysis") + "list-dead-letters") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --page-number --page-size --start-time --end-time " -- $cur) ) ;; - "describe-cache-analysis-result") + "delete-dead-letters") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --task-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --message-ids " -- $cur) ) ;; - "describe-backups") + "resend-dead-letters") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --page-number --page-size --start-time --end-time --base-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --message-ids " -- $cur) ) ;; - "create-backup") + "describe-permission") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --file-name --backup-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name " -- $cur) ) ;; - "describe-backup-policy") + "add-permission") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --permission --target-user-id " -- $cur) ) ;; - "modify-backup-policy") + "remove-permission") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --backup-time --backup-period " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --permission --target-user-id " -- $cur) ) ;; - "restore-instance") + "describe-consumer-group-ids") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --base-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-download-url") + "describe-subscriptions") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --base-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-filter --page-size --page-number " -- $cur) ) ;; - "describe-cluster-info") + "create-subscription") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --message-invisible-time-in-seconds --dlq-enable --max-retry-times " -- $cur) ) ;; - "describe-ip-white-list") + "describe-subscription") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id " -- $cur) ) ;; - "modify-ip-white-list") + "modify-subscription-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --ip-white-list " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --max-retry-times --message-invisible-time-in-seconds --dlq-enable " -- $cur) ) ;; - "describe-slow-log") + "delete-subscription") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cache-instance-id --page-number --page-size --start-time --end-time --shard-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id " -- $cur) ) ;; - "describe-instance-class") + "clean-messages") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --redis-version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id " -- $cur) ) ;; - "describe-user-quota") + "reset-consume-offset") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --time " -- $cur) ) ;; - "describe-spec-config") + "describe-messages") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) - ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --start-time --end-time --page-size --page-number " -- $cur) ) ;; - esac - ;; - - "billing") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "query-bill-summary") + "describe-message") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --start-time --end-time --app-code --service-code --resource-ids --tags --page-index --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --message-id " -- $cur) ) ;; - "query-bill-detail") + "describe-message-trace") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --start-time --end-time --app-code --service-code --billing-type --resource-ids --tags --page-index --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --message-id " -- $cur) ) ;; - "calculate-total-price") + "describe-messages-by-business-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cmd --order-list --operate-time --promotion-info --client-type --package-count --process-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --topic-name --business-id " -- $cur) ) ;; "generate-skeleton") @@ -1719,50 +3095,40 @@ _jdc_complete() esac ;; - "deploy") + "ias") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-apps") + "apps") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --pin --app-name --client-id --multi-tenant --state --scope --start-time --end-time --account-type --page-index --page-size --offset " -- $cur) ) ;; - "describe-app") + "app-detail") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --app-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-id " -- $cur) ) ;; - "create-deploy") + "state") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --group-id --desc --deploy-source --deploy-cmd --cmd-source --cmd-type --product-type --download-url --md5 --compile-project --compile-series --oss-space --oss-dir --file-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-deploy") + "create-app") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --deploy-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-name --token-endpoint-auth-method --grant-types --redirect-uris --client-uri --logo-uri --tos-uri --policy-uri --scope --jwks-uri --jwks --contacts --extension --access-token-validity-seconds --refresh-token-validity-seconds --multi-tenant --secret --user-type " -- $cur) ) ;; - "describe-groups") + "get-app") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-id " -- $cur) ) ;; - "describe-group") + "update-app") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --group-id " -- $cur) ) - ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-id --client-name --token-endpoint-auth-method --grant-types --redirect-uris --client-uri --logo-uri --tos-uri --policy-uri --scope --jwks-uri --jwks --contacts --extension --access-token-validity-seconds --refresh-token-validity-seconds --multi-tenant --secret --user-type " -- $cur) ) ;; - esac - ;; - - "sop") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "get-security-token") + "delete-app") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --get-security-token-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-id " -- $cur) ) ;; - "get-sensitive-op-setting") + "get-apps") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --action " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; "generate-skeleton") @@ -1771,666 +3137,652 @@ _jdc_complete() esac ;; - "function") + "jdfusion") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "list-alias") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name " -- $cur) ) - ;; - "create-alias") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name --alias-name --description --version " -- $cur) ) - ;; - "get-alias") + "get-vpc-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name --alias-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "update-alias") + "delete-vpc-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name --alias-name --description --version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "delete-alias") + "get-vpcs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name --alias-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "list-function") + "create-vpc") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --list-all --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc " -- $cur) ) ;; - "create-function") + "get-vm-instances-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name --description --entrance --memory --run-time --over-time --version --code --environment --log-set-id --log-topic-id --vpc-id --subnet-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "get-function") + "delete-vm-instance-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "update-function") + "get-vm-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name --description --entrance --memory --run-time --over-time --version --code --environment --log-set-id --log-topic-id --vpc-id --subnet-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "delete-function") + "create-vm-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vm " -- $cur) ) ;; - "invoke") + "stop-vm-instance-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name --version-name --event " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "async-invoke") + "start-vm-instance-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name --version-name --event " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "get-trigger") + "reboot-vm-instance-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name --version-name --trigger-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "list-version") + "get-vpc-vserver-groups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --slbid " -- $cur) ) ;; - "create-version") + "create-vpc-vserver-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vserver-group " -- $cur) ) ;; - "get-version") + "get-vserver-groups-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name --version-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "delete-version") + "delete-vserver-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --function-name --version-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "get-cloud-infos") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --driver " -- $cur) ) ;; - esac - ;; - - "portal") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-product") + "regist-cloud-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --url --lang --ak " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cloud " -- $cur) ) ;; - "describe-products-by-id") + "get-cloud-info-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --ak " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cloud-id " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "unregist-cloud-info") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --cloud-id " -- $cur) ) ;; - esac - ;; - - "jdccs") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-alarms") + "valid-cloud-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --resource-type --resource-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cloud-id " -- $cur) ) ;; - "describe-alarm") + "get-rds-databases-by-inst-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --alarm-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id " -- $cur) ) ;; - "describe-alarm-history") + "create-rds-database") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --alarm-id --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id --database " -- $cur) ) ;; - "describe-metrics") + "get-rds-database-by-inst-id-and-db-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id --db-name " -- $cur) ) ;; - "describe-metric-data") + "delete-rds-database") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --idc --metric --resource-id --start-time --end-time --time-interval --ip --port " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id --db-name " -- $cur) ) ;; - "last-downsample") + "get-buckets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --idc --metric --resource-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-bandwidth-traffics") + "create-bucket") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --idc --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bucket " -- $cur) ) ;; - "describe-bandwidth-traffic") + "get-bucket-by-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --idc --bandwidth-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) ;; - "describe-traffic-sampling") + "delete-bucket") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --resource-id --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) ;; - "describe-idcs") + "get-bucket-files") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name --marker " -- $cur) ) ;; - "describe-rooms") + "get-vpc-slb-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --idc --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "describe-cabinets") + "delete-vpc-slb-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --idc --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "describe-cabinet") + "get-vpc-slbs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --idc --cabinet-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-devices") + "create-vpc-slb") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --idc --page-number --page-size --cabinet-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --slb " -- $cur) ) ;; - "describe-device") + "start-slb") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --idc --device-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "describe-ips") + "stop-slb") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --idc --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "describe-bandwidths") + "delete-slbs-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --idc --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --listener-port " -- $cur) ) ;; - "describe-bandwidth") + "start-slb-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --idc --bandwidth-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --listener-port " -- $cur) ) ;; - "describe-tickets") + "stop-slb-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --listener-port " -- $cur) ) ;; - "describe-ticket") + "get-rds-specification") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --ticket-no " -- $cur) ) + -W "-h --help --headers --input-json --region-id --engine " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "get-vm-instance-types") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --az " -- $cur) ) ;; - esac - ;; - - "logs") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-collect-info") + "get-vpc-network-interface-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --collect-info-uid " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "update-collect-info") + "delete-vpc-network-interface-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --collect-info-uid --enabled --resource-type --resources --log-path --log-file --log-filters --filter-enabled " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "describe-collect-resources") + "get-vpc-network-interfaces") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --collect-info-uid --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vm-id " -- $cur) ) ;; - "update-collect-resources") + "create-vpc-network-interface") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --collect-info-uid --action --resources " -- $cur) ) + -W "-h --help --headers --input-json --region-id --net-interface " -- $cur) ) ;; - "create-collect-info") + "attach-vpc-network-interface-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --logtopic-uid --enabled --app-code --service-code --resource-type --resources --template-uid --log-path --log-file --log-filters --filter-enabled " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --attach " -- $cur) ) ;; - "describe-logd-ca") + "detach-vpc-network-interface-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --detach " -- $cur) ) ;; - "describe-instance-collect-confs") + "get-disks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vm-id " -- $cur) ) ;; - "describe-logsets") + "create-disk") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --disk " -- $cur) ) ;; - "create-logset") + "get-disk-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name --description --life-cycle " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "describe-logset") + "remove-disk-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --logset-uid " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "update-logset") + "attach-disk-to-vm-instance-by-disk-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --logset-uid --description --life-cycle " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --attach " -- $cur) ) ;; - "delete-logset") + "detach-disk-to-vm-instance-by-disk-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --logset-uids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --detach " -- $cur) ) ;; - "describe-logtopics") + "get-rds-accounts-by-inst-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --logset-uid --page-number --page-size --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id " -- $cur) ) ;; - "create-logtopic") + "create-rds-accounts") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --logset-uid --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id --account " -- $cur) ) ;; - "delete-logtopic") + "get-rds-accounts-by-inst-id-and-account-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id --account-name " -- $cur) ) ;; - "describe-logtopic") + "delete-rds-account") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --logtopic-uid " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id --account-name " -- $cur) ) ;; - "update-logtopic") + "grant-rds-account") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --logtopic-uid --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id --account-name --db-privilege-info " -- $cur) ) ;; - "put") + "revoke-rds-account") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --logtopic-uid --stream --timestamp --tags --entries " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id --account-name --db-name " -- $cur) ) ;; - "search-log-context") + "grant-rds-accounts-by-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid --anchor --direction --filters --id --line-size --time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id --account-name --info " -- $cur) ) ;; - "search") + "get-vpc-eips") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid --action --expr --case-sensitive --start-time --end-time --page-number --page-size --sort --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "create-vpc-eip") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --allocate " -- $cur) ) ;; - esac - ;; - - "clouddnsservice") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "get-action-log") + "get-vpc-eip-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --start-time --end-time --key-word --success --type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "get-domains") + "delete-vpc-eip-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --domain-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "add-domain") + "associate-vpc-eip-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pack-id --domain-name --domain-id --buy-type --time-span --time-unit --billing-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --associate " -- $cur) ) ;; - "del-domain") + "disassociate-vpc-eip-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --unassociate " -- $cur) ) ;; - "update-domain") + "get-task-info-history-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-name --id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --task " -- $cur) ) ;; - "get-domain-query-count") + "get-task-info-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --domain-name --start --end " -- $cur) ) + -W "-h --help --headers --input-json --region-id --task --file-name " -- $cur) ) ;; - "get-domain-query-traffic") + "get-transfer-tasks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --domain-name --start --end " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "search-rr") + "create-transfer-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --task " -- $cur) ) ;; - "get-view-tree") + "get-transfer-task-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --load-mode --pack-id --view-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "add-rr") + "edit-transfer-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --task " -- $cur) ) ;; - "update-rr") + "delete-transfer-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "operate-rr") + "start-transfer-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --ids --action " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "batch-set-dns-resolve") + "stop-transfer-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "add-user-view") + "get-transfer-task-progress") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "del-user-view") + "get-transfer-task-failed-files") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "get-user-view") + "get-vm-keypairs-by-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --view-id --view-name --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) ;; - "add-user-view-ip") + "delete-vm-keypair-by-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) ;; - "del-user-view-ip") + "get-vm-keypairs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --req " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "get-user-view-ip") + "create-vm-keypair") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --view-id --view-name --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --keypair " -- $cur) ) ;; - "get-monitor") + "get-vpc-security-group-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --page-index --page-size --search-value " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "add-monitor") + "delete-vpc-security-group-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --sub-domain-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "get-targets") + "get-vpc-security-groups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --sub-domain-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "add-monitor-target") + "create-vpc-security-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --sub-domain-name --targets " -- $cur) ) + -W "-h --help --headers --input-json --region-id --security-group " -- $cur) ) ;; - "operate-monitor") + "create-security-groups-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --action --ids --switch-target " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --sg-rule " -- $cur) ) ;; - "update-monitor") + "delete-security-groups-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --update-monitor " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --rule-type --protocol --from-port --to-port --nic-type --policy --priority --cidr-ip " -- $cur) ) ;; - "get-monitor-alarm-info") + "get-lb-http-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-id --page-index --page-size --search-value " -- $cur) ) + -W "-h --help --headers --input-json --region-id --slbid " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "create-vpc-lbhttp-listener") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --http-listener " -- $cur) ) ;; - esac - ;; - - "cps") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-elastic-ips") + "get-vm-images") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --status --include-lb --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --image-source " -- $cur) ) ;; - "apply-elastic-ips") + "get-vpc-subnet-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-token --elastic-ip-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "describe-elastic-ip") + "delete-vpc-subnet-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "modify-elastic-ip-bandwidth") + "get-vpc-subnets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --elastic-ip-id --client-token --bandwidth " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-device-types") + "create-vpc-subnet") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --az " -- $cur) ) + -W "-h --help --headers --input-json --region-id --subnet " -- $cur) ) ;; - "describe-os") + "get-rds-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --device-type --os-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-device-raids") + "create-rds-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --device-type --volume-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance " -- $cur) ) ;; - "describe-instance") + "get-rds-by-inst-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id " -- $cur) ) ;; - "describe-instances") + "delete-rds-by-inst-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --az --name --network-type --device-type --subnet-id --keypair-id --enable-internet --private-ip --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --inst-id " -- $cur) ) ;; - "create-instances") + "get-deployments") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-token --instance-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-instance-name") + "create-deployment") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --deployment " -- $cur) ) ;; - "modify-instance") + "reverse-deployment") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --reverse " -- $cur) ) ;; - "describe-instance-raid") + "get-deployments-by-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "describe-instance-status") + "edit-deployment") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --deployment " -- $cur) ) ;; - "restart-instance") + "delete-deployment") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "stop-instance") + "clone-deployment") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --deployment " -- $cur) ) ;; - "start-instance") + "dryrun-deployment") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "reinstall-instance") + "apply-deployment") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --client-token --instance-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --apply " -- $cur) ) ;; - "modify-bandwidth") + "get-deployment-result") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --client-token --bandwidth " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "associate-elastic-ip") + "get-deployment-versions") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --client-token --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "disassociate-elastic-ip") + "get-deployments-version") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --client-token --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --version_id " -- $cur) ) ;; - "reset-password") + "rollback-deployments-version") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --client-token --password " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --version_id " -- $cur) ) ;; - "describe-instance-monitor-info") + "get-deployments-results-by-id-record") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --start-time --end-time --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --record " -- $cur) ) ;; - "describe-keypairs") + "get-regions") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --name --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "create-keypairs") + "get-regions-available-zones") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-token --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --region " -- $cur) ) ;; - "import-keypairs") + "get-channels") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-token --name --public-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-keypair") + "create-channel") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --keypair-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --channel " -- $cur) ) ;; - "delete-keypairs") + "delete-channel") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --keypair-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "describe-listeners") + "start-channel") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --name --load-balancer-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "create-listener") + "stop-channel") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-token --listener-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) ;; - "modify-listener") + "get-datasources") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --listener-id --algorithm --sticky-session --real-ip --name --description --health-check --health-check-timeout --health-check-interval --healthy-threshold --unhealthy-threshold --server-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-listener") + "create-datasource") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --listener-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --datasource " -- $cur) ) ;; - "delete-listener") + "delete-datasource") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --listener-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + ;; + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "detection") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "get-site-monitor") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --name-or-addr --name --id --task-type --page-number --page-size --with-stats --with-deleted --time-interval --filters " -- $cur) ) ;; - "start-listener") + "create-site-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --listener-id --client-token " -- $cur) ) + -W "-h --help --headers --input-json --address --advance-checked --created-time --cycle --default-source --dns-option --enabled --ftp-option --hawkeye-id --http-option --id --is-deleted --name --pin --ping-option --pop3option --port --smtp-option --source --stats --task-type --tcp-option --udp-option --updated-time " -- $cur) ) ;; - "stop-listener") + "update-site-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --listener-id --client-token " -- $cur) ) + -W "-h --help --headers --input-json --address --advance-checked --created-time --cycle --default-source --dns-option --enabled --ftp-option --hawkeye-id --http-option --id --is-deleted --name --pin --ping-option --pop3option --port --smtp-option --source --stats --task-type --tcp-option --udp-option --updated-time " -- $cur) ) ;; - "describe-load-balancers") + "delete-site-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --status --name --vpc-id --bind-eip --filters " -- $cur) ) + -W "-h --help --headers --input-json --filters " -- $cur) ) ;; - "create-load-balancer") + "enable-site-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-token --load-balancer-spec " -- $cur) ) + -W "-h --help --headers --input-json --list " -- $cur) ) ;; - "modify-load-balancer") + "validate-site-monitor-address") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --address " -- $cur) ) ;; - "describe-load-balancer") + "get-site-monitor-data-points") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id " -- $cur) ) + -W "-h --help --headers --input-json --id --start-time --end-time " -- $cur) ) ;; - "start-load-balancer") + "get-site-monitor-source") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id --client-token " -- $cur) ) + -W "-h --help --headers --input-json " -- $cur) ) ;; - "stop-load-balancer") + "test-site-monitor") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id --client-token " -- $cur) ) + -W "-h --help --headers --input-json --address --advance-checked --created-time --cycle --default-source --dns-option --enabled --ftp-option --hawkeye-id --http-option --id --is-deleted --name --pin --ping-option --pop3option --port --smtp-option --source --stats --task-type --tcp-option --udp-option --updated-time " -- $cur) ) ;; - "associate-elastic-ip-lb") + "describe-agent-status") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id --client-token --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --filters " -- $cur) ) ;; - "disassociate-elastic-ip-lb") + "describe-metric-data-am") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id --client-token --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --resource-id --start-time --end-time --time-interval " -- $cur) ) ;; - "describe-regiones") + "create-probe-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --network-type " -- $cur) ) + -W "-h --help --headers --input-json --client-token --create-probe-task-spec " -- $cur) ) ;; - "describe-cpslbregions") + "delete-probe-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) + -W "-h --help --headers --input-json --probe-task-ids " -- $cur) ) ;; - "describe-route-table") + "describe-probe-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --route-table-id " -- $cur) ) + -W "-h --help --headers --input-json --probe-task-id " -- $cur) ) ;; - "describe-route-tables") + "update-probe-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --name --vpc-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --probe-task-id --http-body --http-cookie --http-header --http-type --name --probes " -- $cur) ) ;; - "describe-servers") + "describe-probe-history") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --server-group-id --page-number --page-size --listener-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --probe-task-id --probe-id --start-time --end-time " -- $cur) ) ;; - "add-servers") + "discribe-probes") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --server-group-id --client-token --server-spec " -- $cur) ) + -W "-h --help --headers --input-json --probe-task-id --filters " -- $cur) ) ;; - "modify-server") + "probe-task-enable") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --server-group-id --server-id --weight " -- $cur) ) + -W "-h --help --headers --input-json --enabled --task-id " -- $cur) ) ;; - "remove-server") + "describe-probe-tasks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --server-group-id --server-id " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --name --type --time-interval --with-stats --with-deleted --enabled --filters " -- $cur) ) ;; - "describe-server-groups") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "iotlink") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "card-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --name --load-balancer-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --iccid " -- $cur) ) ;; - "create-server-group") + "real-name-query-iot") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-token --server-group-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --iccid " -- $cur) ) ;; - "describe-server-group") + "gprs-status-by-imsi") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --server-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --imsi " -- $cur) ) ;; - "modify-server-group") + "on-off-status-by-imsi") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --server-group-id --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --imsi " -- $cur) ) ;; - "delete-server-group") + "life-status-by-imsi") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --server-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --imsi " -- $cur) ) ;; - "describe-basic-subnet") + "gprs-realtime-info-by-imsi") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --az " -- $cur) ) + -W "-h --help --headers --input-json --region-id --imsi " -- $cur) ) ;; - "describe-subnets") + "gprs-status") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --az --name --vpc-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --iccid " -- $cur) ) ;; - "create-subnet") + "on-off-status") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-token --subnet-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --iccid " -- $cur) ) ;; - "describe-subnet") + "life-status") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --subnet-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --iccid " -- $cur) ) ;; - "modify-subnet") + "gprs-realtime-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --subnet-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --iccid " -- $cur) ) ;; - "delete-subnet") + "open-iot-card") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --subnet-id --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --iccids " -- $cur) ) ;; - "describe-vpc") + "close-iot-card") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --iccids " -- $cur) ) ;; - "modify-vpc") + "open-iot-flow") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --iccids " -- $cur) ) ;; - "delete-vpc") + "close-iot-flow") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-id --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --iccids " -- $cur) ) ;; - "describe-vpcs") + "search") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --name --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --request-type --request-param " -- $cur) ) ;; - "create-vpc") + "operate") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-token --vpc-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --request-type --request-param " -- $cur) ) ;; "generate-skeleton") @@ -2439,1004 +3791,1022 @@ _jdc_complete() esac ;; - "cdn") + "renewal") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "query-domains-log") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domains --start-time --end-time --interval --log-type " -- $cur) ) - ;; - "query-domain-log") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --start-time --end-time --interval --log-type --page-size --page-number " -- $cur) ) - ;; - "query-online-billing-type") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) - ;; - "set-online-billing-type") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --all-type " -- $cur) ) - ;; - "query-band") + "set-renewal") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --area --isp --period " -- $cur) ) + -W "-h --help --headers --input-json --region-id --set-renewal-param " -- $cur) ) ;; - "query-band-with-area") + "query-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --area --isp --period " -- $cur) ) + -W "-h --help --headers --input-json --region-id --query-instance-param " -- $cur) ) ;; - "query-domain-config-status") + "renew-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --task-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --renew-instance-param " -- $cur) ) ;; - "query-area-isp-list") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; - "preview-certificate") + esac + ;; + + "yunding") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "put-product-metric-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --content " -- $cur) ) + -W "-h --help --headers --input-json --region-id --app-code --service-code --region --resource-id --data-points " -- $cur) ) ;; - "query-default-http-header-key") + "put-product-metric-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) + -W "-h --help --headers --input-json --region-id --app-code --service-code --region --resource-id --data-points " -- $cur) ) ;; - "query-ip-black-list") + "describe-subnets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --type --filters " -- $cur) ) ;; - "set-ip-black-list") + "create-subnet") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --ips " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-id --subnet-name --address-prefix --route-table-id --description --ip-mask-len " -- $cur) ) ;; - "operate-ip-black-list") + "describe-subnet") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --subnet-id " -- $cur) ) ;; - "create-cache-rule") + "delete-subnet") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --weight --ttl --contents --cache-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --subnet-id " -- $cur) ) ;; - "update-cache-rule") + "assign-secondary-ips") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --weight --ttl --contents --cache-type --config-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-interface-id --force --secondary-ips --secondary-ip-count --secondary-ip-mask-len --secondary-ip-address " -- $cur) ) ;; - "delete-cache-rule") + "unassign-secondary-ips") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --config-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-interface-id --secondary-ips --secondary-cidrs " -- $cur) ) ;; - "query-http-header") + "describe-network-interface") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-interface-id " -- $cur) ) ;; - "set-http-header") + "delete-network-interface") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --header-type --header-name --header-value " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-interface-id " -- $cur) ) ;; - "delete-http-header") + "describe-network-interfaces") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --header-type --header-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "set-video-draft") + "create-network-interface") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --subnet-id --az --network-interface-name --primary-ip-address --secondary-ip-addresses --secondary-ip-count --security-groups --sanity-check --description " -- $cur) ) ;; - "set-range") + "describe-tasks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --status " -- $cur) ) + -W "-h --help --headers --input-json --instance-id " -- $cur) ) ;; - "set-ignore-query-string") + "describe-rds-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --type " -- $cur) ) ;; - "query-user-agent") + "describe-rds-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "set-user-agent-config") + "describe-instance-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --user-agent-type --user-agent-list " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "query-accesskey-config") + "describe-rds-white-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "set-accesskey-config") + "modify-rds-white-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --accesskey-type --accesskey-key --accesskey-keep " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --ips " -- $cur) ) ;; - "set-refer") + "describe-rds-accounts") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --refer-type --refer-list --allow-no-refer-header --allow-null-refer-header " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size " -- $cur) ) ;; - "query-monitor") + "create-rds-account") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-name --account-password " -- $cur) ) ;; - "set-monitor") + "delete-rds-account") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --cycle --monitor-path --http-request-header " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-name " -- $cur) ) ;; - "stop-monitor") + "grant-rds-privilege") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-name --account-privileges " -- $cur) ) ;; - "set-source") + "revoke-privilege") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --source-type --back-source-type --ip-source --domain-source --oss-source --default-source-host " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-name --db-names " -- $cur) ) ;; - "operate-share-cache") + "describe-rds-databases") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --db-name --page-number --page-size " -- $cur) ) ;; - "set-http-type") + "create-rds-database") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --http-type --certificate --rsa-key --jump-type --cert-from --ssl-cert-id --sync-to-ssl --cert-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --db-name --character-set-name " -- $cur) ) ;; - "query-follow-redirect") + "delete-rds-database") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --db-name " -- $cur) ) ;; - "set-follow-redirect") + "describe-yd-rds-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --app-key " -- $cur) ) ;; - "query-follow-source-protocol") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; - "set-follow-source-protocol") + esac + ;; + + "containerregistry") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "create-repository") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --registry-name --repository-name --description " -- $cur) ) ;; - "set-domain-config") + "describe-repositories") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --http-type --back-source-type --jump-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --filters --registry-name --page-number --page-size " -- $cur) ) ;; - "query-domain-all-config-classify") + "delete-repository") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --registry-name --repository-name --force " -- $cur) ) ;; - "execute-domain-copy") + "check-repository-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --copy-domains --config-keys " -- $cur) ) + -W "-h --help --headers --input-json --region-id --registry-name --repository-name " -- $cur) ) ;; - "query-domain-group-list") + "describe-images") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --share-cache --page-number --page-size --primary-domain --domain-group-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --filters --page-number --page-size " -- $cur) ) ;; - "query-domain-group-detail") + "delete-image") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --registry-name --repository-name --image-digest --image-tag --image-tag-status " -- $cur) ) ;; - "query-domains-not-in-group") + "describe-registries") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "update-domain-group") + "create-registry") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --id --domains --primary-domain --share-cache --domain-group-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --registry-name --description " -- $cur) ) ;; - "create-domain-group") + "describe-registry") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --share-cache --primary-domain --domain-group-name --domains " -- $cur) ) + -W "-h --help --headers --input-json --region-id --registry-name " -- $cur) ) ;; - "batch-delete-domain-group") + "delete-registry") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --registry-name " -- $cur) ) ;; - "get-domain-list") + "check-registry-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-word --page-number --page-size --status --type --accelerate-region " -- $cur) ) + -W "-h --help --headers --input-json --region-id --registry-name " -- $cur) ) ;; - "get-domain-list-by-filter") + "describe-quotas") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-word --page-number --page-size --status --type --accelerate-region --tag-filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --filters " -- $cur) ) ;; - "get-domain-detail") + "get-authorization-token") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --registry-name --expired-after-hours " -- $cur) ) ;; - "create-domain") + "describe-authorization-tokens") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --source-type --cdn-type --back-source-type --daily-band-width --quaility --max-file-size --min-file-size --sum-file-size --avg-file-size --default-source-host --http-type --ip-source --domain-source --oss-source --accelerate-region " -- $cur) ) + -W "-h --help --headers --input-json --region-id --registry-name --filters --page-number --page-size " -- $cur) ) ;; - "delete-domain") + "release-authorization-token") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --registry-name --authorization-token --force-all " -- $cur) ) ;; - "start-domain") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "partner") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "query-my-customer-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --customer-pin --alias-name --login-name --start-rel-time --end-rel-time --page-index --page-size " -- $cur) ) ;; - "stop-domain") + "get-total-consumption") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --start-time --end-time " -- $cur) ) ;; - "query-oss-buckets") + "get-each-consumption") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) + -W "-h --help --headers --input-json --region-id --start-time --end-time --pin --page-size --page-index " -- $cur) ) ;; - "batch-create") + "describe-customer-bill-by-product") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domains --source-type --cdn-type --back-source-type --daily-band-width --quaility --max-file-size --min-file-size --sum-file-size --avg-file-size --default-source-host --http-type --ip-source --domain-source --oss-source --accelerate-region " -- $cur) ) + -W "-h --help --headers --input-json --region-id --pin --start-time --end-time --page-size --page-index " -- $cur) ) ;; - "query-domain-config") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "lb") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-url-maps") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "check-whether-ip-belong-to-jcloud") + "create-url-map") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --ips " -- $cur) ) + -W "-h --help --headers --input-json --region-id --url-map-name --load-balancer-id --description " -- $cur) ) ;; - "set-live-domain-back-source") + "describe-url-map") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --source-type --back-source-type --default-source-host --domain-source --ip-source " -- $cur) ) + -W "-h --help --headers --input-json --region-id --url-map-id " -- $cur) ) ;; - "set-live-domain-ip-black-list") + "update-url-map") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --ips " -- $cur) ) + -W "-h --help --headers --input-json --region-id --url-map-id --description --url-map-name " -- $cur) ) ;; - "set-live-domain-refer") + "delete-url-map") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --refer-type --refer-list --allow-no-refer-header --allow-null-refer-header " -- $cur) ) + -W "-h --help --headers --input-json --region-id --url-map-id " -- $cur) ) ;; - "operate-live-domain-ip-black-list") + "add-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --black-ips-enable " -- $cur) ) + -W "-h --help --headers --input-json --region-id --url-map-id --rule-specs " -- $cur) ) ;; - "set-live-domain-back-source-host") + "update-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --source-host " -- $cur) ) + -W "-h --help --headers --input-json --region-id --url-map-id --rule-update-specs " -- $cur) ) ;; - "set-live-domain-access-key") + "delete-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --accesskey-type --accesskey-key --auth-life-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --url-map-id --rule-ids " -- $cur) ) ;; - "set-protocol-convert") + "describe-target-groups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --certificate --rsa-key --cert-from --ssl-cert-id --sync-to-ssl --cert-name --protocol-converts " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "delete-forbidden-stream") + "create-target-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --delete-streams " -- $cur) ) + -W "-h --help --headers --input-json --region-id --target-group-name --load-balancer-id --description --type " -- $cur) ) ;; - "query-push-domain-orapp-or-stream") + "describe-target-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --app --stream --limit " -- $cur) ) + -W "-h --help --headers --input-json --region-id --target-group-id " -- $cur) ) ;; - "batch-create-live-domain") + "update-target-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --play-domain --publish-domain --source-type --back-http-type --default-source-host --site-type --back-source-type --ip-source --domain-source --accelerate-region " -- $cur) ) + -W "-h --help --headers --input-json --region-id --target-group-id --description --target-group-name " -- $cur) ) ;; - "query-live-domain-detail") + "delete-target-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --target-group-id " -- $cur) ) ;; - "query-live-domain-apps") + "register-targets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --target-group-id --target-specs " -- $cur) ) ;; - "create-live-domain-prefecth-task") + "de-register-targets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --url-list --prefetch-time --action " -- $cur) ) + -W "-h --help --headers --input-json --region-id --target-group-id --target-ids " -- $cur) ) ;; - "query-live-prefetch-task") + "update-targets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --url-list " -- $cur) ) + -W "-h --help --headers --input-json --region-id --target-group-id --target-update-specs " -- $cur) ) ;; - "query-refresh-task-by-ids") + "describe-targets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --task-ids --keyword " -- $cur) ) + -W "-h --help --headers --input-json --region-id --target-group-id --page-number --page-size --filters " -- $cur) ) ;; - "query-refresh-task-by-id") + "describe-backends") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --task-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "create-refresh-task-for-callback") + "create-backend") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --task-type --url-items " -- $cur) ) + -W "-h --help --headers --input-json --region-id --backend-name --load-balancer-id --protocol --port --health-check-spec --algorithm --target-group-ids --ag-ids --proxy-protocol --description --session-stickiness --session-sticky-timeout --connection-draining-seconds --http-cookie-expire-seconds --http-forwarded-protocol --http-forwarded-port --http-forwarded-host --http-forwarded-vip --http-forwarded-client-port " -- $cur) ) ;; - "create-refresh-task-for-callback-v2") + "describe-backend") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --task-type --url-items " -- $cur) ) + -W "-h --help --headers --input-json --region-id --backend-id " -- $cur) ) ;; - "query-refresh-task") + "update-backend") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --keyword --task-id --task-status --task-type --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --backend-id --backend-name --health-check-spec --algorithm --target-group-ids --ag-ids --proxy-protocol --description --session-stickiness --session-sticky-timeout --connection-draining-seconds --http-cookie-expire-seconds --http-forwarded-protocol --http-forwarded-port --http-forwarded-host --http-forwarded-vip --http-forwarded-client-port --close-health-check " -- $cur) ) ;; - "create-refresh-task") + "delete-backend") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --task-type --urls " -- $cur) ) + -W "-h --help --headers --input-json --region-id --backend-id " -- $cur) ) ;; - "query-net-protection-rules") + "describe-target-health") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) + -W "-h --help --headers --input-json --region-id --backend-id " -- $cur) ) ;; - "set-net-protection-rules") + "describe-load-balancers") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --src-new-conn-limit-enable --dst-new-conn-limit-enable --datagram-range-min --datagram-range-max --dst-new-conn-limit-value --src-new-conn-limit-value --geo-black --ip-black --ip-white " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tags " -- $cur) ) ;; - "query-net-protection-rules-switch") + "create-load-balancer") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-name --subnet-id --type --azs --charge-spec --elastic-ip --private-ip-address --security-group-ids --description --delete-protection --user-tags " -- $cur) ) ;; - "set-net-protection-rules-switch") + "describe-load-balancer") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --switch-status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id " -- $cur) ) ;; - "query-geo-areas") + "update-load-balancer") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id --load-balancer-name --action --description --domain-enable --delete-protection --private-ip-address " -- $cur) ) ;; - "query-attack-type-count") + "delete-load-balancer") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id " -- $cur) ) ;; - "query-ddos-graph") + "associate-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id --elastic-ip-id " -- $cur) ) ;; - "search-attack-log") + "disassociate-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --page-number --page-size --sort-field --sort-rule " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id --elastic-ip-id " -- $cur) ) ;; - "get-all-upper-node-ip-list") + "associate-security-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id --security-group-ids " -- $cur) ) ;; - "get-ssl-cert-list") + "disassociate-security-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id --security-group-ids " -- $cur) ) ;; - "get-ssl-cert-detail") + "describe-listeners") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --ssl-cert-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "upload-cert") + "create-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --cert-name --key-file --cert-file --alias-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --listener-name --protocol --hsts-enable --hsts-max-age --port --backend-id --load-balancer-id --url-map-id --action --certificate-specs --connection-idle-time-seconds --description " -- $cur) ) ;; - "query-mix-statistics-data") + "describe-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --fields --area --isp --period --scheme " -- $cur) ) + -W "-h --help --headers --input-json --region-id --listener-id " -- $cur) ) ;; - "query-mix-statistics-with-area-data") + "update-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --fields --area --isp --period " -- $cur) ) + -W "-h --help --headers --input-json --region-id --listener-id --listener-name --status --hsts-enable --hsts-max-age --certificate-specs --connection-idle-time-seconds --backend-id --url-map-id --description " -- $cur) ) ;; - "query-mix-traffic-group-sum") + "delete-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --fields --area --isp --period --group-by " -- $cur) ) + -W "-h --help --headers --input-json --region-id --listener-id " -- $cur) ) ;; - "query-statistics-data") + "add-listener-certificates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --sub-domain --fields --area --isp --origin --period " -- $cur) ) + -W "-h --help --headers --input-json --region-id --listener-id --certificates " -- $cur) ) ;; - "query-statistics-data-group-by-area") + "update-listener-certificates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --sub-domain --fields --area --isp --origin --period --group-by --scheme " -- $cur) ) + -W "-h --help --headers --input-json --region-id --listener-id --certificates " -- $cur) ) ;; - "query-statistics-data-group-sum") + "delete-listener-certificates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --sub-domain --fields --area --isp --origin --period --group-by " -- $cur) ) + -W "-h --help --headers --input-json --region-id --listener-id --certificate-bind-ids " -- $cur) ) ;; - "query-live-statistics-data") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --app-name --stream-name --sub-domain --fields --area --isp --req-method --scheme --period " -- $cur) ) + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; - "query-live-statistics-area-data-group-by") + esac + ;; + + "industrydata") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "get-large-screen-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --app-name --fields --area --isp --stream-name --period --group-by --sub-domain --scheme --req-method " -- $cur) ) + -W "-h --help --headers --input-json --region-id --region --industry --start-date --end-date --first-index --second-index " -- $cur) ) ;; - "query-live-traffic-group-sum") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "rds") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-binlogs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --sub-domain --app-name --stream-name --fields --area --isp --scheme --period --group-by --req-method " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --start-time --end-time " -- $cur) ) ;; - "query-statistics-top-ip") + "describe-binlog-download-url") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --sub-domain --size --top-by " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --binlog-backup-id --seconds " -- $cur) ) ;; - "query-statistics-top-url") + "clear-binlogs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --sub-domain --size --top-by " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "query-dir-bandwidth") + "describe-accounts") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --dirs --regions " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size " -- $cur) ) ;; - "query-waf-switch") + "create-account") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-name --account-password --notes " -- $cur) ) ;; - "set-waf-switch") + "describe-account-privilege") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --switch-status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-name " -- $cur) ) ;; - "query-waf-white-rule-switch") + "delete-account") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-name " -- $cur) ) ;; - "set-waf-white-rule-switch") + "grant-privilege") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --switch-status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-name --account-privileges " -- $cur) ) ;; - "querywaf-white-rules") + "revoke-privilege") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --rule-type --id --page-size --page-index " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-name --db-names " -- $cur) ) ;; - "create-waf-white-rule") + "reset-password") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --rule-type --match-op --val --actions " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-name --account-password " -- $cur) ) ;; - "update-waf-white-rule") + "create-super-account") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --id --rule-type --match-op --val --actions " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-name --account-password " -- $cur) ) ;; - "enable-waf-white-rules") + "grant-account-privilege") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --ids --rule-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-name --database-privileges --global-privileges " -- $cur) ) ;; - "disable-waf-white-rules") + "describe-accounts-for-ops") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --ids --rule-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "delete-waf-white-rules") + "create-account-for-ops") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --ids --rule-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --expired-time " -- $cur) ) ;; - "query-waf-black-rule-switch") + "modify-account-for-ops") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --expired-time --global-privileges " -- $cur) ) ;; - "set-waf-black-rule-switch") + "describe-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --switch-status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tag-filters " -- $cur) ) ;; - "querywaf-black-rules") + "create-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --rule-type --id --page-size --page-index " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-spec " -- $cur) ) ;; - "create-waf-black-rule") + "describe-instance-attributes") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --rule-type --match-op --val --at-op --at-val " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "update-waf-black-rule") + "delete-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --id --rule-type --match-op --val --at-op --at-val " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "enable-waf-black-rules") + "describe-backup-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --ids --rule-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "disable-waf-black-rules") + "modify-backup-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --ids --rule-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --start-window --binlog-retention-period --binlog-usage-limit --binlog-space-protection --retention-period --cycle-mode " -- $cur) ) ;; - "delete-waf-black-rules") + "enable-enhanced-backup") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --ids --rule-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "query-ccprotect-switch") + "describe-backup-space") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "set-ccprotect-switch") + "describe-backup-charge") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --switch-status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --engine " -- $cur) ) ;; - "query-ccprotect-rules") + "modify-instance-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --id --page-size --page-index " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --instance-name " -- $cur) ) ;; - "create-ccprotect-rule") + "failover-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --uri --detect-period --single-ip-limit --block-type --block-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "update-ccprotect-rule") + "reboot-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --id --uri --detect-period --single-ip-limit --block-type --block-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --reboot-master --reboot-slave --force " -- $cur) ) ;; - "enable-ccprotect-rule") + "enable-internet-access") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "disable-ccprotect-rule") + "disable-internet-access") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "delete-ccprotect-rule") + "restore-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --backup-id " -- $cur) ) ;; - "query-web-protect-switch") + "create-instance-from-backup") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --backup-id --engine --instance-spec " -- $cur) ) ;; - "set-web-protect-switch") + "modify-instance-spec") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --switch-status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --new-instance-class --new-instance-storage-gb --new-instance-storage-type --storage-encrypted --subnet-id --effective-time --postpone-time " -- $cur) ) ;; - "query-web-protect-settings") + "create-instance-by-time") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --restore-time --instance-spec " -- $cur) ) ;; - "update-web-protect-settings") + "create-roinstance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain --waf-mode --waf-level --redirection " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --instance-name --instance-class --instance-storage-type --instance-storage-gb --az-id --vpc-id --subnet-id --parameter-group --storage-encrypted --count --ro-instance-proxy --tag-spec " -- $cur) ) ;; - "query-waf-regions") + "modify-connection-mode") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --skip-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --connection-mode " -- $cur) ) ;; - "query-ip-black-setting-status") + "describe-latest-restore-time") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "waf-query-pv-for-area-and-ip") + "modify-parameter-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --parameter-group-id " -- $cur) ) ;; - "waf-query-pv") + "exchange-instance-dns") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --target-instance-id " -- $cur) ) ;; - "waf-query-attack-details") + "modify-instance-az") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --domain --sort-field --sort-rule --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --new-az-id " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-ssl") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - esac - ;; - - "streambus") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "get-topic-list") + "enable-ssl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --keyword " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "describe-topic") + "disable-ssl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "add-topic") + "restore-instance-by-time") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-model " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --restore-time --restore-schema " -- $cur) ) ;; - "update-topic") + "modify-active-directory") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-model " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --ad-resource-id --force-restart " -- $cur) ) ;; - "delete-topic") + "modify-instance-maintain-time") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --maintain-time --maintain-period " -- $cur) ) ;; - "get-consumer-group-list") + "describe-instance-maintain-time") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "create-consumer-group") + "switch-for-modifying-instance-spec") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --consumer-group-str " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "delete-consumer-group") + "describe-upgrade-versions") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-id --consumer-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-upgrade-plan") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - esac - ;; - - "apigateway") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "query-access-auths") + "upgrade-engine-version") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --upgrade-schedule --new-version " -- $cur) ) ;; - "create-access-auth") + "describe-import-files") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-auth-view " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "check-auth-exist") + "get-upload-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-key --auth-user-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "query-access-auth") + "set-import-file-shared") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-auth-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --file-name --shared " -- $cur) ) ;; - "update-access-auth") + "delete-import-file") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-auth-id --access-auth-view " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --file-name --shared-file-gid " -- $cur) ) ;; - "delete-access-auth") + "describe-logs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-auth-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --filters " -- $cur) ) ;; - "query-bind-group-auth") + "update-log-download-urlinternal") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-auth-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --log-id --seconds " -- $cur) ) ;; - "bind-group-auth") + "describe-log-download-url") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-auth-id --deployment-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --log-id --seconds " -- $cur) ) ;; - "query-auth-group-list") + "describe-databases") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --auth-user-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --db-name --page-number --page-size " -- $cur) ) ;; - "authorized-api-group-list") + "create-database") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --db-name --character-set-name " -- $cur) ) ;; - "query-access-keys") + "delete-database") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --db-name " -- $cur) ) ;; - "create-access-key") + "restore-database-from-backup") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --description --access-key-type --access-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --db-name --backup-id --backup-file-name " -- $cur) ) ;; - "check-key-exist") + "restore-database-from-file") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-key --access-key-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --db-name --shared-file-gid --file-name " -- $cur) ) ;; - "query-access-key") + "restore-database-from-oss") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --db-name --oss-url " -- $cur) ) ;; - "update-access-key") + "modify-database-comment") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-key-id --description --access-key-type --access-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --db-name --comment " -- $cur) ) ;; - "delete-access-key") + "enable-intercept") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "query-bind-group-key") + "disable-intercept") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "bind-group-key") + "describe-intercept-result") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-key-id --deployment-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --filters " -- $cur) ) ;; - "query-key-group-list") + "describe-intercept") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "query-apis") + "describe-read-write-proxies") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "create-apis") + "create-read-write-proxy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision --api " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --delay-threshold --load-balancer-policy --health-check-spec " -- $cur) ) ;; - "check-api-name-exist") + "describe-read-write-proxy-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision --api-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --read-write-proxy-id " -- $cur) ) ;; - "query-api") + "delete-read-write-proxy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision --api-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --read-write-proxy-id " -- $cur) ) ;; - "update-api") + "enable-read-write-proxy-internet-access") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision --api-id --api " -- $cur) ) + -W "-h --help --headers --input-json --region-id --read-write-proxy-id " -- $cur) ) ;; - "delete-api") + "disable-read-write-proxy-internet-access") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision --api-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --read-write-proxy-id " -- $cur) ) ;; - "update-api-by-name") + "modify-read-write-proxy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision --api-name --api " -- $cur) ) + -W "-h --help --headers --input-json --region-id --read-write-proxy-id --delay-threshold --load-balancer-policy --health-check-spec " -- $cur) ) ;; - "delete-api-by-name") + "delete-parameter-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision --api-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --parameter-group-id " -- $cur) ) ;; - "describe-api-groups") + "modify-parameter-group-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tag-filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --parameter-group-id --parameter-group-name --description " -- $cur) ) ;; - "create-api-group") + "describe-parameter-groups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --group-name --description --prefix --key-check --auth-type --prefix-strip --group-type --jdsf-name --jdsf-registry-name --jdsf-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) ;; - "check-group-name-exist") + "create-parameter-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --group-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --engine --engine-version --parameter-group-name --description " -- $cur) ) ;; - "describe-api-group") + "describe-parameter-group-parameters") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --parameter-group-id " -- $cur) ) ;; - "modify-api-group-attribute") + "modify-parameter-group-parameters") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --group-name --description --prefix --key-check --auth-type --prefix-strip --group-type --jdsf-name --jdsf-registry-name --jdsf-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --parameter-group-id --parameters " -- $cur) ) ;; - "delete-api-group") + "describe-parameter-modify-records") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --parameter-group-id --page-number --page-size --start-time --end-time " -- $cur) ) ;; - "describe-is-deploy-api-groups") + "copy-parameter-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --parameter-group-id --parameter-group-name --description " -- $cur) ) ;; - "create-backend-config") + "describe-parameter-group-attached-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --backend-config-id --base-group-id --environment --backend-url --backend-service-type --header-params --query-params --description --create-time --sort --user-sort --jdsf-id --jdsf-param --jdsf-region --jdsf-pin " -- $cur) ) + -W "-h --help --headers --input-json --region-id --parameter-group-id --page-number --page-size " -- $cur) ) ;; - "describe-backend-configs") + "describe-backups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --environment --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --auto --backup-type-filter --db-name-filter --backup-time-range-start-filter --backup-time-range-end-filter --page-number --page-size " -- $cur) ) ;; - "describe-backend-config") + "create-backup") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --backend-config-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --backup-spec " -- $cur) ) ;; - "update-backend-config") + "delete-backup") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --backend-config-id --base-group-id --environment --backend-url --backend-service-type --header-params --query-params --description --create-time --sort --user-sort --jdsf-id --jdsf-param --jdsf-region --jdsf-pin " -- $cur) ) + -W "-h --help --headers --input-json --region-id --backup-id " -- $cur) ) ;; - "delete-backend-config") + "describe-backup-download-url") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --backend-config-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --backup-id --file-name --url-expiration-second " -- $cur) ) ;; - "describe-deployments") + "describe-tables") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --db-name --page-number --page-size " -- $cur) ) ;; - "deploy") + "describe-tde") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision --environment --backend-service-type --backend-url --description --jdsf-name --jdsf-registry-name --jdsf-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "describe-deployment") + "enable-tde") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --deployment-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "offline") + "describe-white-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --deployment-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "batch-offline") + "modify-white-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --deployment-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --ips " -- $cur) ) ;; - "query-keys") + "describe-audit") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --order-by --user-type --key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "create-key") + "create-audit") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --key-name --key-desc " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --enabled " -- $cur) ) ;; - "reset-key") + "delete-audit") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "update-key") + "describe-audit-options") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --key-id --key-name --key-desc " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --name " -- $cur) ) ;; - "query-key-info") + "modify-audit") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --add --drop " -- $cur) ) ;; - "query-rate-limit-policies") + "describe-audit-files") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "create-rate-limit-policy") + "describe-audit-download-url") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --rate-limit-policy-view " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --file-name " -- $cur) ) ;; - "check-policy-name") + "enable-audit") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --policy-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "query-rate-limit-policy") + "disable-audit") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --policy-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "update-rate-limit-policy") + "describe-audit-result") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --policy-id --rate-limit-policy-view " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --start-time --end-time --db-name --account-name --page-number --page-size --filters " -- $cur) ) ;; - "delete-rate-limit-policy") + "describe-azs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --policy-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --engine " -- $cur) ) ;; - "query-bind-group-policy") + "alter-table-with-online-ddl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --policy-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --database --table --command " -- $cur) ) ;; - "bind-group-policy") + "describe-parameters") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --policy-id --deployment-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "query-policy-group-list") + "modify-parameters") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --policy-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --parameters " -- $cur) ) ;; - "describe-revisions") + "describe-backup-synchronicities") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) ;; - "create-revision") + "create-backup-synchronicity") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision --base-revision --revision-note " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --dest-region " -- $cur) ) ;; - "get-revision-ids") + "delete-backup-synchronicity") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --service-id " -- $cur) ) ;; - "check-revision-exist") + "create-instance-by-time-in-cross-region") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision " -- $cur) ) + -W "-h --help --headers --input-json --region-id --restore-time --service-id --instance-spec " -- $cur) ) ;; - "query-revision") + "describe-error-logs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "modify-revision") + "describe-privilege") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision-id --revision-note " -- $cur) ) + -W "-h --help --headers --input-json --region-id --engine --instance-id --all-admin-privileges " -- $cur) ) ;; - "delete-revision") + "describe-index-performance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --api-group-id --revision-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --query-type --db --page-number --page-size " -- $cur) ) ;; - "query-subscription-keys") + "describe-query-performance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --query-type --threshold --page-number --page-size " -- $cur) ) ;; - "create-subscription-key") + "describe-slow-log-attributes") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --description --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --start-time --end-time --db-name --page-number --page-size --sorts --filters " -- $cur) ) ;; - "query-subscription-key") + "describe-slow-logs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --subscription-key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --start-time --end-time --db-name --page-number --page-size --filters --sorts " -- $cur) ) ;; - "update-subscription-key") + "describe-active-query-performance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --subscription-key-id --description --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --db --threshold --page-number --page-size " -- $cur) ) ;; - "delete-subscription-key") + "describe-error-log") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --subscription-key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --start-time --end-time --db-name --page-number --page-size " -- $cur) ) ;; - "query-uc-access-keys") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "kubernetes") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-node-groups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --tags --filters " -- $cur) ) ;; - "check-pin") + "create-node-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pin " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name --description --cluster-id --node-config --azs --initial-node-count --vpc-id --node-cidr --auto-repair --ca-config --node-group-network " -- $cur) ) ;; - "query-user-domains") + "describe-node-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --order-by --api-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --node-group-id " -- $cur) ) ;; - "create-user-domain") + "modify-node-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain --protocol --api-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --node-group-id --name --description " -- $cur) ) ;; - "delete-user-domain") + "delete-node-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-ids --api-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --node-group-id " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "set-node-group-size") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --node-group-id --expect-count " -- $cur) ) ;; - esac - ;; - - "httpdns") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "get-account-id") + "set-auto-repair") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --node-group-id --enabled " -- $cur) ) ;; - "create-account") + "rollback-node-group-upgrade") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --node-group-id " -- $cur) ) ;; - "get-account-info") + "set-node-group-ca") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --node-group-id --ca-config " -- $cur) ) ;; - "operate-key") + "delete-node-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --action --key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --node-group-id --instance-ids " -- $cur) ) ;; - "get-domains") + "describe-server-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-index --page-size --domain-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "add-domains") + "describe-versions") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-names " -- $cur) ) + -W "-h --help --headers --input-json --region-id --master-version " -- $cur) ) ;; - "del-domains") + "describe-node-version") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --domain-names " -- $cur) ) + -W "-h --help --headers --input-json --region-id --node-version " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-upgradable-master-versions") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) ;; - esac - ;; - - "disk") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-disks") + "describe-upgradable-node-versions") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --tags --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id --node-group-ids " -- $cur) ) ;; - "create-disks") + "describe-quotas") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --disk-spec --max-count --user-tags --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --filters " -- $cur) ) ;; - "describe-disk") + "describe-clusters") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --disk-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "modify-disk-attribute") + "create-cluster") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --disk-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name --description --basic-auth --client-certificate --version --azs --node-group --master-cidr --access-key --secret-key --user-metrics --addons-config " -- $cur) ) ;; - "delete-disk") + "describe-cluster") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --disk-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) ;; - "restore-disk") + "modify-cluster") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --disk-id --snapshot-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id --name --description " -- $cur) ) ;; - "extend-disk") + "delete-cluster") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --disk-id --disk-size-gb --iops " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) ;; - "describe-snapshots") + "set-user-metrics") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --snapshot-source --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id --enabled " -- $cur) ) ;; - "create-snapshot") + "abort-upgrade") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --snapshot-spec --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) ;; - "delete-snapshots") + "describe-progress") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --snapshot-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id --node-group-ids " -- $cur) ) ;; - "describe-snapshot") + "set-auto-upgrade") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --snapshot-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id --auto-upgrade --maintenance-window " -- $cur) ) ;; - "modify-snapshot-attribute") + "upgrade-cluster") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --snapshot-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id --scope --node-group-ids --version " -- $cur) ) ;; - "delete-snapshot") + "set-addons") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --snapshot-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id --addons-config " -- $cur) ) ;; "generate-skeleton") @@ -3445,580 +4815,574 @@ _jdc_complete() esac ;; - "sts") + "ipanti") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "assume-role") + "describe-forward-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --assume-role-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --search-type --search-value --sorts " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "create-forward-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-spec " -- $cur) ) ;; - esac - ;; - - "nc") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-containers") + "create-forward-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-spec-list " -- $cur) ) ;; - "create-containers") + "describe-forward-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-spec --max-count " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) ;; - "describe-container") + "modify-forward-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id --forward-rule-spec " -- $cur) ) ;; - "delete-container") + "delete-forward-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) ;; - "start-container") + "switch-forward-rule-protect") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) ;; - "stop-container") + "switch-forward-rule-origin") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) ;; - "modify-container-attribute") + "describe-protection-rule-of-forward-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) ;; - "associate-elastic-ip") + "modify-protection-rule-of-forward-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id --forward-protection-rule-spec " -- $cur) ) ;; - "disassociate-elastic-ip") + "describe-geo-areas") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "get-logs") + "describe-black-list-rule-of-forward-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --tail-lines --since-seconds --limit-bytes " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) ;; - "describe-quota") + "modify-black-list-rule-of-forward-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --resource-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id --modify-spec " -- $cur) ) ;; - "describe-secrets") + "enable-black-list-rule-of-forward-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) ;; - "create-secret") + "disable-black-list-rule-of-forward-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name --secret-type --data " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) ;; - "describe-secret") + "describe-white-list-rule-of-forward-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) ;; - "delete-secret") + "modify-white-list-rule-of-forward-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id --modify-spec " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "enable-white-list-rule-of-forward-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) ;; - esac - ;; - - "vm") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-image") + "disable-white-list-rule-of-forward-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --image-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --forward-rule-id " -- $cur) ) ;; - "delete-image") + "describe-ddo-sgraph") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --image-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id --service-ip " -- $cur) ) ;; - "describe-images") + "describe-fwd-graph") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --image-source --service-code --offline --platform --ids --root-device-type --launch-permission --status --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id " -- $cur) ) ;; - "describe-image-constraints") + "describe-business-graph") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --image-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id --service-ip " -- $cur) ) ;; - "describe-image-constraints-batch") + "describe-ccgraph") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id --sub-domain " -- $cur) ) ;; - "share-image") + "describe-status-graph") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --image-id --pins " -- $cur) ) + -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id --sub-domain " -- $cur) ) ;; - "un-share-image") + "describe-conn-stat-graph") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --image-id --pins " -- $cur) ) + -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id --service-ip " -- $cur) ) ;; - "release-image") + "describe-ddo-sattack-logs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --image-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --start-time --end-time --instance-id " -- $cur) ) ;; - "un-release-image") + "describe-ddo-sip-attack-logs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --image-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --start-time --end-time --instance-id --service-ip " -- $cur) ) ;; - "describe-image-members") + "describe-ccattack-logs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --image-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --start-time --end-time --instance-id " -- $cur) ) ;; - "copy-images") + "describe-ccattack-log-details") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --source-image-ids --destination-region " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --start-time --end-time --instance-id --sub-domain --attack-id " -- $cur) ) ;; - "modify-image-attribute") + "describe-attack-statistics") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --image-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id --service-ip --type " -- $cur) ) ;; - "import-image") + "describe-attack-type-count") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --architecture --os-type --platform --disk-format --system-disk-size-gb --image-url --os-version --image-name --description --force-import --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --start-time --end-time --instance-id --service-ip " -- $cur) ) ;; - "export-image") + "describe-dispatch-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --image-id --role-name --oss-url --oss-prefix --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --name --inner-ip --service-ip " -- $cur) ) ;; - "image-tasks") + "create-dispatch-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --task-action --task-ids --task-status --start-time --end-time --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --create-dispatch-rule-spec " -- $cur) ) ;; - "describe-instances") + "create-dispatch-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --dispatch-rule-spec-list " -- $cur) ) ;; - "create-instances") + "modify-dispatch-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-spec --max-count --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --dispatch-rule-id --modify-dispatch-rule-spec " -- $cur) ) ;; - "describe-brief-instances") + "delete-dispatch-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --tags --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --dispatch-rule-id " -- $cur) ) ;; - "describe-instance") + "switch-dispatch-rule-protect") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --dispatch-rule-id " -- $cur) ) ;; - "delete-instance") + "switch-dispatch-rule-origin") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id --dispatch-rule-id " -- $cur) ) + ;; + "describe-instance-acl") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "describe-instance-status") + "modify-instance-acl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --instance-acl-spec " -- $cur) ) ;; - "describe-instance-private-ip-address") + "recover-instance-acl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "stop-instance") + "describe-custom-pages") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --charge-on-stopped " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --status " -- $cur) ) ;; - "start-instance") + "create-custom-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --custom-page-spec " -- $cur) ) ;; - "reboot-instance") + "modify-custom-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-id --custom-page-spec " -- $cur) ) ;; - "attach-network-interface") + "delete-custom-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --network-interface-id --auto-delete " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-id " -- $cur) ) + ;; + "modify-instance-custom-page") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id --page-id " -- $cur) ) ;; - "detach-network-interface") + "modify-instance-custom-page-default") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --network-interface-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "modify-instance-network-attribute") + "enable-instance-custom-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --networks " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "associate-elastic-ip") + "disable-instance-custom-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "disassociate-elastic-ip") + "describe-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --name " -- $cur) ) ;; - "create-image") + "create-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --name --description --data-disks " -- $cur) ) + -W "-h --help --headers --input-json --region-id --create-instance-spec --auto-renewal-spec --auto-pay " -- $cur) ) ;; - "attach-disk") + "describe-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --disk-id --device-name --auto-delete " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "detach-disk") + "modify-instance-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --disk-id --force " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --rename-instance-spec " -- $cur) ) ;; - "modify-instance-disk-attribute") + "modify-epb") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --data-disks " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --modify-instance-epbspec " -- $cur) ) ;; - "modify-instance-attribute") + "describe-alarm-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "modify-instance-password") + "modify-alarm-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --password " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --alarm-config-spec " -- $cur) ) ;; - "describe-instance-vnc-url") + "describe-origin-white-ip-list") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "resize-instance") + "describe-service-ip-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --instance-type --force " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size " -- $cur) ) ;; - "rebuild-instance") + "describe-instance-id-by-resource-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --password --image-id --key-names " -- $cur) ) + -W "-h --help --headers --input-json --region-id --resource-id " -- $cur) ) ;; - "describe-instance-templates") + "describe-name-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --id --name --page-number --page-size " -- $cur) ) ;; - "create-instance-template") + "describe-protection-statistics") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-template-data --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-instance-template") + "describe-protection-outline") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-template-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "update-instance-template") + "check-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-template-id --description --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) ;; - "delete-instance-template") + "describe-vpc-ip-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-template-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) ;; - "verify-instance-template") + "describe-cps-ip-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-template-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) ;; - "describe-instance-types") + "describe-ccs-ip-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --service-name --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) ;; - "describe-keypairs") + "describe-ip-sets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size " -- $cur) ) ;; - "create-keypair") + "create-ip-set") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --key-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --ip-set-spec " -- $cur) ) ;; - "import-keypair") + "describe-ip-set") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --key-name --public-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --ip-set-id " -- $cur) ) ;; - "delete-keypair") + "delete-ip-set") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --key-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --ip-set-id " -- $cur) ) ;; - "describe-quotas") + "describe-ip-set-usage") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --filters --image-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-web-rules") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --search-type --search-value " -- $cur) ) ;; - esac - ;; - - "nativecontainer") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-containers") + "create-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tags " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-spec " -- $cur) ) ;; - "create-containers") + "create-web-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-spec --max-count --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-spec-list " -- $cur) ) ;; - "describe-container") + "describe-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "delete-container") + "modify-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-rule-spec " -- $cur) ) ;; - "start-container") + "delete-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "stop-container") + "bind-cert") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cert-id " -- $cur) ) ;; - "modify-container-attribute") + "switch-web-rule-protect") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "associate-elastic-ip") + "switch-web-rule-origin") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "disassociate-elastic-ip") + "enable-web-rule-cc") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "get-logs") + "disable-web-rule-cc") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --tail-lines --since-seconds --limit-bytes " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "rebuild-container") + "enable-web-rule-ccobserver-mode") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --image --secret --command --args --tty --working-dir --envs " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "resize-container") + "disable-web-rule-ccobserver-mode") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --instance-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "exec-create") + "describe-js-pages-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --command --tty " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --page-number --page-size " -- $cur) ) ;; - "exec-get-exit-code") + "create-js-page-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --exec-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --js-page-spec " -- $cur) ) ;; - "resize-tty") + "create-js-pages-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --container-id --height --width --exec-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --js-pages-spec " -- $cur) ) ;; - "describe-instance-types") + "modify-js-page-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --js-page-id --js-page-spec " -- $cur) ) ;; - "describe-quota") + "delete-js-page-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --resource-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --js-page-id " -- $cur) ) ;; - "describe-secrets") + "disable-web-rule-js-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "create-secret") + "enable-web-rule-js-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name --secret-type --data " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "describe-secret") + "modify-web-rule-js-page-to-all") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "delete-secret") + "modify-web-rule-js-page-to-custom") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-ccprotection-rules-of-web-rule") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - esac - ;; - - "iotcore") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "device-query") + "create-ccprotection-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --device-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-rule-spec " -- $cur) ) ;; - "thing-type-list") + "describe-ccprotection-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --device-meta-id --device-meta-name --node-type --page-no --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-rule-id " -- $cur) ) ;; - "thing-type-describe") + "modify-ccprotection-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --device-meta-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-rule-id --cc-protection-rule-spec " -- $cur) ) ;; - "describe-thing-model") + "delete-ccprotection-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --thing-model-id --thing-model-version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-rule-id " -- $cur) ) ;; - "device-register") + "enable-ccprotection-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --device-info-vo " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-rule-id " -- $cur) ) ;; - "download-certificate") + "disable-ccprotection-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --device-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-rule-id " -- $cur) ) ;; - "delete-device") + "enable-web-rule-ccprotection-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --device-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "device-property-set") + "disable-web-rule-ccprotection-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --device-property-vo " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "invoke-function") + "describe-ccprotection-config-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --device-function-vo " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "event-list") + "modify-ccprotection-config-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --event-report-page-bo " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cc-protection-config-spec " -- $cur) ) ;; - "function-list") + "describe-ccprotection-default-config-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --function-call-page-bo " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "invoke-thing-topic") + "modify-cert-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --identifier --product-key --topic-short-name --topic-message " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --cert-info-modify-spec " -- $cur) ) ;; - "describe-thing-shadow") + "describe-web-rule-black-list-usage") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --identifier --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "update-thing-shadow") + "describe-black-list-rules-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --identifier --product-key --state --version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --page-number --page-size " -- $cur) ) ;; - "invoke-thing-service") + "create-black-list-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --identifier --product-key --name --input --callback-bean-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-black-list-rule-spec " -- $cur) ) ;; - "add-device-links") + "describe-black-list-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --parent-id --product-key --children " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-black-list-rule-id " -- $cur) ) ;; - "query-device-page") + "modify-black-list-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --device-name --status --product-key --device-type --now-page --page-size --order --direction --parent-id --order-id --device-collector-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-black-list-rule-id --web-black-list-rule-spec " -- $cur) ) ;; - "update-device") + "delete-black-list-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --device-id --model --manufacturer --description --status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-black-list-rule-id " -- $cur) ) ;; - "add-device") + "enable-web-rule-black-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --device-name --product-key --model --manufacturer --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "query-device-detail") + "enable-black-list-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --device-name --instance-id --region-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-black-list-rule-id " -- $cur) ) ;; - "remove-device") + "disable-web-rule-black-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --device-name --instance-id --region-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "elevator-operating-status") + "disable-black-list-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --identifier " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-black-list-rule-id " -- $cur) ) ;; - "collector-read-message") + "describe-web-rule-white-list-usage") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --identifier --protocol " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "read-holding-registers") + "describe-white-list-rules-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --identifier --address-of-first-register --number-of-registers " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --page-number --page-size " -- $cur) ) ;; - "collector-write-message") + "create-white-list-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --identifier --protocol --data " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-white-list-rule-spec " -- $cur) ) ;; - "update-loo-device") + "describe-white-list-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --device-id --model --manufacturer --description --status --identifier --device-name --device-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-white-list-rule-id " -- $cur) ) ;; - "add-loo-device") + "modify-white-list-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --pre-order-id --user-pin-param --device-name --product-key --model --manufacturer --identifier --description --device-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-white-list-rule-id --web-white-list-rule-spec " -- $cur) ) ;; - "loongray-query-page") + "delete-white-list-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --instance-id --region-id --device-name --status --product-key --device-type --now-page --page-size --order --direction --parent-id --order-id --device-collector-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-white-list-rule-id " -- $cur) ) ;; - "remove-loongray-device") + "enable-web-rule-white-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --device-name --instance-id --region-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "describe-product-with-admin") + "enable-white-list-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-white-list-rule-id " -- $cur) ) ;; - "update-product-with-admin") + "disable-web-rule-white-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-key --product-name --product-description --dynamic-register " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id " -- $cur) ) ;; - "delete-product-with-admin") + "disable-white-list-rule-of-web-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --web-rule-id --web-white-list-rule-id " -- $cur) ) ;; - "list-products-with-admin") + "describe-web-rule-black-list-geo-areas") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "create-admin-product") + "describe-web-rule-white-list-geo-areas") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-name --product-type --product-description --template-id --internal-tags " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "list-products") + "describe-web-rule-rsgeo-areas") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "create-product") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "jmr") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "idata-cluster") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-name --product-type --product-description --template-id --internal-tags " -- $cur) ) + -W "-h --help --headers --input-json --region-id --data-center " -- $cur) ) ;; - "describe-product") + "get-software-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --version " -- $cur) ) ;; - "update-product") + "get-jmr-version-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-key --product-name --product-description --dynamic-register " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "delete-product") + "monitor-label-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) ;; - "list-product-abilities") + "describe-cluster") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-key --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) ;; - "import-thing-model") + "describe-clusters") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-key --thing-model " -- $cur) ) + -W "-h --help --headers --input-json --region-id --data-center --status --cluster-name --order-by --page-num --page-size " -- $cur) ) ;; - "export-thing-model") + "release-cluster") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-id " -- $cur) ) ;; - "describe-product-topics") + "cluster-expansion") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-key --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-expansion --client-token " -- $cur) ) ;; - "create-product-topic") + "cluster-reduction") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-key --topic-short-name --topic-operation --topic-description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-reduction --client-token " -- $cur) ) ;; - "describe-product-topic") + "create-cluster") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --product-key --topic-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cluster-spec --client-token " -- $cur) ) ;; "generate-skeleton") @@ -4027,104 +5391,128 @@ _jdc_complete() esac ;; - "pod") + "deploy") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-container") + "describe-apps") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id --container-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "attach") + "describe-app") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id --container-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --app-id " -- $cur) ) ;; - "exec-create") + "describe-groups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id --container-name --command --tty " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "exec-get-exit-code") + "describe-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id --container-name --exec-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --group-id " -- $cur) ) ;; - "resize-tty") + "create-deploy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id --container-name --height --width --exec-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --group-id --desc --deploy-source --deploy-cmd --cmd-source --cmd-type --product-type --download-url --md5 --compile-project --compile-series --oss-space --oss-dir --file-type " -- $cur) ) ;; - "describe-instance-types") + "describe-deploy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --deploy-id " -- $cur) ) ;; - "describe-pods") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "sop") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "get-sensitive-op-setting") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tags " -- $cur) ) + -W "-h --help --headers --input-json --region-id --action " -- $cur) ) ;; - "create-pods") + "get-security-token") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-spec --max-count --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --get-security-token-info " -- $cur) ) ;; - "check-pod-name") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "function") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "list-function") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-name --max-count " -- $cur) ) + -W "-h --help --headers --input-json --region-id --list-all --page-number --page-size --filters " -- $cur) ) ;; - "describe-pod") + "create-function") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name --description --entrance --memory --run-time --over-time --version --code --environment --log-set-id --log-topic-id --vpc-id --subnet-id " -- $cur) ) ;; - "delete-pod") + "get-function") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name " -- $cur) ) ;; - "start-pod") + "update-function") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name --description --entrance --memory --run-time --over-time --version --code --environment --log-set-id --log-topic-id --vpc-id --subnet-id " -- $cur) ) ;; - "stop-pod") + "delete-function") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name " -- $cur) ) ;; - "modify-pod-attribute") + "invoke") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name --version-name --event " -- $cur) ) ;; - "associate-elastic-ip") + "async-invoke") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name --version-name --event " -- $cur) ) ;; - "disassociate-elastic-ip") + "list-version") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name " -- $cur) ) ;; - "get-container-logs") + "create-version") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id --container-name --tail-lines --since-seconds --limit-bytes --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name --description " -- $cur) ) ;; - "rebuild-pod") + "get-version") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id --containers " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name --version-name " -- $cur) ) ;; - "resize-pod") + "delete-version") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pod-id --instance-type --container-resources " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name --version-name " -- $cur) ) ;; - "describe-quota") + "list-alias") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --resource-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name " -- $cur) ) ;; - "describe-secrets") + "create-alias") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name --alias-name --description --version " -- $cur) ) ;; - "create-secret") + "get-alias") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name --secret-type --data " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name --alias-name " -- $cur) ) ;; - "describe-secret") + "update-alias") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name --alias-name --description --version " -- $cur) ) ;; - "delete-secret") + "delete-alias") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --function-name --alias-name " -- $cur) ) + ;; + "get-trigger") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --function-name --version-name --trigger-id " -- $cur) ) ;; "generate-skeleton") @@ -4133,74 +5521,128 @@ _jdc_complete() esac ;; - "ams") + "jdccs") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-streams-input") + "describe-metrics") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json " -- $cur) ) + ;; + "describe-metric-data") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --idc --metric --resource-id --start-time --end-time --time-interval --ip --port " -- $cur) ) + ;; + "last-downsample") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --idc --metric --resource-id " -- $cur) ) + ;; + "describe-bandwidth-traffics") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --idc --page-number --page-size --bandwidth-name " -- $cur) ) + ;; + "describe-bandwidth-traffic") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --idc --bandwidth-id " -- $cur) ) + ;; + "describe-traffic-sampling") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --resource-id --start-time --end-time " -- $cur) ) + ;; + "describe-open-devices") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json " -- $cur) ) + ;; + "describe-open-devices-data") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --device-codes --device-type " -- $cur) ) + ;; + "describe-rangetime-cabinet-current") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --idc --resource-id --start-time --end-time --time-interval " -- $cur) ) + ;; + "describe-realtime-cabinet-current") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --idc --resource-id " -- $cur) ) + ;; + "describe-alarms") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --page-number --page-size --resource-type --resource-id --idc --status --filters " -- $cur) ) + ;; + "create-alarm") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --idc --resource-type --resource-id --name --metric --period --statistic-method --operator --threshold --times --notice-period --status --notice-method --notice-obj --user-id --group-id " -- $cur) ) + ;; + "describe-alarm") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --alarm-id " -- $cur) ) + ;; + "update-alarm") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --alarm-id --name --metric --period --statistic-method --operator --threshold --times --notice-period --status --notice-method --user-id --group-id " -- $cur) ) + ;; + "delete-alarm") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --alarm-id " -- $cur) ) + ;; + "describe-alarm-history") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --stream-id --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --alarm-id --idc --start-time --end-time " -- $cur) ) ;; - "describe-authenticate") + "switch-alarm") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --p-id --ver " -- $cur) ) + -W "-h --help --headers --input-json --alarm-id --status " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-tickets") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --page-number --page-size --type --ticket-type-name --status --ticket-no --ticket-template-name --description --start-time --end-time --filters --sorts " -- $cur) ) ;; - esac - ;; - - "jdro") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-resource-type-list") + "describe-ticket") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --product --search " -- $cur) ) + -W "-h --help --headers --input-json --ticket-no " -- $cur) ) ;; - "describe-resource-type-specification") + "create-general-services-ticket") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --resource-type " -- $cur) ) + -W "-h --help --headers --input-json --phone --email --idc --is-external-idc --count --external-idc-address --external-idc-contact-person --external-idc-contact-phone --remarks --attach " -- $cur) ) ;; - "describe-stacks") + "describe-idcs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --stack-name --action --status --create-start-time --create-end-time --update-start-time --update-end-time --sort-field --sort-by " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --all --include-external-idc " -- $cur) ) ;; - "create-stack") + "describe-rooms") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --environment --template " -- $cur) ) + -W "-h --help --headers --input-json --idc --page-number --page-size --all --filters " -- $cur) ) ;; - "describe-stack") + "describe-cabinets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --stack-id " -- $cur) ) + -W "-h --help --headers --input-json --idc --page-number --page-size --cabinet-type --cabinet-open-status --cabinet-no --filters --sorts " -- $cur) ) ;; - "delete-stack") + "describe-cabinet") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --stack-id " -- $cur) ) + -W "-h --help --headers --input-json --idc --cabinet-id " -- $cur) ) ;; - "create-change-set") + "describe-devices") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --stack-id --environment --template " -- $cur) ) + -W "-h --help --headers --input-json --idc --page-number --page-size --cabinet-id --device-type --asset-status --asset-belong --device-no --sn-no --filters --sorts " -- $cur) ) ;; - "execute-change-set") + "describe-device") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --stack-id --changeset-id " -- $cur) ) + -W "-h --help --headers --input-json --idc --device-id " -- $cur) ) ;; - "describe-stack-events") + "describe-ips") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --stack-id --page-number --page-size --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --idc --page-number --page-size --line-type --status --cidr-addr --filters --sorts " -- $cur) ) ;; - "describe-stack-resources") + "describe-bandwidths") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --stack-id --page-number --page-size --search --product " -- $cur) ) + -W "-h --help --headers --input-json --idc --page-number --page-size --line-type --charge-type --bandwidth-name --related-ip --filters --sorts " -- $cur) ) ;; - "describe-stack-template") + "describe-bandwidth") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --stack-id " -- $cur) ) + -W "-h --help --headers --input-json --idc --bandwidth-id " -- $cur) ) ;; - "validate-template") + "describe-idc-overview") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --environment --template --validate-mode " -- $cur) ) + -W "-h --help --headers --input-json --idc " -- $cur) ) ;; "generate-skeleton") @@ -4209,544 +5651,526 @@ _jdc_complete() esac ;; - "zfs") + "logs") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-file-systems") + "describe-collect-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --tags --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --collect-info-uid " -- $cur) ) ;; - "create-file-system") + "update-collect-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name --description --client-token --file-system-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --collect-info-uid --ag-resource --enabled --filter-enabled --log-custom-target --log-custom-target-conf --log-file --log-filters --log-path --logtopic-enabled --regexp-str --resource-mode --resource-type --resources --tag-resource " -- $cur) ) ;; - "describe-file-system") + "describe-collect-resources") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --file-system-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --collect-info-uid --page-number --page-size " -- $cur) ) ;; - "modify-file-system-attribute") + "update-collect-resources") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --file-system-id --name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --collect-info-uid --action --resources " -- $cur) ) ;; - "delete-file-system") + "create-collect-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --file-system-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logtopic-uid --ag-resource --app-code --enabled --filter-enabled --log-custom-target --log-custom-target-conf --log-file --log-filters --log-path --logtopic-enabled --regexp-str --resource-mode --resource-type --resources --service-code --tag-resource --template-uid " -- $cur) ) ;; - "describe-mount-targets") + "create-parser") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logtopic-uid --parser-fields --parser-mode --parser-pattern --parser-sample --pipelines " -- $cur) ) ;; - "create-mount-target") + "describe-parser") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --file-system-id --subnet-id --vpc-id --security-group-id --client-token " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logtopic-uid " -- $cur) ) ;; - "describe-mount-target") + "update-parser") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --mount-target-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logtopic-uid --parser-fields --parser-mode --parser-pattern --parser-sample --pipelines " -- $cur) ) ;; - "delete-mount-target") + "validate-parser") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --mount-target-id " -- $cur) ) + -W "-h --help --headers --input-json --parser-mode --parser-pattern --parser-sample --pipelines " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "histograms") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid --action --expr --case-sensitive --start-time --end-time " -- $cur) ) ;; - esac - ;; - - "vod") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "list-categories") + "get-logs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --sorts " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid --task-id --expr --start-time --end-time --sort --filters " -- $cur) ) ;; - "create-category") + "search") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --name --parent-id --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid --action --expr --case-sensitive --start-time --end-time --page-number --page-size --sort --filters " -- $cur) ) ;; - "get-category-with-children") + "describe-logtopics") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --category-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --page-number --page-size --name --app-name " -- $cur) ) ;; - "get-category") + "create-logtopic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --category-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --name --description " -- $cur) ) ;; - "update-category") + "delete-logtopic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --category-id --name --parent-id --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uids " -- $cur) ) ;; - "delete-category") + "describe-logtopic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --category-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logtopic-uid " -- $cur) ) ;; - "list-domains") + "update-logtopic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --sorts " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logtopic-uid --description " -- $cur) ) ;; - "create-domain") + "test-metric-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid --aggregate --content --data-field --filter-content --filter-open --filter-type --metric --setting-type --sql-spec " -- $cur) ) ;; - "get-domain") + "describe-metric-tasks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid --page-number --page-size " -- $cur) ) ;; - "delete-domain") + "create-metric-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid --aggregate --custom-unit --data-field --filter-content --filter-open --filter-type --interval --metric --name --setting-type --sql-spec --unit " -- $cur) ) ;; - "enable-domain") + "describe-metric-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid --logmetrictask-uid " -- $cur) ) ;; - "disable-domain") + "update-metric-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid --logmetrictask-uid --aggregate --custom-unit --data-field --filter-content --filter-open --filter-type --metric --name --setting-type --sql-spec --unit " -- $cur) ) ;; - "set-default-domain") + "delete-metric-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid --logmetrictask-uid " -- $cur) ) ;; - "set-header") + "create-parser") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id --header-name --header-value --header-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logtopic-uid --parser-fields --parser-mode --parser-pattern --parser-sample --pipelines " -- $cur) ) ;; - "list-headers") + "describe-subscribe") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid " -- $cur) ) ;; - "delete-header") + "create-subscribe") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id --header-name --header-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid " -- $cur) ) ;; - "set-referer-rule") + "update-subscribe") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id --config --enabled " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --logtopic-uid --status " -- $cur) ) ;; - "get-referer-rule") + "describe-logsets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --name " -- $cur) ) ;; - "set-urlrule") + "create-logset") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id --config --enabled " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name --description --life-cycle " -- $cur) ) ;; - "get-urlrule") + "describe-logset") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid " -- $cur) ) ;; - "set-iprule") + "update-logset") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id --config --enabled " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uid --description --life-cycle " -- $cur) ) ;; - "get-iprule") + "delete-logset") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --logset-uids " -- $cur) ) ;; - "set-http-ssl") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "cps") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-ipv6address") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id --source --title --ssl-cert --ssl-key --jump-type --enabled " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ipv6address-id " -- $cur) ) ;; - "get-http-ssl") + "describe-ipv6addresses") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --ipv6gateway-id --ipv6address --enable-internet --filters " -- $cur) ) ;; - "create-live-to-vod-task") + "assign-ipv6addresses-bandwidth") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --title --file-name --file-size --cover-url --description --category-id --tags --transcode-template-ids --watermark-ids --publish-domain --app-name --stream-name --record-times --record-file-type --task-external-id --priority " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --ipv6address-spec " -- $cur) ) ;; - "create-video-upload-task") + "modify-ipv6address-bandwidth") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --http-method --title --file-name --file-size --cover-url --description --category-id --tags --transcode-template-ids --watermark-ids --user-data " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ipv6address-id --client-token --bandwidth " -- $cur) ) ;; - "refresh-video-upload-task") + "describe-certs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --video-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --name --filters " -- $cur) ) ;; - "create-image-upload-task") + "create-cert") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --http-method --file-name --file-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --cert-spec " -- $cur) ) ;; - "submit-quality-detection-job") + "describe-cert") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --media-id --template-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cert-id " -- $cur) ) ;; - "batch-submit-quality-detection-jobs") + "remove-cert") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --bulk-items " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cert-id " -- $cur) ) ;; - "list-quality-detection-templates") + "modify-cert") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --cert-id --name " -- $cur) ) ;; - "create-quality-detection-template") + "describe-alias-ips") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --name --template-type --detections " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --subnet-id --instance-id --cidr --filters " -- $cur) ) ;; - "get-quality-detection-template") + "create-alias-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --alias-ip-spec " -- $cur) ) ;; - "update-quality-detection-template") + "delete-alias-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template-id --name --detections " -- $cur) ) + -W "-h --help --headers --input-json --region-id --alias-ip-id --client-token " -- $cur) ) ;; - "delete-quality-detection-template") + "describe-secondary-cidrs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --subnet-id " -- $cur) ) ;; - "submit-transcode-job") + "create-secondary-cidr") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --video-id --template-ids --watermark-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --secondary-cidr-spec " -- $cur) ) ;; - "batch-submit-transcode-jobs") + "delete-secondary-cidr") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --bulk-items " -- $cur) ) + -W "-h --help --headers --input-json --region-id --secondary-cidr-id --client-token " -- $cur) ) ;; - "list-transcode-templates") + "describe-elastic-ips") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --status --include-lb --charge-mode --instance-id --subnet-id --filters " -- $cur) ) ;; - "create-transcode-template") + "apply-elastic-ips") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --name --video --audio --encapsulation --definition --template-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --elastic-ip-spec " -- $cur) ) ;; - "get-transcode-template") + "describe-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --elastic-ip-id " -- $cur) ) ;; - "update-transcode-template") + "modify-elastic-ip-bandwidth") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template-id --name --video --audio --encapsulation --definition --template-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --elastic-ip-id --client-token --bandwidth " -- $cur) ) ;; - "delete-transcode-template") + "describe-elastic-ip-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --elastic-ip-id " -- $cur) ) ;; - "list-videos") + "describe-server-groups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --filters --sorts " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --name --load-balancer-id --filters " -- $cur) ) ;; - "get-video") + "create-server-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --video-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --server-group-spec " -- $cur) ) ;; - "update-video") + "describe-server-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --video-id --name --category-id --tags --cover-url --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --server-group-id " -- $cur) ) ;; - "delete-video") + "modify-server-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --video-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --server-group-id --name " -- $cur) ) ;; - "batch-delete-videos") + "delete-server-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --video-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --server-group-id " -- $cur) ) ;; - "batch-update-videos") + "describe-keypairs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --bulk-items " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --name --filters " -- $cur) ) ;; - "get-video-play-info") + "create-keypairs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --video-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --name " -- $cur) ) ;; - "delete-video-streams") + "import-keypairs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --video-id --task-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --name --public-key " -- $cur) ) ;; - "video-audit") + "describe-keypair") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --video-id --audit-result " -- $cur) ) + -W "-h --help --headers --input-json --region-id --keypair-id " -- $cur) ) + ;; + "delete-keypairs") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --keypair-id " -- $cur) ) ;; - "list-watermarks") + "describe-load-balancers") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --status --name --vpc-id --bind-eip --filters " -- $cur) ) ;; - "create-watermark") + "create-load-balancer") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --name --img-url --width --height --size-unit --position --offset-x --offset-y --offset-unit " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --load-balancer-spec " -- $cur) ) ;; - "get-watermark") + "modify-load-balancer") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --watermark-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id --name --description " -- $cur) ) ;; - "update-watermark") + "describe-load-balancer") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --watermark-id --name --img-url --width --height --size-unit --position --offset-x --offset-y --offset-unit " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id " -- $cur) ) ;; - "delete-watermark") + "start-load-balancer") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --watermark-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id --client-token " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "stop-load-balancer") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --load-balancer-id --client-token " -- $cur) ) ;; - esac - ;; - - "yundingdatapush") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-datapush-venders") + "associate-elastic-ip-lb") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --appkey --page-number --page-size --yd-rds-instance-id --rds-instance-name --vender-id --vender-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id --client-token --elastic-ip-id " -- $cur) ) ;; - "add-datapush-vender") + "disassociate-elastic-ip-lb") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --datapush-vender " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id --client-token --elastic-ip-id " -- $cur) ) ;; - "delete-datapush-vender") + "describe-slbs-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --appkey --yd-rds-instance-id --vender-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --load-balancer-id " -- $cur) ) ;; - "describe-rds-instances") + "describe-servers") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --appkey " -- $cur) ) + -W "-h --help --headers --input-json --region-id --server-group-id --page-number --page-size --listener-id --filters " -- $cur) ) ;; - "create-order-sync") + "add-servers") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --order-sync-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --server-group-id --client-token --server-spec " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "modify-server") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --server-group-id --server-id --weight " -- $cur) ) ;; - esac - ;; - - "datastar") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "get-large-screen-data") + "remove-server") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --region --industry --start-date --end-date --first-index --second-index " -- $cur) ) + -W "-h --help --headers --input-json --region-id --server-group-id --server-id " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-ipv6gateways") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --page-number --page-size --ipv6gateway-name --filters " -- $cur) ) ;; - esac - ;; - - "kms") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-key-list") + "describe-ipv6gateway") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ipv6gateway-id " -- $cur) ) ;; - "create-key") + "modify-ipv6gateway") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-cfg " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ipv6gateway-id --client-token --ipv6gateway-name " -- $cur) ) ;; - "describe-key") + "describe-basic-subnet") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --az " -- $cur) ) ;; - "update-key-description") + "describe-subnets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id --key-cfg " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --az --name --vpc-id --filters " -- $cur) ) ;; - "enable-key") + "create-subnet") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --subnet-spec " -- $cur) ) ;; - "disable-key") + "assign-ipv6cidr") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --subnet-id --client-token --ipv6cidr " -- $cur) ) ;; - "schedule-key-deletion") + "describe-subnet") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id --delay-days " -- $cur) ) + -W "-h --help --headers --input-json --region-id --subnet-id " -- $cur) ) ;; - "cancel-key-deletion") + "modify-subnet") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --subnet-id --name --description " -- $cur) ) ;; - "key-rotation") + "delete-subnet") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --subnet-id --client-token " -- $cur) ) ;; - "encrypt") + "describe-vpc") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id --plaintext " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-id " -- $cur) ) ;; - "decrypt") + "modify-vpc") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id --ciphertext-blob " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-id --name --description " -- $cur) ) ;; - "get-public-key") + "delete-vpc") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-id --client-token " -- $cur) ) ;; - "sign") + "describe-vpcs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id --plaintext " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --name --filters " -- $cur) ) ;; - "validate") + "create-vpc") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id --plaintext --signature " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --vpc-spec " -- $cur) ) ;; - "generate-data-key") + "assign-ipv6gateway") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-id --client-token " -- $cur) ) ;; - "describe-key-detail") + "describe-listeners") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --name --load-balancer-id --filters " -- $cur) ) ;; - "enable-key-version") + "create-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id --version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --listener-spec " -- $cur) ) ;; - "disable-key-version") + "modify-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id --version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --listener-id --algorithm --sticky-session --real-ip --name --description --health-check --health-check-timeout --health-check-interval --healthy-threshold --unhealthy-threshold --server-group-id --sticky-session-timeout --cookie-type --health-check-uri --health-check-http-code --certificate-id --headers " -- $cur) ) ;; - "schedule-key-version-deletion") + "describe-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id --version --delay-days " -- $cur) ) + -W "-h --help --headers --input-json --region-id --listener-id " -- $cur) ) ;; - "cancel-key-version-deletion") + "delete-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --key-id --version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --listener-id " -- $cur) ) ;; - "describe-secret-list") + "start-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --listener-id --client-token " -- $cur) ) ;; - "create-secret") + "stop-listener") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-cfg " -- $cur) ) + -W "-h --help --headers --input-json --region-id --listener-id --client-token " -- $cur) ) ;; - "import-secret") + "describe-device-types") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-package " -- $cur) ) + -W "-h --help --headers --input-json --region-id --az " -- $cur) ) ;; - "describe-secret-version-list") + "describe-os") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --device-type --os-type " -- $cur) ) ;; - "update-secret") + "describe-device-raids") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-id --secret-desc-cfg " -- $cur) ) + -W "-h --help --headers --input-json --region-id --device-type --volume-type " -- $cur) ) ;; - "enable-secret") + "describe-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "disable-secret") + "describe-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --az --name --network-type --device-type --subnet-id --keypair-id --enable-internet --private-ip --interface-mode --filters " -- $cur) ) ;; - "delete-secret") + "create-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --instance-spec " -- $cur) ) ;; - "create-secret-version") + "describe-instance-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-id --secret-version-cfg " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "export-secret") + "assign-ipv6address") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --client-token --ipv6address --subnet-id " -- $cur) ) ;; - "describe-secret-version-info") + "modify-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-id --version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --name --description " -- $cur) ) ;; - "update-secret-version") + "describe-instance-raid") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-id --version --secret-time-cfg " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "enable-secret-version") + "describe-instance-status") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-id --version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "disable-secret-version") + "restart-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-id --version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --client-token " -- $cur) ) ;; - "delete-secret-version") + "stop-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --secret-id --version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --client-token " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "start-instance") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id --client-token " -- $cur) ) ;; - esac - ;; - - "elite") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "jdx-query-delivery-info") + "restart-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --order-number " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --instance-ids " -- $cur) ) ;; - "jdx-report-order") + "stop-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --report-order-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --instance-ids " -- $cur) ) ;; - "jdx-create-order") + "start-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --create-order-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --client-token --instance-ids " -- $cur) ) ;; - "jdx-query-price") + "reinstall-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --query-price-param " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --client-token --instance-spec " -- $cur) ) ;; - "jdx-query-product") + "modify-bandwidth") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-no --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --client-token --bandwidth " -- $cur) ) ;; - "list-sale-service") + "associate-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-no --page-size --deliver-number --deliver-status --create-dt-start --create-dt-end " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --client-token --elastic-ip-id --target-ip --subnet-id " -- $cur) ) ;; - "get-sale-service-by-deliver-number") + "disassociate-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --deliver-number " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --client-token --elastic-ip-id " -- $cur) ) ;; - "confirm-sale-service-delivery") + "reset-password") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --confirm-delivery-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --client-token --password " -- $cur) ) ;; - "get-store-service") + "describe-available-private-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --buyer-pin --business-data --query-all " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --subnet-id " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-instance-monitor-info") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id --start-time --end-time --filters " -- $cur) ) ;; - esac - ;; - - "ossopenapi") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "get-single-bucket-capacity") + "describe-event-logs") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size " -- $cur) ) + ;; + "describe-route-table") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --bucket-name --capacity-types --begin-time --end-time --period-type --method " -- $cur) ) + -W "-h --help --headers --input-json --region-id --route-table-id " -- $cur) ) ;; - "get-back-source-configuration") + "describe-route-tables") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --bucket-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --name --vpc-id --filters " -- $cur) ) ;; - "put-back-source-configuration") + "describe-regiones") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --bucket-name --back-source-rules " -- $cur) ) + -W "-h --help --headers --input-json --network-type " -- $cur) ) ;; - "delete-back-source-configuration") + "describe-cpslbregions") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --bucket-name " -- $cur) ) + -W "-h --help --headers --input-json " -- $cur) ) ;; "generate-skeleton") @@ -4755,204 +6179,216 @@ _jdc_complete() esac ;; - "iam") + "httpdns") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "enable-sub-user-access-key") + "get-account-id") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --sub-user --access-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "disable-sub-user-access-key") + "create-account") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --sub-user --access-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "delete-sub-user-access-key") + "get-account-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --sub-user --access-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "create-group") + "operate-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --create-group-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --action --key " -- $cur) ) ;; - "describe-group") + "get-domains") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --group-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-index --page-size --domain-name " -- $cur) ) ;; - "update-group") + "add-domains") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --group-name --update-group-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-names " -- $cur) ) ;; - "delete-group") + "del-domains") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --group-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --domain-names " -- $cur) ) ;; - "describe-group-sub-users") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --group-name --page-number --page-size " -- $cur) ) + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; - "describe-groups") + esac + ;; + + "disk") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-disks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --keyword --sort " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --tags --filters " -- $cur) ) ;; - "describe-attached-group-policies") + "create-disks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --group-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --disk-spec --max-count --user-tags --client-token " -- $cur) ) ;; - "detach-group-policy") + "describe-disk") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --group-name --policy-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --disk-id " -- $cur) ) ;; - "attach-group-policy") + "modify-disk-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --group-name --policy-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --disk-id --name --description " -- $cur) ) ;; - "remove-sub-user-from-group") + "delete-disk") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --group-name --sub-user " -- $cur) ) + -W "-h --help --headers --input-json --region-id --disk-id " -- $cur) ) ;; - "add-sub-user-to-group") + "restore-disk") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --group-name --sub-user " -- $cur) ) + -W "-h --help --headers --input-json --region-id --disk-id --snapshot-id " -- $cur) ) ;; - "create-permission") + "extend-disk") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --create-permission-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --disk-id --disk-size-gb --iops " -- $cur) ) ;; - "describe-permission-detail") + "describe-volumes-ignore-service-code") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --permission-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --tags --filter-groups " -- $cur) ) ;; - "update-permission") + "describe-quota") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --permission-id --update-permission-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --type " -- $cur) ) ;; - "describe-permissions") + "describe-snapshots") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --keyword --query-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --snapshot-source --filters " -- $cur) ) ;; - "describe-sub-user-permissions") + "create-snapshot") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --sub-user --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --snapshot-spec --client-token " -- $cur) ) ;; - "add-permissions-to-sub-user") + "delete-snapshots") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --sub-user --add-permissions-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --snapshot-ids " -- $cur) ) ;; - "remove-permission-of-sub-user") + "describe-snapshot") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --permission-id --sub-user " -- $cur) ) + -W "-h --help --headers --input-json --region-id --snapshot-id " -- $cur) ) ;; - "create-policy") + "modify-snapshot-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --create-policy-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --snapshot-id --name --description --expire-time " -- $cur) ) ;; - "describe-policy") + "delete-snapshot") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --policy-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --snapshot-id " -- $cur) ) ;; - "update-policy") + "describe-snapshots-capacity") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --policy-name --update-policy-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "delete-policy") + "describe-snapshot-chain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --policy-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --disk-id --snapshot-id " -- $cur) ) ;; - "update-policy-description") + "describe-soldout") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --policy-name --update-policy-description-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-policies") + "create-snapshot-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --keyword --query-type --sort " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name --interval --effective-time --snapshot-lifecycle --contact-info --status " -- $cur) ) ;; - "create-role") + "update-snapshot-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --create-role-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --policy-id --name --interval --effective-time --snapshot-lifecycle --contact-info --status " -- $cur) ) ;; - "describe-role") + "delete-snapshot-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --role-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --policy-id " -- $cur) ) ;; - "delete-role") + "describe-snapshot-policies") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --role-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name --policy-id --status --order --page-number --page-size " -- $cur) ) ;; - "update-assume-role-policy") + "describe-snap-polices") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --role-name --update-assume-role-policy-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --filter-groups --order --page-number --page-size " -- $cur) ) ;; - "describe-roles") + "apply-snapshot-policies") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --role-name --type --sort " -- $cur) ) + -W "-h --help --headers --input-json --region-id --relations " -- $cur) ) ;; - "attach-role-policy") + "describe-snapshot-policy-disk-relations") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --role-name --policy-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --disk-id --disk-region --policy-id --page-number --page-size " -- $cur) ) ;; - "detach-role-policy") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --role-name --policy-name " -- $cur) ) + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; - "describe-role-policies") + esac + ;; + + "nc") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-secrets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --role-name --page-number --page-size --keyword --sort " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "create-sub-user") + "create-secret") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --create-sub-user-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name --secret-type --data " -- $cur) ) ;; - "describe-sub-user") + "describe-secret") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --sub-user " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) ;; - "update-sub-user") + "delete-secret") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --sub-user --update-sub-user-info " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name " -- $cur) ) ;; - "delete-sub-user") + "describe-quota") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --sub-user " -- $cur) ) + -W "-h --help --headers --input-json --region-id --resource-type " -- $cur) ) ;; - "describe-sub-users") + "describe-containers") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --keyword --sort " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "describe-sub-user-groups") + "create-containers") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --sub-user " -- $cur) ) + -W "-h --help --headers --input-json --region-id --container-spec --max-count " -- $cur) ) ;; - "describe-attached-sub-user-policies") + "describe-container") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --sub-user " -- $cur) ) + -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) ;; - "detach-sub-user-policy") + "delete-container") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --sub-user --policy-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) ;; - "attach-sub-user-policy") + "start-container") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --sub-user --policy-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) ;; - "describe-user-access-keys") + "stop-container") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --container-id " -- $cur) ) ;; - "create-user-access-key") + "modify-container-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --container-id --name --description " -- $cur) ) ;; - "enabled-user-access-key") + "associate-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --container-id --elastic-ip-id " -- $cur) ) ;; - "disabled-user-access-key") + "disassociate-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --container-id --elastic-ip-id " -- $cur) ) ;; - "delete-user-access-key") + "get-logs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --access-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --container-id --tail-lines --since-seconds --limit-bytes " -- $cur) ) ;; "generate-skeleton") @@ -4961,238 +6397,236 @@ _jdc_complete() esac ;; - "iothub") + "vm") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-thing-shadow") + "describe-instance-templates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --identifier --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "update-thing-shadow") + "create-instance-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --identifier --product-key --state --version " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-template-data --name --description " -- $cur) ) ;; - "invoke-thing-service") + "describe-instance-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --identifier --product-key --name --input " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-template-id " -- $cur) ) ;; - "query-device-page") + "update-instance-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --device-name --status --product-key --device-type --now-page --page-size --order --direction --parent-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-template-id --name --description --instance-template-data " -- $cur) ) ;; - "update-device") + "delete-instance-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --device-id --model --manufacturer --description --status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-template-id " -- $cur) ) ;; - "add-device") + "verify-instance-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --device-name --product-key --model --manufacturer --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-template-id " -- $cur) ) ;; - "query-device-detail") + "describe-instance-templates-customdata") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --device-name --region-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --filters " -- $cur) ) ;; - "remove-device") + "describe-keypairs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --device-name --region-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + ;; + "create-keypair") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --key-name " -- $cur) ) + ;; + "import-keypair") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --key-name --public-key " -- $cur) ) + ;; + "delete-keypair") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --key-name " -- $cur) ) + ;; + "attach-keypair") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --key-name --instance-ids --pass-word-auth " -- $cur) ) ;; - "remove-device-by-id") + "detach-keypair") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --device-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --key-name --instance-ids " -- $cur) ) ;; - "list-products") + "describe-image") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --image-id " -- $cur) ) ;; - "create-product") + "delete-image") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --product-name --product-type --product-description --template-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --image-id --delete-snapshot " -- $cur) ) ;; - "describe-product") + "describe-images") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --image-source --offline --platform --ids --image-name --root-device-type --launch-permission --status --service-code --architecture --page-number --page-size " -- $cur) ) ;; - "update-product") + "describe-image-constraints") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --product-key --product-name --product-description --dynamic-register " -- $cur) ) + -W "-h --help --headers --input-json --region-id --image-id " -- $cur) ) ;; - "delete-product") + "describe-image-constraints-batch") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ids " -- $cur) ) ;; - "list-product-abilities") + "share-image") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --product-key --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --image-id --pins " -- $cur) ) ;; - "import-thing-model") + "un-share-image") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --product-key --thing-model " -- $cur) ) + -W "-h --help --headers --input-json --region-id --image-id --pins " -- $cur) ) ;; - "export-thing-model") + "release-image") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --product-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --image-id " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "un-release-image") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --image-id " -- $cur) ) ;; - esac - ;; - - "sms") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "batch-send") + "describe-image-members") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --template-id --sign-id --phone-list --params " -- $cur) ) + -W "-h --help --headers --input-json --region-id --image-id " -- $cur) ) ;; - "status-report") + "copy-images") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --sequence-number --phone-list " -- $cur) ) + -W "-h --help --headers --input-json --region-id --source-image-ids --destination-region " -- $cur) ) ;; - "reply") + "modify-image-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --app-id --data-date --phone-list " -- $cur) ) + -W "-h --help --headers --input-json --region-id --image-id --name --description " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "import-image") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --architecture --os-type --platform --disk-format --system-disk-size-gb --image-url --os-version --image-name --description --force-import --client-token " -- $cur) ) ;; - esac - ;; - - "jcq") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-access-point") + "export-image") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --image-id --role-name --oss-url --oss-prefix --client-token " -- $cur) ) ;; - "describe-consumer-group-ids") + "image-tasks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --task-action --task-ids --task-status --start-time --end-time --page-number --page-size " -- $cur) ) ;; - "describe-dead-letter-numbers") + "describe-quotas") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --consumer-group-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --filters --image-id " -- $cur) ) ;; - "describe-dead-letter-numbers-with-topic") + "describe-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --tags --filters " -- $cur) ) ;; - "list-dead-letters") + "create-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --page-number --page-size --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-spec --max-count --client-token " -- $cur) ) ;; - "delete-dead-letters") + "describe-brief-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --message-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --tags --filters " -- $cur) ) ;; - "resend-dead-letters") + "describe-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --message-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "describe-messages") + "delete-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --start-time --end-time --page-size --page-number " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "describe-message") + "describe-instance-status") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --message-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "describe-message-trace") + "describe-instance-private-ip-address") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --message-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "describe-messages-by-business-id") + "stop-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --business-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --charge-on-stopped " -- $cur) ) ;; - "describe-permission") + "start-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "add-permission") + "reboot-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --permission --target-user-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "remove-permission") + "attach-network-interface") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --permission --target-user-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --network-interface-id --auto-delete " -- $cur) ) ;; - "describe-subscriptions") + "detach-network-interface") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-filter --page-size --page-number " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --network-interface-id " -- $cur) ) ;; - "create-subscription") + "modify-instance-network-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --message-invisible-time-in-seconds --dlq-enable --max-retry-times " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --networks " -- $cur) ) ;; - "describe-subscription") + "associate-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --elastic-ip-id " -- $cur) ) ;; - "modify-subscription-attribute") + "disassociate-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --max-retry-times --message-invisible-time-in-seconds --dlq-enable " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --elastic-ip-id " -- $cur) ) ;; - "delete-subscription") + "create-image") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --name --description --data-disks " -- $cur) ) ;; - "clean-messages") + "attach-disk") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --disk-id --device-name --auto-delete " -- $cur) ) ;; - "reset-consume-offset") + "detach-disk") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --consumer-group-id --time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --disk-id --force " -- $cur) ) ;; - "describe-topics") + "modify-instance-disk-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-size --page-number --topic-filter --tag-filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --data-disks " -- $cur) ) ;; - "create-topic") + "modify-instance-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name --type --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --name --description --hostname --metadata --userdata " -- $cur) ) ;; - "describe-topic") + "modify-instance-vpc-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --subnet-id --assign-ipv6 --private-ip-address --security-groups " -- $cur) ) ;; - "delete-topic") + "modify-instance-password") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --topic-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --password " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-instance-vnc-url") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - esac - ;; - - "resourcetag") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-resources") + "resize-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --resource-vo " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --instance-type --force " -- $cur) ) ;; - "describe-tags") + "rebuild-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --tag-keys-vo " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --password --image-id --key-names --hostname --metadata --userdata --pass-word-auth --image-inherit " -- $cur) ) ;; - "tag-resources") + "describe-instances-custom-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --tag-resources " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "un-tag-resources") + "modify-instance-placement") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --un-tag-resources " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --ag-id --balance --clear-local-disk " -- $cur) ) ;; - "query-resource") + "describe-instance-types") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --query-resource " -- $cur) ) + -W "-h --help --headers --input-json --region-id --service-name --filters " -- $cur) ) ;; "generate-skeleton") @@ -5201,710 +6635,722 @@ _jdc_complete() esac ;; - "baseanti") + "iotcore") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-attack-logs") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --start-time --end-time --ip " -- $cur) ) - ;; - "describe-attack-statistics") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --ip " -- $cur) ) - ;; - "describe-attack-type-count") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --ip " -- $cur) ) - ;; - "describe-ip-monitor-flow") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --start-time --end-time --ip " -- $cur) ) - ;; - "describe-ip-resources") + "list-product-abilities") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --ip " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-key --page-number --page-size --filters " -- $cur) ) ;; - "describe-elastic-ip-resources") + "import-thing-model") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-key --thing-model " -- $cur) ) ;; - "describe-cps-ip-resources") + "export-thing-model") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-key " -- $cur) ) ;; - "describe-ccs-ip-resources") + "invoke-thing-topic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --identifier --product-key --topic-short-name --topic-message " -- $cur) ) ;; - "describe-ip-resource-info") + "describe-thing-shadow") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --ip " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --identifier --product-key " -- $cur) ) ;; - "describe-ip-safety-info") + "update-thing-shadow") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --ip " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --identifier --product-key --state --version " -- $cur) ) ;; - "set-clean-threshold") + "invoke-thing-service") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --ip --clean-threshold-spec " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --identifier --product-key --name --input " -- $cur) ) ;; - "set-ip-clean-threshold") + "add-device-links") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --ip-clean-threshold-spec " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --parent-id --product-key --children " -- $cur) ) ;; - "describe-ip-clean-threshold-range") + "query-device-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --ip " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --device-name --status --product-key --device-type --now-page --page-size --order --direction --parent-id --order-id --device-collector-type " -- $cur) ) ;; - "describe-ip-resource-protect-info") + "update-device") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --ip --start --limit " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --device-id --model --manufacturer --description --status " -- $cur) ) ;; - "describe-ip-resource-flow") + "add-device") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --ip --end-time " -- $cur) ) - ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --device-name --product-key --model --manufacturer --description " -- $cur) ) ;; - esac - ;; - - "ias") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "apps") + "query-device-detail") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pin --app-name --client-id --multi-tenant --state --scope --start-time --end-time --account-type --page-index --page-size --offset " -- $cur) ) + -W "-h --help --headers --input-json --device-name --instance-id --region-id --product-key " -- $cur) ) ;; - "app-detail") + "remove-device") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-id " -- $cur) ) + -W "-h --help --headers --input-json --device-name --instance-id --region-id --product-key " -- $cur) ) ;; - "state") + "list-products") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --filters " -- $cur) ) ;; - "create-app") + "create-product") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-name --token-endpoint-auth-method --grant-types --redirect-uris --client-uri --logo-uri --tos-uri --policy-uri --scope --jwks-uri --jwks --contacts --extension --access-token-validity-seconds --refresh-token-validity-seconds --multi-tenant --secret --user-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-name --product-type --product-description " -- $cur) ) ;; - "get-app") + "describe-product") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-key " -- $cur) ) ;; - "update-app") + "update-product") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-id --client-name --token-endpoint-auth-method --grant-types --redirect-uris --client-uri --logo-uri --tos-uri --policy-uri --scope --jwks-uri --jwks --contacts --extension --access-token-validity-seconds --refresh-token-validity-seconds --multi-tenant --secret --user-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-key --product-name --product-description --dynamic-register " -- $cur) ) ;; - "delete-app") + "delete-product") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --client-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-key " -- $cur) ) ;; - "get-apps") + "update-loo-device") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --device-id --model --manufacturer --description --status --identifier --device-name " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "add-loo-device") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --instance-id --region-id --pre-order-id --user-pin-param --device-name --product-key --model --manufacturer --identifier --description " -- $cur) ) ;; - esac - ;; - - "mongodb") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-instances") + "loongray-query-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tag-filters --sorts " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --device-name --manufacturer --model --status --product-key --device-type --now-page --page-size --order --direction --parent-id --order-id --device-collector-type --query-user-pin " -- $cur) ) ;; - "create-instance") + "query-admin-statistics") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-spec --charge-spec " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --product-key --parent-id --device-collector-type --query-user-pin " -- $cur) ) ;; - "delete-instance") + "remove-loongray-device") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --device-name --instance-id --region-id --product-key " -- $cur) ) ;; - "reset-password") + "register-device") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --account-password " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-info-vo " -- $cur) ) ;; - "modify-instance-spec") + "download-device-certificate") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --instance-class --instance-storage-gb " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-id " -- $cur) ) ;; - "modify-instance-name") + "delete-device") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --instance-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-id " -- $cur) ) ;; - "describe-backup-policy") + "describe-device") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-id " -- $cur) ) ;; - "modify-backup-policy") + "describe-thing-type-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --preferred-backup-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-meta-id --device-meta-name --node-type --page-no --page-size " -- $cur) ) ;; - "restore-instance") + "describe-thing-type") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --backup-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-meta-id " -- $cur) ) ;; - "describe-flavors") + "describe-thing-model") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --thing-type-code --thing-model-version " -- $cur) ) ;; - "describe-available-zones") + "set-device-property") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-property-vo " -- $cur) ) ;; - "restart-instance") + "invoke-function") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-function-vo " -- $cur) ) ;; - "create-sharding-instance") + "describe-event-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --sharding-instance-spec --charge-spec " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --event-report-page-bo " -- $cur) ) ;; - "modify-node-spec") + "describe-function-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --node-id --node-type --node-storage-gb " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --function-call-page-bo " -- $cur) ) ;; - "restart-node") + "describe-property") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --node-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-id " -- $cur) ) ;; - "describe-backups") + "describe-property-snapshot") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-snapshot-request-vo " -- $cur) ) ;; - "create-backup") + "create-device-topo") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --backup-name --backup-method " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-topo-info-vo " -- $cur) ) ;; - "delete-backup") + "describe-device-topo") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --backup-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-topo-page-bo " -- $cur) ) ;; - "backup-download-url") + "update-device-topo") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --backup-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-topo-info-vo " -- $cur) ) ;; - "describe-backup-synchronicities") + "delete-device-topo") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --device-topo-info-vo " -- $cur) ) ;; - "create-backup-synchronicity") + "describe-product-with-admin") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --src-region --dst-region " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-key " -- $cur) ) ;; - "delete-backup-synchronicities") + "update-product-with-admin") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --service-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-key --product-name --product-description --dynamic-register " -- $cur) ) ;; - "describe-security-ips") + "delete-product-with-admin") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-key " -- $cur) ) ;; - "modify-security-ips") + "list-products-with-admin") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --modify-mode --security-ips " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size --filters " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "create-admin-product") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --instance-id --product-name --product-type --product-description --coll-device-type " -- $cur) ) ;; - esac - ;; - - "jdfusion") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "get-cloud-infos") + "describe-product-topics") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --driver " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-key --page-number --page-size --filters " -- $cur) ) ;; - "regist-cloud-info") + "create-product-topic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cloud " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-key --topic-short-name --topic-operation --topic-description " -- $cur) ) ;; - "get-cloud-info-by-id") + "describe-product-topic") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cloud-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --product-key --topic-id " -- $cur) ) ;; - "unregist-cloud-info") + "get-device-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cloud-id " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --group-name --query-user-pin --tag --page-number --page-size " -- $cur) ) ;; - "valid-cloud-info") + "get-device-group-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --cloud-id " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --query-user-pin " -- $cur) ) ;; - "get-deployments") + "find-device-group-link-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --product-key --device-name --device-collector-type --group-name --user-pin --tag --group-id --manufacturer --model --order-id --status --page-number --page-size --order --direction " -- $cur) ) ;; - "create-deployment") + "elevator-operating-status") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --deployment " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --identifier " -- $cur) ) ;; - "reverse-deployment") + "collector-read-message") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --reverse " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --identifier --protocol " -- $cur) ) ;; - "get-deployments-by-id") + "read-holding-registers") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --identifier --address-of-first-register --number-of-registers " -- $cur) ) ;; - "edit-deployment") + "collector-write-message") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --deployment " -- $cur) ) + -W "-h --help --headers --input-json --instance-id --region-id --identifier --protocol --data " -- $cur) ) ;; - "delete-deployment") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "zfs") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-mount-targets") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "clone-deployment") + "create-mount-target") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --deployment " -- $cur) ) + -W "-h --help --headers --input-json --region-id --file-system-id --subnet-id --vpc-id --security-group-id --client-token " -- $cur) ) ;; - "dryrun-deployment") + "describe-mount-target") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --mount-target-id " -- $cur) ) ;; - "apply-deployment") + "delete-mount-target") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --apply " -- $cur) ) + -W "-h --help --headers --input-json --region-id --mount-target-id " -- $cur) ) ;; - "get-deployment-result") + "describe-file-systems") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --tags --filters " -- $cur) ) ;; - "get-deployment-versions") + "create-file-system") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name --description --client-token --file-system-type --service-code " -- $cur) ) ;; - "get-deployments-version") + "describe-file-system") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --version_id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --file-system-id " -- $cur) ) ;; - "rollback-deployments-version") + "modify-file-system-attribute") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --version_id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --file-system-id --name --description " -- $cur) ) ;; - "get-deployments-results-by-id-record") + "delete-file-system") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --record " -- $cur) ) + -W "-h --help --headers --input-json --region-id --file-system-id " -- $cur) ) ;; - "get-disks") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "ams") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-streams-input") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vm-id " -- $cur) ) + -W "-h --help --headers --input-json --stream-id --start-time --end-time " -- $cur) ) ;; - "create-disk") + "describe-authenticate") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --disk " -- $cur) ) + -W "-h --help --headers --input-json --p-id --ver " -- $cur) ) ;; - "get-disk-by-id") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "jdro") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-resource-type-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --product --search " -- $cur) ) ;; - "remove-disk-by-id") + "describe-resource-type-specification") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --resource-type " -- $cur) ) ;; - "attach-disk-to-vm-instance-by-disk-id") + "describe-stacks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --attach " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --stack-name --action --status --create-start-time --create-end-time --update-start-time --update-end-time --sort-field --sort-by " -- $cur) ) ;; - "detach-disk-to-vm-instance-by-disk-id") + "create-stack") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --detach " -- $cur) ) + -W "-h --help --headers --input-json --region-id --environment --template " -- $cur) ) ;; - "get-buckets") + "describe-stack") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --stack-id " -- $cur) ) ;; - "create-bucket") + "delete-stack") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --bucket " -- $cur) ) + -W "-h --help --headers --input-json --region-id --stack-id " -- $cur) ) ;; - "get-bucket-by-name") + "create-change-set") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --stack-id --environment --template " -- $cur) ) ;; - "delete-bucket") + "execute-change-set") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --stack-id --changeset-id " -- $cur) ) ;; - "get-bucket-files") + "describe-stack-events") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name --marker " -- $cur) ) + -W "-h --help --headers --input-json --region-id --stack-id --page-number --page-size --start-time --end-time " -- $cur) ) ;; - "get-transfer-tasks") + "describe-stack-resources") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --stack-id --page-number --page-size --search --product " -- $cur) ) ;; - "create-transfer-task") + "describe-stack-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --task " -- $cur) ) + -W "-h --help --headers --input-json --region-id --stack-id " -- $cur) ) ;; - "get-transfer-task-by-id") + "validate-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --environment --template --validate-mode " -- $cur) ) ;; - "edit-transfer-task") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "vod") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "list-transcode-template-groups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --task " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --filters " -- $cur) ) ;; - "delete-transfer-task") + "create-transcode-template-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --group-name --templates " -- $cur) ) ;; - "start-transfer-task") + "get-transcode-template-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --group-id " -- $cur) ) ;; - "stop-transfer-task") + "update-transcode-template-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --group-id --group-name --templates " -- $cur) ) ;; - "get-transfer-task-progress") + "delete-transcode-template-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --group-id " -- $cur) ) ;; - "get-transfer-task-failed-files") + "delete-grouped-transcode-templates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --group-id --template-ids " -- $cur) ) ;; - "get-rds-accounts-by-inst-id") + "list-quality-detection-templates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size " -- $cur) ) ;; - "create-rds-accounts") + "create-quality-detection-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id --account " -- $cur) ) + -W "-h --help --headers --input-json --name --template-type --detections " -- $cur) ) ;; - "get-rds-accounts-by-inst-id-and-account-name") + "get-quality-detection-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id --account-name " -- $cur) ) + -W "-h --help --headers --input-json --template-id " -- $cur) ) ;; - "delete-rds-account") + "update-quality-detection-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id --account-name " -- $cur) ) + -W "-h --help --headers --input-json --template-id --name --detections " -- $cur) ) ;; - "grant-rds-account") + "delete-quality-detection-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id --account-name --db-privilege-info " -- $cur) ) + -W "-h --help --headers --input-json --template-id " -- $cur) ) ;; - "revoke-rds-account") + "create-video-upload-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id --account-name --db-name " -- $cur) ) + -W "-h --help --headers --input-json --http-method --title --file-name --file-size --cover-url --description --category-id --tags --transcode-template-group-id --transcode-template-ids --watermark-ids --user-data " -- $cur) ) ;; - "grant-rds-accounts-by-task") + "refresh-video-upload-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id --account-name --info " -- $cur) ) + -W "-h --help --headers --input-json --video-id " -- $cur) ) ;; - "get-rds-databases-by-inst-id") + "create-image-upload-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id " -- $cur) ) + -W "-h --help --headers --input-json --http-method --file-name --file-size " -- $cur) ) ;; - "create-rds-database") + "create-live-to-vod-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id --database " -- $cur) ) + -W "-h --help --headers --input-json --title --file-name --file-size --cover-url --description --category-id --tags --transcode-template-group-id --transcode-template-ids --watermark-ids --publish-domain --app-name --stream-name --record-times --record-file-type --task-external-id --priority " -- $cur) ) ;; - "get-rds-database-by-inst-id-and-db-name") + "list-videos") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id --db-name " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --filters --sorts " -- $cur) ) ;; - "delete-rds-database") + "get-video") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id --db-name " -- $cur) ) + -W "-h --help --headers --input-json --video-id " -- $cur) ) ;; - "get-rds-instances") + "update-video") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --video-id --name --category-id --tags --cover-url --description " -- $cur) ) ;; - "create-rds-instance") + "delete-video") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance " -- $cur) ) + -W "-h --help --headers --input-json --video-id " -- $cur) ) ;; - "get-rds-by-inst-id") + "batch-delete-videos") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id " -- $cur) ) + -W "-h --help --headers --input-json --video-ids " -- $cur) ) ;; - "delete-rds-by-inst-id") + "batch-update-videos") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --inst-id " -- $cur) ) + -W "-h --help --headers --input-json --bulk-items " -- $cur) ) ;; - "get-channels") + "get-video-play-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --video-id " -- $cur) ) ;; - "create-channel") + "delete-video-streams") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --channel " -- $cur) ) + -W "-h --help --headers --input-json --video-id --task-ids " -- $cur) ) ;; - "delete-channel") + "video-audit") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --video-id --audit-result " -- $cur) ) ;; - "start-channel") + "get-video-source-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --video-id " -- $cur) ) ;; - "stop-channel") + "submit-quality-detection-job") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --media-id --template-ids " -- $cur) ) ;; - "get-datasources") + "batch-submit-quality-detection-jobs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --bulk-items " -- $cur) ) ;; - "create-datasource") + "create-vedit-job") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --datasource " -- $cur) ) + -W "-h --help --headers --input-json --project-name --description --timeline --media-metadata --user-data " -- $cur) ) ;; - "delete-datasource") + "submit-vedit-job") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --project-id --media-metadata --user-data " -- $cur) ) ;; - "get-rds-specification") + "list-vedit-projects") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --engine " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --filters " -- $cur) ) ;; - "get-regions") + "create-vedit-project") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --project-name --description --timeline " -- $cur) ) ;; - "get-regions-available-zones") + "get-vedit-project") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --region " -- $cur) ) + -W "-h --help --headers --input-json --project-id " -- $cur) ) ;; - "get-task-info-history-by-id") + "update-vedit-project") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --task " -- $cur) ) + -W "-h --help --headers --input-json --project-id --project-name --description --timeline " -- $cur) ) ;; - "get-task-info-by-id") + "delete-vedit-project") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --task --file-name " -- $cur) ) + -W "-h --help --headers --input-json --project-id " -- $cur) ) ;; - "get-vm-images") + "list-domains") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --image-source " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --sorts " -- $cur) ) ;; - "get-vm-instances-by-id") + "create-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --name " -- $cur) ) ;; - "delete-vm-instance-by-id") + "get-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --domain-id " -- $cur) ) ;; - "get-vm-instances") + "delete-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --domain-id " -- $cur) ) ;; - "create-vm-instance") + "enable-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vm " -- $cur) ) + -W "-h --help --headers --input-json --domain-id " -- $cur) ) ;; - "stop-vm-instance-by-id") + "disable-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --domain-id " -- $cur) ) ;; - "start-vm-instance-by-id") + "set-default-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --domain-id " -- $cur) ) ;; - "reboot-vm-instance-by-id") + "set-header") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --domain-id --header-name --header-value --header-type " -- $cur) ) ;; - "get-vm-instance-types") + "list-headers") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --az " -- $cur) ) + -W "-h --help --headers --input-json --domain-id " -- $cur) ) ;; - "get-vm-keypairs-by-name") + "delete-header") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --domain-id --header-name --header-type " -- $cur) ) ;; - "delete-vm-keypair-by-name") + "set-referer-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --name " -- $cur) ) + -W "-h --help --headers --input-json --domain-id --config --enabled " -- $cur) ) ;; - "get-vm-keypairs") + "get-referer-rule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --domain-id " -- $cur) ) ;; - "create-vm-keypair") + "set-urlrule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --keypair " -- $cur) ) + -W "-h --help --headers --input-json --domain-id --config --enabled " -- $cur) ) ;; - "get-vpc-eips") + "get-urlrule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --domain-id " -- $cur) ) ;; - "create-vpc-eip") + "set-iprule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --allocate " -- $cur) ) + -W "-h --help --headers --input-json --domain-id --config --enabled " -- $cur) ) ;; - "get-vpc-eip-by-id") + "get-iprule") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --domain-id " -- $cur) ) ;; - "delete-vpc-eip-by-id") + "set-http-ssl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --domain-id --source --title --ssl-cert --ssl-key --jump-type --enabled " -- $cur) ) ;; - "associate-vpc-eip-by-id") + "get-http-ssl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --associate " -- $cur) ) + -W "-h --help --headers --input-json --domain-id " -- $cur) ) ;; - "disassociate-vpc-eip-by-id") + "list-categories") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --unassociate " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --sorts " -- $cur) ) ;; - "get-lb-http-listener") + "create-category") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --slbid " -- $cur) ) + -W "-h --help --headers --input-json --name --parent-id --description " -- $cur) ) ;; - "create-vpc-lbhttp-listener") + "list-all-categories") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --http-listener " -- $cur) ) + -W "-h --help --headers --input-json --flat-mode --tree-mode " -- $cur) ) ;; - "get-vpc-network-interface-by-id") + "get-category-with-children") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --category-id " -- $cur) ) ;; - "delete-vpc-network-interface-by-id") + "get-category") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --category-id " -- $cur) ) ;; - "get-vpc-network-interfaces") + "update-category") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vm-id " -- $cur) ) + -W "-h --help --headers --input-json --category-id --name --parent-id --description " -- $cur) ) ;; - "create-vpc-network-interface") + "delete-category") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --net-interface " -- $cur) ) + -W "-h --help --headers --input-json --category-id " -- $cur) ) ;; - "attach-vpc-network-interface-by-id") + "submit-snapshot-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --attach " -- $cur) ) + -W "-h --help --headers --input-json --video-ids --template-ids " -- $cur) ) ;; - "detach-vpc-network-interface-by-id") + "list-snapshot-tasks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --detach " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --filters " -- $cur) ) ;; - "get-vpc-security-group-by-id") + "list-transcode-templates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --filters " -- $cur) ) ;; - "delete-vpc-security-group-by-id") + "create-transcode-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --name --video --audio --encapsulation --out-file --definition --template-type " -- $cur) ) ;; - "get-vpc-security-groups") + "get-transcode-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --template-id " -- $cur) ) ;; - "create-vpc-security-group") + "update-transcode-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --security-group " -- $cur) ) + -W "-h --help --headers --input-json --template-id --name --video --audio --encapsulation --out-file --definition --template-type " -- $cur) ) ;; - "create-security-groups-rule") + "delete-transcode-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --sg-rule " -- $cur) ) + -W "-h --help --headers --input-json --template-id " -- $cur) ) ;; - "delete-security-groups-rule") + "list-snapshot-templates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --rule-type --protocol --from-port --to-port --nic-type --policy --priority --cidr-ip " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --filters " -- $cur) ) ;; - "get-vpc-slb-by-id") + "create-snapshot-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --template-name --snapshot-type --image-sample-config --image-sprite-config " -- $cur) ) ;; - "delete-vpc-slb-by-id") + "get-snapshot-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --template-id " -- $cur) ) ;; - "get-vpc-slbs") + "update-snapshot-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --template-id --template-name --snapshot-type --image-sample-config --image-sprite-config " -- $cur) ) ;; - "create-vpc-slb") + "delete-snapshot-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --slb " -- $cur) ) + -W "-h --help --headers --input-json --template-id " -- $cur) ) ;; - "start-slb") + "submit-transcode-job") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --video-id --template-group-id --template-ids --watermark-ids " -- $cur) ) ;; - "stop-slb") + "batch-submit-transcode-jobs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --bulk-items " -- $cur) ) ;; - "delete-slbs-listener") + "get-transcode-summaries") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --listener-port " -- $cur) ) + -W "-h --help --headers --input-json --video-ids " -- $cur) ) ;; - "start-slb-listener") + "get-transcode-job-summaries") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --listener-port " -- $cur) ) + -W "-h --help --headers --input-json --job-ids " -- $cur) ) ;; - "stop-slb-listener") + "get-transcode-task-summaries") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id --listener-port " -- $cur) ) + -W "-h --help --headers --input-json --task-ids " -- $cur) ) ;; - "get-vpc-subnet-by-id") + "list-watermarks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size " -- $cur) ) ;; - "delete-vpc-subnet-by-id") + "create-watermark") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --name --img-url --width --height --size-unit --width-ref --height-ref --position --offset-x --offset-y --offset-unit " -- $cur) ) ;; - "get-vpc-subnets") + "get-watermark") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --watermark-id " -- $cur) ) ;; - "create-vpc-subnet") + "update-watermark") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --subnet " -- $cur) ) + -W "-h --help --headers --input-json --watermark-id --name --img-url --width --height --size-unit --width-ref --height-ref --position --offset-x --offset-y --offset-unit " -- $cur) ) ;; - "get-vpc-by-id") + "delete-watermark") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --watermark-id " -- $cur) ) ;; - "delete-vpc-by-id") + "submit-transcode-job") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --video-id --template-ids --watermark-ids " -- $cur) ) ;; - "get-vpcs") + "batch-submit-transcode-jobs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --bulk-items " -- $cur) ) ;; - "create-vpc") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "yundingdatapush") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-datapush-venders") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc " -- $cur) ) + -W "-h --help --headers --input-json --appkey --page-number --page-size --yd-rds-instance-id --rds-instance-name --vender-id --vender-name " -- $cur) ) ;; - "get-vpc-vserver-groups") + "add-datapush-vender") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --slbid " -- $cur) ) + -W "-h --help --headers --input-json --datapush-vender " -- $cur) ) ;; - "create-vpc-vserver-group") + "delete-datapush-vender") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vserver-group " -- $cur) ) + -W "-h --help --headers --input-json --appkey --yd-rds-instance-id --vender-id " -- $cur) ) ;; - "get-vserver-groups-by-id") + "describe-rds-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --appkey " -- $cur) ) ;; - "delete-vserver-group") + "create-order-sync") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --id " -- $cur) ) + -W "-h --help --headers --input-json --order-sync-spec " -- $cur) ) ;; "generate-skeleton") @@ -5913,205 +7359,231 @@ _jdc_complete() esac ;; - "live") + "ossopenapi") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-live-app") + "get-single-bucket-capacity") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bucket-name --capacity-types --begin-time --end-time --period-type --method " -- $cur) ) ;; - "add-live-app") + "get-back-source-configuration") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bucket-name " -- $cur) ) ;; - "stop-live-app") + "put-back-source-configuration") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bucket-name --back-source-rules " -- $cur) ) ;; - "describe-live-play-auth-key") + "delete-back-source-configuration") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --play-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bucket-name " -- $cur) ) ;; - "set-live-play-auth-key") + "get-historical-replicat-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --play-domain --auth-status --auth-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bucket-name --task-id " -- $cur) ) ;; - "describe-live-restart-auth-key") + "abort-historical-replicat-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --restart-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bucket-name --task-id " -- $cur) ) ;; - "set-live-restart-auth-key") + "list-historical-replicat-tasks") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --restart-domain --auth-status --auth-key " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bucket-name --marker --limit " -- $cur) ) ;; - "describe-live-bill-data") + "create-historical-replicat-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bucket-name --action --bucket-name --bucket-region --target-bucket-name --target-bucket-region --storage-class --prefix-set " -- $cur) ) ;; - "describe-live-domain-certificate") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --play-domain " -- $cur) ) + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; - "set-live-domain-certificate") + esac + ;; + + "baseanti") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-ip-resources") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --play-domain --cert-status --cert --key --title " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ip " -- $cur) ) ;; - "describe-live-restart-domain-certificate") + "describe-elastic-ip-resources") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --restart-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --ip " -- $cur) ) ;; - "set-live-restart-domain-certificate") + "describe-cps-ip-resources") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --restart-domain --cert-status --cert --key --title " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --ip " -- $cur) ) ;; - "describe-live-domains") + "describe-ccs-ip-resources") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-num --page-size --publish-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --ip " -- $cur) ) ;; - "add-live-domain") + "describe-waf-ip-resources") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --play-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --ip " -- $cur) ) ;; - "start-live-domain") + "describe-ip-resource-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ip " -- $cur) ) ;; - "stop-live-domain") + "describe-ip-safety-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ip " -- $cur) ) ;; - "describe-live-domain-detail") + "set-clean-threshold") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ip --clean-threshold-spec " -- $cur) ) ;; - "delete-live-domain") + "set-ip-clean-threshold") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ip-clean-threshold-spec " -- $cur) ) ;; - "add-live-restart-domain") + "describe-ip-clean-threshold-range") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --play-domain --restart-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ip " -- $cur) ) ;; - "add-custom-live-stream-quality-detection-template") + "describe-ip-resource-protect-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template --modules " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ip --start --limit " -- $cur) ) ;; - "describe-custom-live-stream-quality-detection-templates") + "describe-ip-resource-flow") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --ip --end-time " -- $cur) ) ;; - "add-live-stream-app-quality-detection") + "describe-attack-logs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --start-time --end-time --ip " -- $cur) ) ;; - "add-live-stream-domain-quality-detection") + "describe-attack-statistics") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --ip " -- $cur) ) ;; - "set-live-stream-quality-detection-notify-config") + "describe-attack-type-count") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --notify-url " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --ip " -- $cur) ) ;; - "delete-custom-live-stream-quality-detection-template") + "describe-ip-monitor-flow") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template " -- $cur) ) + -W "-h --help --headers --input-json --start-time --end-time --ip " -- $cur) ) ;; - "delete-live-stream-app-quality-detection") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "mongodb") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-security-ips") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "delete-live-stream-domain-quality-detection") + "modify-security-ips") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --modify-mode --security-ips " -- $cur) ) ;; - "describe-live-stream-quality-detection-notify-config") + "describe-backups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "delete-live-stream-quality-detection-notify-config") + "create-backup") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --backup-name --backup-method " -- $cur) ) ;; - "describe-quality-detection-binding") + "delete-backup") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template " -- $cur) ) + -W "-h --help --headers --input-json --region-id --backup-id " -- $cur) ) ;; - "open-live-p2p") + "backup-download-url") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --play-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --backup-id " -- $cur) ) ;; - "close-live-p2p") + "describe-instances") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --play-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tag-filters --sorts " -- $cur) ) ;; - "describe-live-p2p-configs") + "create-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --play-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-spec --charge-spec " -- $cur) ) ;; - "describe-custom-live-stream-record-templates") + "delete-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "add-custom-live-stream-record-template") + "reset-password") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --record-period --save-bucket --save-endpoint --record-file-type --template " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --account-password " -- $cur) ) ;; - "add-live-stream-app-record") + "modify-instance-spec") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --instance-class --instance-storage-gb " -- $cur) ) ;; - "add-live-stream-domain-record") + "modify-instance-name") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --instance-name " -- $cur) ) ;; - "describe-custom-live-stream-record-config") + "describe-backup-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "set-live-stream-record-notify-config") + "modify-backup-policy") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --notify-url " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --preferred-backup-time " -- $cur) ) ;; - "delete-custom-live-stream-record-template") + "restore-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --backup-id " -- $cur) ) ;; - "delete-live-stream-app-record") + "describe-flavors") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "delete-live-stream-domain-record") + "describe-available-zones") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-live-stream-record-notify-config") + "restart-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) ;; - "delete-live-stream-record-notify-config") + "create-sharding-instance") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --sharding-instance-spec --charge-spec " -- $cur) ) ;; - "add-live-record-task") + "modify-node-spec") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --stream-name --record-times --save-bucket --save-endpoint --record-file-type --save-object --task-external-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --node-id --node-type --node-storage-gb " -- $cur) ) ;; - "describe-record-binding") + "restart-node") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --node-id " -- $cur) ) ;; - "describe-live-statistic-group-by-stream") + "describe-backup-synchronicities") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --period --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "describe-live-statistic-group-by-area") + "create-backup-synchronicity") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --period --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-id --src-region --dst-region " -- $cur) ) ;; - "describe-live-statistic-group-by-area-isp") + "delete-backup-synchronicities") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --protocol-type --period --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --service-id " -- $cur) ) + ;; + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; + esac + ;; + + "live") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE "describe-publish-stream-info-data") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --domain-name --app-name --stream-name --start-time --end-time " -- $cur) ) @@ -6156,189 +7628,133 @@ _jdc_complete() COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --domain-name --size --rankfield --start-time --end-time " -- $cur) ) ;; - "describe-live-transcoding-duration-data") + "describe-live-stream-publish-info-by-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --grade --period --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --domain-name --app-name --stream-name --start-time --end-time --page-number --page-size " -- $cur) ) ;; - "describe-live-file-storage-data") + "describe-live-stream-play-info-by-page") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --period --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --domain-name --app-name --stream-name --start-time --end-time --page-number --page-size " -- $cur) ) ;; - "describe-live-stream-bandwidth-data") + "describe-live-domain-certificate") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --protocol-type --period --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --play-domain " -- $cur) ) ;; - "describe-live-stream-publish-bandwidth-data") + "set-live-domain-certificate") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --protocol-type --period --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --play-domain --cert-status --cert --key --title " -- $cur) ) ;; - "describe-live-stream-traffic-data") + "describe-live-restart-domain-certificate") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --protocol-type --period --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --restart-domain " -- $cur) ) ;; - "describe-live-stream-publish-traffic-data") + "set-live-restart-domain-certificate") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --protocol-type --period --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --restart-domain --cert-status --cert --key --title " -- $cur) ) ;; - "describe-live-snapshot-data") + "add-live-stream-domain-transcode") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --stream-name --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) ;; - "describe-live-porn-data") + "add-live-stream-app-transcode") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --stream-name --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) ;; - "add-custom-live-stream-snapshot-template") + "add-custom-live-stream-transcode-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --format --width --height --fill-type --snapshot-interval --save-mode --save-bucket --save-endpoint --template " -- $cur) ) + -W "-h --help --headers --input-json --template-name --video-codec --video-code-rate --video-frame-rate --width --height --template --audio-codec --audio-format --audio-sample-rate --audio-channel --audio-code-rate --jdchd --audio-comfort " -- $cur) ) ;; - "describe-custom-live-stream-snapshot-config") + "describe-custom-live-stream-transcode-templates") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) ;; - "describe-custom-live-stream-snapshot-templates") + "describe-system-live-stream-transcode-templates") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) ;; - "add-live-stream-app-snapshot") + "describe-live-stream-transcode-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) + -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) ;; - "add-live-stream-domain-snapshot") + "delete-live-stream-domain-transcode") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) ;; - "set-live-stream-snapshot-notify-config") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --notify-url " -- $cur) ) - ;; - "delete-custom-live-stream-snapshot-template") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template " -- $cur) ) - ;; - "delete-live-stream-app-snapshot") + "delete-live-stream-app-transcode") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) ;; - "delete-live-stream-domain-snapshot") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) - ;; - "describe-live-stream-snapshot-notify-config") + "describe-custom-live-stream-transcode-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain " -- $cur) ) + -W "-h --help --headers --input-json --template " -- $cur) ) ;; - "delete-live-stream-snapshot-notify-config") + "delete-custom-live-stream-transcode-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain " -- $cur) ) + -W "-h --help --headers --input-json --template " -- $cur) ) ;; - "describe-snapshot-binding") + "describe-transcode-binding") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --template " -- $cur) ) ;; - "forbid-live-stream") + "add-custom-live-stream-quality-detection-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --stream-name --forbid-time " -- $cur) ) + -W "-h --help --headers --input-json --template --modules " -- $cur) ) ;; - "resume-live-stream") + "describe-custom-live-stream-quality-detection-templates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --stream-name " -- $cur) ) + -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) ;; - "interrupt-live-stream") + "add-live-stream-app-quality-detection") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --stream-name " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) ;; - "describe-live-stream-info") + "add-live-stream-domain-quality-detection") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --stream-name " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) ;; - "set-live-stream-notify-config") + "set-live-stream-quality-detection-notify-config") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --publish-domain --notify-url " -- $cur) ) ;; - "describe-live-stream-notify-config") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain " -- $cur) ) - ;; - "delete-live-stream-notify-config") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain " -- $cur) ) - ;; - "describe-live-stream-online-list") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --page-num --page-size --app-name " -- $cur) ) - ;; - "describe-live-stream-publish-list") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --page-num --page-size --app-name --stream-name --start-time --end-time " -- $cur) ) - ;; - "open-live-restart") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --restart-domain " -- $cur) ) - ;; - "close-live-restart") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --restart-domain " -- $cur) ) - ;; - "describe-live-restart-configs") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-num --page-size --restart-domain " -- $cur) ) - ;; - "open-live-timeshift") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --play-domain " -- $cur) ) - ;; - "close-live-timeshift") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --play-domain " -- $cur) ) - ;; - "describe-live-timeshift-configs") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --play-domain " -- $cur) ) - ;; - "add-live-stream-domain-transcode") + "delete-custom-live-stream-quality-detection-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) + -W "-h --help --headers --input-json --template " -- $cur) ) ;; - "add-live-stream-app-transcode") + "delete-live-stream-app-quality-detection") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) ;; - "add-custom-live-stream-transcode-template") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template-name --video-codec --video-code-rate --video-frame-rate --width --height --template --audio-codec --audio-format --audio-sample-rate --audio-channel --audio-code-rate --jdchd --audio-comfort " -- $cur) ) - ;; - "describe-custom-live-stream-transcode-templates") + "delete-live-stream-domain-quality-detection") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) ;; - "describe-system-live-stream-transcode-templates") + "describe-live-stream-quality-detection-notify-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain " -- $cur) ) ;; - "describe-live-stream-transcode-config") + "delete-live-stream-quality-detection-notify-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain " -- $cur) ) ;; - "delete-live-stream-domain-transcode") + "describe-quality-detection-binding") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) + -W "-h --help --headers --input-json --template " -- $cur) ) ;; - "delete-live-stream-app-transcode") + "describe-live-play-auth-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) + -W "-h --help --headers --input-json --play-domain " -- $cur) ) ;; - "describe-custom-live-stream-transcode-template") + "set-live-play-auth-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template " -- $cur) ) + -W "-h --help --headers --input-json --play-domain --auth-status --auth-key " -- $cur) ) ;; - "delete-custom-live-stream-transcode-template") + "describe-live-restart-auth-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template " -- $cur) ) + -W "-h --help --headers --input-json --restart-domain " -- $cur) ) ;; - "describe-transcode-binding") + "set-live-restart-auth-key") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --template " -- $cur) ) + -W "-h --help --headers --input-json --restart-domain --auth-status --auth-key " -- $cur) ) ;; "add-custom-live-stream-watermark-template") COMPREPLY=( $(compgen \ @@ -6376,375 +7792,375 @@ _jdc_complete() COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --template " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "create-live-forward-task") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --source-url --push-url --start-mode --start-time --end-time --callback-events --callback-url --name " -- $cur) ) ;; - esac - ;; - - "detection") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-agent-status") + "update-live-forward-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --filters " -- $cur) ) + -W "-h --help --headers --input-json --task-id --source-url --push-url --start-time --end-time --callback-events --callback-url --name " -- $cur) ) ;; - "describe-metric-data-am") + "query-live-forward-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --resource-id --start-time --end-time --time-interval " -- $cur) ) + -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) ;; - "create-probe-task") + "start-live-forward-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --client-token --create-probe-task-spec " -- $cur) ) + -W "-h --help --headers --input-json --task-ids " -- $cur) ) ;; - "delete-probe-task") + "stop-live-forward-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --probe-task-ids " -- $cur) ) + -W "-h --help --headers --input-json --task-ids " -- $cur) ) + ;; + "delete-live-forward-task") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --task-ids " -- $cur) ) + ;; + "delete-live-recordings") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --file-url --completely " -- $cur) ) + ;; + "add-live-stream-domain-translate") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) + ;; + "add-live-stream-app-translate") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) + ;; + "add-live-stream-translate") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --publish-domain --app-name --stream-name --template " -- $cur) ) ;; - "describe-probe-task") + "describe-system-live-stream-translate-templates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --probe-task-id " -- $cur) ) + -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) ;; - "update-probe-task") + "describe-live-stream-translate-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --probe-task-id --http-body --http-cookie --http-header --http-type --name --probes " -- $cur) ) + -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) ;; - "describe-probe-history") + "describe-live-domain-translate-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --probe-task-id --probe-id --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --filters " -- $cur) ) ;; - "discribe-probes") + "delete-live-stream-domain-translate") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --probe-task-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) ;; - "probe-task-enable") + "delete-live-stream-app-translate") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --enabled --task-id " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) ;; - "describe-probe-tasks") + "delete-live-stream-translate") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --name --type --time-interval --with-stats --with-deleted --enabled --filters " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --stream-name --template " -- $cur) ) ;; - "get-site-monitor") + "describe-translate-binding") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --name-or-addr --name --id --task-type --page-number --page-size --with-stats --with-deleted --time-interval --filters " -- $cur) ) + -W "-h --help --headers --input-json --template " -- $cur) ) ;; - "create-site-monitor") + "pause-live-stream-translate") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --address --advance-checked --created-time --cycle --default-source --dns-option --enabled --ftp-option --hawkeye-id --http-option --id --is-deleted --name --pin --ping-option --pop3option --port --smtp-option --source --stats --task-type --tcp-option --udp-option --updated-time " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --stream-name " -- $cur) ) ;; - "update-site-monitor") + "resume-live-stream-translate") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --address --advance-checked --created-time --cycle --default-source --dns-option --enabled --ftp-option --hawkeye-id --http-option --id --is-deleted --name --pin --ping-option --pop3option --port --smtp-option --source --stats --task-type --tcp-option --udp-option --updated-time " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --stream-name " -- $cur) ) ;; - "delete-site-monitor") + "forbid-live-stream") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --filters " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --stream-name --forbid-time " -- $cur) ) ;; - "enable-site-monitor") + "resume-live-stream") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --list " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --stream-name " -- $cur) ) ;; - "validate-site-monitor-address") + "interrupt-live-stream") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --address " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --stream-name " -- $cur) ) ;; - "get-site-monitor-data-points") + "describe-live-stream-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --id --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --stream-name " -- $cur) ) ;; - "get-site-monitor-source") + "set-live-stream-notify-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --notify-url " -- $cur) ) ;; - "test-site-monitor") + "describe-live-stream-notify-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --address --advance-checked --created-time --cycle --default-source --dns-option --enabled --ftp-option --hawkeye-id --http-option --id --is-deleted --name --pin --ping-option --pop3option --port --smtp-option --source --stats --task-type --tcp-option --udp-option --updated-time " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "delete-live-stream-notify-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --publish-domain " -- $cur) ) ;; - esac - ;; - - "iotlink") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "gprs-status") + "describe-live-stream-online-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --iccid " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --page-num --page-size --app-name " -- $cur) ) ;; - "on-off-status") + "describe-live-stream-publish-list") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --iccid " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --page-num --page-size --app-name --stream-name --start-time --end-time " -- $cur) ) ;; - "life-status") + "describe-live-bill-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --iccid " -- $cur) ) + -W "-h --help --headers --input-json --filters " -- $cur) ) ;; - "gprs-realtime-info") + "open-live-restart") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --iccid " -- $cur) ) + -W "-h --help --headers --input-json --restart-domain " -- $cur) ) ;; - "open-iot-card") + "close-live-restart") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --iccids " -- $cur) ) + -W "-h --help --headers --input-json --restart-domain " -- $cur) ) ;; - "close-iot-card") + "describe-live-restart-configs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --iccids " -- $cur) ) + -W "-h --help --headers --input-json --page-num --page-size --restart-domain " -- $cur) ) ;; - "open-iot-flow") + "open-live-p2p") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --iccids " -- $cur) ) + -W "-h --help --headers --input-json --play-domain " -- $cur) ) ;; - "close-iot-flow") + "close-live-p2p") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --iccids " -- $cur) ) + -W "-h --help --headers --input-json --play-domain " -- $cur) ) ;; - "search") + "describe-live-p2p-configs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --request-type --request-param " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --play-domain " -- $cur) ) ;; - "operate") + "add-custom-live-stream-snapshot-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --request-type --request-param " -- $cur) ) + -W "-h --help --headers --input-json --format --width --height --fill-type --snapshot-interval --save-mode --save-bucket --save-endpoint --template " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-custom-live-stream-snapshot-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) ;; - esac - ;; - - "renewal") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "set-renewal") + "describe-custom-live-stream-snapshot-templates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --set-renewal-param " -- $cur) ) + -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) ;; - "query-instance") + "add-live-stream-app-snapshot") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --query-instance-param " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) ;; - "renew-instance") + "add-live-stream-domain-snapshot") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --renew-instance-param " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "set-live-stream-snapshot-notify-config") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --publish-domain --notify-url " -- $cur) ) ;; - esac - ;; - - "yunding") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "assign-secondary-ips") + "delete-custom-live-stream-snapshot-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-interface-id --force --secondary-ips --secondary-ip-count " -- $cur) ) + -W "-h --help --headers --input-json --template " -- $cur) ) ;; - "unassign-secondary-ips") + "delete-live-stream-app-snapshot") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-interface-id --secondary-ips " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) ;; - "describe-rds-instances") + "delete-live-stream-domain-snapshot") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --type " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) ;; - "describe-rds-instance") + "describe-live-stream-snapshot-notify-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain " -- $cur) ) ;; - "describe-instance-info") + "delete-live-stream-snapshot-notify-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain " -- $cur) ) ;; - "describe-rds-white-list") + "describe-snapshot-binding") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id " -- $cur) ) + -W "-h --help --headers --input-json --template " -- $cur) ) ;; - "modify-rds-white-list") + "describe-live-domains") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --ips " -- $cur) ) + -W "-h --help --headers --input-json --page-num --page-size --publish-domain " -- $cur) ) ;; - "describe-rds-accounts") + "add-live-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --play-domain " -- $cur) ) ;; - "create-rds-account") + "start-live-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --account-name --account-password " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain " -- $cur) ) ;; - "delete-rds-account") + "stop-live-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --account-name " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain " -- $cur) ) ;; - "grant-rds-privilege") + "describe-live-domain-detail") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --account-name --account-privileges " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain " -- $cur) ) ;; - "describe-rds-databases") + "delete-live-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --db-name --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain " -- $cur) ) ;; - "create-rds-database") + "add-live-restart-domain") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --db-name --character-set-name " -- $cur) ) + -W "-h --help --headers --input-json --play-domain --restart-domain " -- $cur) ) ;; - "delete-rds-database") + "describe-custom-live-stream-record-templates") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-id --db-name " -- $cur) ) + -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) ;; - "describe-yd-rds-instances") + "add-custom-live-stream-record-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --app-key " -- $cur) ) + -W "-h --help --headers --input-json --record-period --save-bucket --save-endpoint --record-file-type --template " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "add-live-stream-app-record") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) ;; - esac - ;; - - "vpc") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-elastic-ips") + "add-live-stream-domain-record") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tags " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) ;; - "create-elastic-ips") + "describe-custom-live-stream-record-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --max-count --elastic-ip-address --elastic-ip-spec --user-tags --ip-type " -- $cur) ) + -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) ;; - "describe-elastic-ip") + "set-live-stream-record-notify-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --notify-url " -- $cur) ) ;; - "modify-elastic-ip") + "delete-custom-live-stream-record-template") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --elastic-ip-id --bandwidth-mbps " -- $cur) ) + -W "-h --help --headers --input-json --template " -- $cur) ) ;; - "delete-elastic-ip") + "delete-live-stream-app-record") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --template " -- $cur) ) ;; - "describe-network-acls") + "delete-live-stream-domain-record") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --template " -- $cur) ) ;; - "create-network-acl") + "describe-live-stream-record-notify-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-id --network-acl-name --description " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain " -- $cur) ) ;; - "describe-network-acl") + "delete-live-stream-record-notify-config") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-acl-id " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain " -- $cur) ) ;; - "modify-network-acl") + "add-live-record-task") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-acl-id --network-acl-name --description " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --stream-name --record-times --save-bucket --save-endpoint --record-file-type --save-object --task-external-id " -- $cur) ) ;; - "delete-network-acl") + "describe-record-binding") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-acl-id " -- $cur) ) + -W "-h --help --headers --input-json --template " -- $cur) ) ;; - "associate-network-acl") + "describe-live-app") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-acl-id --subnet-ids " -- $cur) ) + -W "-h --help --headers --input-json --page-num --page-size --filters " -- $cur) ) ;; - "disassociate-network-acl") + "add-live-app") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-acl-id --subnet-id " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name " -- $cur) ) ;; - "add-network-acl-rules") + "stop-live-app") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-acl-id --network-acl-rule-specs " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name " -- $cur) ) ;; - "remove-network-acl-rules") + "describe-live-transcoding-duration-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-acl-id --rule-ids " -- $cur) ) + -W "-h --help --headers --input-json --domain-name --grade --period --start-time --end-time " -- $cur) ) ;; - "modify-network-acl-rules") + "describe-live-file-storage-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-acl-id --modify-network-acl-rule-specs " -- $cur) ) + -W "-h --help --headers --input-json --period --start-time --end-time " -- $cur) ) ;; - "describe-network-interfaces") + "describe-live-stream-bandwidth-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --protocol-type --period --start-time --end-time " -- $cur) ) ;; - "create-network-interface") + "describe-live-stream-publish-bandwidth-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --subnet-id --az --network-interface-name --primary-ip-address --secondary-ip-addresses --secondary-ip-count --security-groups --sanity-check --description " -- $cur) ) + -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --protocol-type --period --start-time --end-time " -- $cur) ) ;; - "describe-network-interface") + "describe-live-stream-traffic-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-interface-id " -- $cur) ) + -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --protocol-type --period --start-time --end-time " -- $cur) ) ;; - "modify-network-interface") + "describe-live-stream-publish-traffic-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-interface-id --network-interface-name --description --security-groups " -- $cur) ) + -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --protocol-type --period --start-time --end-time " -- $cur) ) ;; - "delete-network-interface") + "describe-live-snapshot-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-interface-id " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --stream-name --shot-mode --start-time --end-time " -- $cur) ) ;; - "associate-elastic-ip") + "describe-live-porn-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-interface-id --elastic-ip-id --private-ip-address --elastic-ip-address " -- $cur) ) + -W "-h --help --headers --input-json --publish-domain --app-name --stream-name --start-time --end-time " -- $cur) ) ;; - "disassociate-elastic-ip") + "describe-live-statistic-group-by-stream") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-interface-id --elastic-ip-id --elastic-ip-address " -- $cur) ) + -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --period --start-time --end-time " -- $cur) ) ;; - "assign-secondary-ips") + "describe-live-statistic-group-by-area") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-interface-id --force --secondary-ips --secondary-ip-count " -- $cur) ) + -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --period --start-time --end-time " -- $cur) ) ;; - "unassign-secondary-ips") + "describe-live-statistic-group-by-area-isp") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-interface-id --secondary-ips " -- $cur) ) + -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --protocol-type --period --start-time --end-time " -- $cur) ) ;; - "describe-network-security-groups") + "describe-live-publish-statistic-group-by-stream") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --domain-name --app-name --stream-name --isp-name --location-name --period --start-time --end-time " -- $cur) ) ;; - "create-network-security-group") + "open-live-timeshift") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-id --network-security-group-name --description " -- $cur) ) + -W "-h --help --headers --input-json --play-domain " -- $cur) ) ;; - "describe-network-security-group") + "close-live-timeshift") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-security-group-id " -- $cur) ) + -W "-h --help --headers --input-json --play-domain " -- $cur) ) ;; - "modify-network-security-group") + "describe-live-timeshift-configs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-security-group-id --network-security-group-name --description " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --play-domain " -- $cur) ) ;; - "delete-network-security-group") + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + ;; + esac + ;; + + "vpc") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "describe-vpc-peerings") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-security-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "add-network-security-group-rules") + "create-vpc-peering") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-security-group-id --network-security-group-rule-specs " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-peering-name --vpc-id --remote-vpc-id --description " -- $cur) ) ;; - "remove-network-security-group-rules") + "describe-vpc-peering") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-security-group-id --rule-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-peering-id " -- $cur) ) ;; - "modify-network-security-group-rules") + "modify-vpc-peering") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --network-security-group-id --modify-security-group-rule-specs " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-peering-id --vpc-peering-name --description " -- $cur) ) ;; - "describe-quota") + "delete-vpc-peering") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --type --parent-resource-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-peering-id " -- $cur) ) ;; "describe-route-tables") COMPREPLY=( $(compgen \ @@ -6786,17 +8202,13 @@ _jdc_complete() COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --region-id --route-table-id --subnet-id " -- $cur) ) ;; - "describe-edge-ip-providers") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) - ;; "describe-subnets") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; "create-subnet") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-id --subnet-name --address-prefix --route-table-id --description --subnet-type --az " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-id --subnet-name --address-prefix --route-table-id --description --ip-mask-len " -- $cur) ) ;; "describe-subnet") COMPREPLY=( $(compgen \ @@ -6804,303 +8216,199 @@ _jdc_complete() ;; "modify-subnet") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --subnet-id --subnet-name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --subnet-id --subnet-name --description --ip-mask-len " -- $cur) ) ;; "delete-subnet") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --region-id --subnet-id " -- $cur) ) ;; - "describe-vpcs") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) - ;; - "create-vpc") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-name --address-prefix --description " -- $cur) ) - ;; - "describe-vpc") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-id " -- $cur) ) - ;; - "modify-vpc") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-id --vpc-name --description " -- $cur) ) - ;; - "delete-vpc") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-id " -- $cur) ) - ;; - "describe-vpc-peerings") + "describe-network-acls") COMPREPLY=( $(compgen \ -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "create-vpc-peering") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-peering-name --vpc-id --remote-vpc-id --description " -- $cur) ) - ;; - "describe-vpc-peering") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-peering-id " -- $cur) ) - ;; - "modify-vpc-peering") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-peering-id --vpc-peering-name --description " -- $cur) ) - ;; - "delete-vpc-peering") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --vpc-peering-id " -- $cur) ) - ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) - ;; - esac - ;; - - "monitor") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-alarms") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --service-code --product --dimension --rule-name --rule-type --enabled --rule-status --filters " -- $cur) ) - ;; - "create-alarm") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --auto-scaling-policy-id --base-contact --client-token --dimension --enabled --notice-option --product --resource-option --rule-name --rule-option --rule-type --tags --web-hook-option " -- $cur) ) - ;; - "describe-alarm") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --alarm-id " -- $cur) ) - ;; - "update-alarm") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --alarm-id --auto-scaling-policy-id --base-contact --dimension --enabled --notice-option --product --resource-option --rule-name --rule-option --rule-type --tags --web-hook-option " -- $cur) ) - ;; - "delete-alarms") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --alarm-id " -- $cur) ) - ;; - "describe-alarm-contacts") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --alarm-id --page-number --page-size --reference-type " -- $cur) ) - ;; - "describe-metrics-for-alarm") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --service-code --product --dimension --metric-type " -- $cur) ) - ;; - "describe-products-for-alarm") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --service-code --product " -- $cur) ) - ;; - "enable-alarms") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --alarm-ids --state " -- $cur) ) - ;; - "describe-alarm-history") + "create-network-acl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --page-number --page-size --service-code --product --dimension --region --is-alarming --status --start-time --end-time --rule-type --rule-name --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-id --network-acl-name --description " -- $cur) ) ;; - "describe-metrics") + "describe-network-acl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --service-code --dimension --type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-acl-id " -- $cur) ) ;; - "describe-one-data-point") + "modify-network-acl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --metric --service-code --dimension --resource-id --tags --start-time --end-time --time-interval --aggr-type --down-aggr-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-acl-id --network-acl-name --description " -- $cur) ) ;; - "describe-metric-data") + "delete-network-acl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --metric --aggr-type --down-sample-type --start-time --end-time --time-interval --tags --group-by --rate --service-code --dimension --resource-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-acl-id " -- $cur) ) ;; - "describe-services") + "associate-network-acl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --filters --product-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-acl-id --subnet-ids " -- $cur) ) ;; - "put-custom-metric-data") + "disassociate-network-acl") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --metric-data-list " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-acl-id --subnet-id " -- $cur) ) ;; - "put-custom-metric-data") + "add-network-acl-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --metric-data-list " -- $cur) ) - ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-acl-id --network-acl-rule-specs " -- $cur) ) ;; - esac - ;; - - "xdata") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "list-database-info") + "remove-network-acl-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-acl-id --rule-ids " -- $cur) ) ;; - "get-database-info") + "modify-network-acl-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --database-name --instance-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-acl-id --modify-network-acl-rule-specs " -- $cur) ) ;; - "create-database") + "describe-vpcs") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --database-name --instance-name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "delete-database") + "create-vpc") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --database-name --instance-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-name --address-prefix --description --az-type --az " -- $cur) ) ;; - "list-instance-info") + "describe-vpc") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-id " -- $cur) ) ;; - "execute-ras-query") + "modify-vpc") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --database-name --sql --user-name --queue-name --source --call-back-url --instance-name --instance-owner-name --is-explain " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-id --vpc-name --description " -- $cur) ) ;; - "execute-py-spark-query") + "delete-vpc") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --script --user-name --instance-name --instance-owner-name --script-type " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-id " -- $cur) ) ;; - "get-ras-query-state") + "describe-network-interfaces") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "get-py-spark-execute-state") + "create-network-interface") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --subnet-id --az --network-interface-name --primary-ip-address --secondary-ip-addresses --secondary-ip-count --security-groups --sanity-check --description " -- $cur) ) ;; - "get-ras-query-log") + "describe-network-interface") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-interface-id " -- $cur) ) ;; - "get-ras-query-result") + "modify-network-interface") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-interface-id --network-interface-name --description --security-groups " -- $cur) ) ;; - "get-py-spark-execute-result") + "delete-network-interface") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-interface-id " -- $cur) ) ;; - "cancel-ras-query") + "associate-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-interface-id --elastic-ip-id --private-ip-address --elastic-ip-address " -- $cur) ) ;; - "cancel-py-spark-job") + "disassociate-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-interface-id --elastic-ip-id --elastic-ip-address " -- $cur) ) ;; - "list-table-info") + "assign-secondary-ips") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-name --database-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-interface-id --force --secondary-ips --secondary-ip-count --secondary-ip-mask-len --secondary-ip-address " -- $cur) ) ;; - "create-table") + "unassign-secondary-ips") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --instance-name --db-model-dbtable " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-interface-id --secondary-ips --secondary-cidrs " -- $cur) ) ;; - "get-table-info") + "describe-bandwidth-packages") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --table-name --instance-name --database-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tags --resource-group-ids " -- $cur) ) ;; - "delete-table") + "create-bandwidth-package") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --table-name --instance-name --database-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --name --description --bandwidth-mbps --provider --charge-spec --user-tags --resource-group-id " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "describe-bandwidth-package") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --bandwidth-package-id " -- $cur) ) ;; - esac - ;; - - "containerregistry") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "get-authorization-token") + "modify-bandwidth-package") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --registry-name --expired-after-hours " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bandwidth-package-id --bandwidth-mbps --name --description " -- $cur) ) ;; - "describe-authorization-tokens") + "delete-bandwidth-package") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --registry-name --filters --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bandwidth-package-id " -- $cur) ) ;; - "release-authorization-token") + "add-bandwidth-package-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --registry-name --authorization-token --force-all " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bandwidth-package-id --bandwidth-package-ipspecs " -- $cur) ) ;; - "describe-images") + "remove-bandwidth-package-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --filters --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bandwidth-package-id --bandwidth-package-ipspecs " -- $cur) ) ;; - "delete-image") + "modify-bandwidth-package-ip-bandwidth") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --registry-name --repository-name --image-digest --image-tag --image-tag-status " -- $cur) ) + -W "-h --help --headers --input-json --region-id --bandwidth-package-id --bandwidth-package-ipspecs " -- $cur) ) ;; - "describe-quotas") + "describe-network-security-groups") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; - "describe-registries") + "create-network-security-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --vpc-id --network-security-group-name --description " -- $cur) ) ;; - "create-registry") + "describe-network-security-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --registry-name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-security-group-id " -- $cur) ) ;; - "describe-registry") + "modify-network-security-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --registry-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-security-group-id --network-security-group-name --description " -- $cur) ) ;; - "delete-registry") + "delete-network-security-group") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --registry-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-security-group-id " -- $cur) ) ;; - "check-registry-name") + "add-network-security-group-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --registry-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-security-group-id --network-security-group-rule-specs " -- $cur) ) ;; - "create-repository") + "remove-network-security-group-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --registry-name --repository-name --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-security-group-id --rule-ids " -- $cur) ) ;; - "describe-repositories") + "modify-network-security-group-rules") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --filters --registry-name --page-number --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --network-security-group-id --modify-security-group-rule-specs " -- $cur) ) ;; - "delete-repository") + "describe-quota") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --registry-name --repository-name --force " -- $cur) ) + -W "-h --help --headers --input-json --region-id --type --parent-resource-id " -- $cur) ) ;; - "check-repository-name") + "describe-elastic-ips") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --registry-name --repository-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters --tags --resource-group-ids " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "create-elastic-ips") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --max-count --elastic-ip-address --elastic-ip-spec --user-tags --ip-type --resource-group-id --dry-run " -- $cur) ) ;; - esac - ;; - - "partner") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "query-my-customer-list") + "describe-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --customer-pin --alias-name --login-name --start-rel-time --end-rel-time --page-index --page-size " -- $cur) ) + -W "-h --help --headers --input-json --region-id --elastic-ip-id " -- $cur) ) ;; - "get-total-consumption") + "modify-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --start-time --end-time " -- $cur) ) + -W "-h --help --headers --input-json --region-id --elastic-ip-id --bandwidth-mbps " -- $cur) ) ;; - "get-each-consumption") + "delete-elastic-ip") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --start-time --end-time --pin --page-size --page-index " -- $cur) ) + -W "-h --help --headers --input-json --region-id --elastic-ip-id " -- $cur) ) ;; - "describe-customer-bill-by-product") + "describe-edge-ip-providers") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --pin --start-time --end-time --page-size --page-index " -- $cur) ) + -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) ;; "generate-skeleton") @@ -7109,170 +8417,170 @@ _jdc_complete() esac ;; - "lb") + "monitor") case "$prev" in # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "describe-backends") + "describe-alarms") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --data-owner --service-code --product --dimension --rule-name --rule-type --enabled --rule-status --filters " -- $cur) ) ;; - "create-backend") + "create-alarm") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --backend-name --load-balancer-id --protocol --port --health-check-spec --algorithm --target-group-ids --ag-ids --proxy-protocol --description --session-stickiness --session-sticky-timeout --connection-draining-seconds --http-cookie-expire-seconds --http-forwarded-protocol --http-forwarded-port --http-forwarded-host --http-forwarded-vip " -- $cur) ) + -W "-h --help --headers --input-json --auto-scaling-policy-id --base-contact --client-token --data-owner --dimension --enabled --multi-web-hook --notice-option --product --resource-option --rule-name --rule-option --rule-type --tags --web-hook-option " -- $cur) ) ;; - "describe-backend") + "describe-alarm") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --backend-id " -- $cur) ) + -W "-h --help --headers --input-json --alarm-id " -- $cur) ) ;; - "update-backend") + "update-alarm") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --backend-id --backend-name --health-check-spec --algorithm --target-group-ids --ag-ids --proxy-protocol --description --session-stickiness --session-sticky-timeout --connection-draining-seconds --http-cookie-expire-seconds --http-forwarded-protocol --http-forwarded-port --http-forwarded-host --http-forwarded-vip --close-health-check " -- $cur) ) + -W "-h --help --headers --input-json --alarm-id --auto-scaling-policy-id --base-contact --data-owner --dimension --enabled --multi-web-hook --notice-option --product --resource-option --rule-name --rule-option --rule-type --tags --web-hook-option " -- $cur) ) ;; - "delete-backend") + "delete-alarms") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --backend-id " -- $cur) ) + -W "-h --help --headers --input-json --alarm-id " -- $cur) ) ;; - "describe-target-health") + "describe-alarm-contacts") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --backend-id " -- $cur) ) + -W "-h --help --headers --input-json --alarm-id --page-number --page-size --reference-type " -- $cur) ) ;; - "describe-listeners") + "describe-metrics-for-alarm") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --service-code --product --dimension --metric-type " -- $cur) ) ;; - "create-listener") + "describe-products-for-alarm") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --listener-name --protocol --port --backend-id --load-balancer-id --url-map-id --action --certificate-specs --connection-idle-time-seconds --description " -- $cur) ) + -W "-h --help --headers --input-json --service-code --product " -- $cur) ) ;; - "describe-listener") + "enable-alarms") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --listener-id " -- $cur) ) + -W "-h --help --headers --input-json --alarm-ids --state " -- $cur) ) ;; - "update-listener") + "describe-alarm-history") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --listener-id --listener-name --status --certificate-specs --connection-idle-time-seconds --backend-id --url-map-id --description " -- $cur) ) + -W "-h --help --headers --input-json --page-number --page-size --data-owner --service-code --product --dimension --region --is-alarming --status --start-time --end-time --rule-type --rule-name --filters " -- $cur) ) ;; - "delete-listener") + "describe-metrics") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --listener-id " -- $cur) ) + -W "-h --help --headers --input-json --service-code --dimension --type " -- $cur) ) ;; - "describe-load-balancers") + "last-downsample") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --metric --service-code --dimension --resource-id --tags --start-time --end-time --time-interval --aggr-type --down-aggr-type --time-offset " -- $cur) ) ;; - "create-load-balancer") + "describe-metric-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-name --subnet-id --type --azs --charge-spec --elastic-ip --security-group-ids --description --delete-protection " -- $cur) ) + -W "-h --help --headers --input-json --region-id --metric --aggr-type --down-sample-type --start-time --end-time --time-interval --tags --group-by --rate --service-code --dimension --resource-id " -- $cur) ) ;; - "describe-load-balancer") + "describe-tag-values") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --tag-key --service-code --resource-id --metric --start-time --end-time --time-interval --tags " -- $cur) ) ;; - "update-load-balancer") + "describe-services") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id --load-balancer-name --action --description --delete-protection " -- $cur) ) + -W "-h --help --headers --input-json --filters --product-type " -- $cur) ) ;; - "delete-load-balancer") + "put-product-metric-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id " -- $cur) ) + -W "-h --help --headers --input-json --app-code --service-code --region --resource-id --data-points " -- $cur) ) ;; - "associate-elastic-ip") + "put-product-metric-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --app-code --service-code --region --resource-id --data-points " -- $cur) ) ;; - "disassociate-elastic-ip") + "put-custom-metric-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id --elastic-ip-id " -- $cur) ) + -W "-h --help --headers --input-json --metric-data-list " -- $cur) ) ;; - "associate-security-group") + "put-custom-metric-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id --security-group-ids " -- $cur) ) + -W "-h --help --headers --input-json --metric-data-list " -- $cur) ) ;; - "disassociate-security-group") + "describe-custom-metric-data") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --load-balancer-id --security-group-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --namespace-uid --end-time --query --start-time --time-interval " -- $cur) ) ;; - "describe-target-groups") - COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + + "generate-skeleton") + COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) ;; - "create-target-group") + esac + ;; + + "xdata") + case "$prev" in + # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE + "list-instance-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --target-group-name --load-balancer-id --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id " -- $cur) ) ;; - "describe-target-group") + "list-table-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --target-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-name --database-name " -- $cur) ) ;; - "update-target-group") + "create-table") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --target-group-id --description --target-group-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-name --db-model-dbtable " -- $cur) ) ;; - "delete-target-group") + "get-table-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --target-group-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --table-name --instance-name --database-name " -- $cur) ) ;; - "register-targets") + "delete-table") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --target-group-id --target-specs " -- $cur) ) + -W "-h --help --headers --input-json --region-id --table-name --instance-name --database-name " -- $cur) ) ;; - "de-register-targets") + "execute-ras-query") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --target-group-id --target-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --database-name --sql --user-name --queue-name --source --call-back-url --instance-name --instance-owner-name --is-explain " -- $cur) ) ;; - "update-targets") + "execute-py-spark-query") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --target-group-id --target-update-specs " -- $cur) ) + -W "-h --help --headers --input-json --region-id --script --user-name --instance-name --instance-owner-name --script-type " -- $cur) ) ;; - "describe-targets") + "get-ras-query-state") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --target-group-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) ;; - "describe-url-maps") + "get-py-spark-execute-state") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --page-number --page-size --filters " -- $cur) ) + -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) ;; - "create-url-map") + "get-ras-query-log") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --url-map-name --load-balancer-id --description " -- $cur) ) + -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) ;; - "describe-url-map") + "get-ras-query-result") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --url-map-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) ;; - "update-url-map") + "get-py-spark-execute-result") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --url-map-id --description --url-map-name " -- $cur) ) + -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) ;; - "delete-url-map") + "cancel-ras-query") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --url-map-id " -- $cur) ) + -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) ;; - "add-rules") + "cancel-py-spark-job") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --url-map-id --rule-specs " -- $cur) ) + -W "-h --help --headers --input-json --region-id --user-name --query-id " -- $cur) ) ;; - "update-rules") + "list-database-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --url-map-id --rule-update-specs " -- $cur) ) + -W "-h --help --headers --input-json --region-id --instance-name " -- $cur) ) ;; - "delete-rules") + "get-database-info") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --url-map-id --rule-ids " -- $cur) ) + -W "-h --help --headers --input-json --region-id --database-name --instance-name " -- $cur) ) ;; - - "generate-skeleton") - COMPREPLY=( $(compgen -W "-h --help --api" -- $cur) ) + "create-database") + COMPREPLY=( $(compgen \ + -W "-h --help --headers --input-json --region-id --database-name --instance-name --description " -- $cur) ) ;; - esac - ;; - - "industrydata") - case "$prev" in - # HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE - "get-large-screen-data") + "delete-database") COMPREPLY=( $(compgen \ - -W "-h --help --headers --input-json --region-id --region --industry --start-date --end-date --first-index --second-index " -- $cur) ) + -W "-h --help --headers --input-json --region-id --database-name --instance-name " -- $cur) ) ;; "generate-skeleton") diff --git a/jdcloud_cli/resources/jke/config.jinja b/jdcloud_cli/resources/jke/config.jinja deleted file mode 100644 index cd99463..0000000 --- a/jdcloud_cli/resources/jke/config.jinja +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v1 -clusters: -- cluster: - certificate-authority-data: {{ certificate_authority_data }} - server: {{ server }} - name: kubernetes -contexts: -- context: - cluster: kubernetes - user: basic-authentication - name: basic-authentication@kubernetes -- context: - cluster: kubernetes - user: cert-authentication - name: cert-authentication@kubernetes -current-context: {{ context_name }} -kind: Config -preferences: {} -users: -- name: basic-authentication - user: - username: {{ username }} - password: {{ password }} -- name: cert-authentication - user: - client-certificate-data: {{ client_certificate_data }} - client-key-data: {{ client_key_data }} diff --git a/jdcloud_cli/resources/skeletons/apigateway.json b/jdcloud_cli/resources/skeletons/apigateway.json index dcfd125..8e53504 100644 --- a/jdcloud_cli/resources/skeletons/apigateway.json +++ b/jdcloud_cli/resources/skeletons/apigateway.json @@ -1,5 +1,95 @@ { - "query-access-auths":{ + "query-user-domains":{ + "pageNumber":"", + "pageSize":"", + "orderBy":"", + "apiGroupId":"", + "regionId":"" + }, + "create-user-domain":{ + "domain":"", + "protocol":"", + "apiGroupId":"", + "regionId":"" + }, + "delete-user-domain":{ + "domainIds":"", + "apiGroupId":"", + "regionId":"" + }, + "create-backend-config":{ + "backendConfigId":"", + "baseGroupId":"", + "environment":"", + "backendUrl":"", + "backendServiceType":"", + "headerParams":[{ + "name":"", + "value":"" + }], + "queryParams":[{ + "name":"", + "value":"" + }], + "description":"", + "createTime":"", + "sort":"", + "userSort":"", + "jdsfId":"", + "jdsfParam":"", + "jdsfRegion":"", + "jdsfPin":"", + "regionId":"", + "apiGroupId":"" + }, + "describe-backend-configs":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"", + "apiGroupId":"", + "environment":"" + }, + "describe-backend-config":{ + "regionId":"", + "apiGroupId":"", + "backendConfigId":"" + }, + "update-backend-config":{ + "baseGroupId":"", + "environment":"", + "backendUrl":"", + "backendServiceType":"", + "headerParams":[{ + "name":"", + "value":"" + }], + "queryParams":[{ + "name":"", + "value":"" + }], + "description":"", + "createTime":"", + "sort":"", + "userSort":"", + "jdsfId":"", + "jdsfParam":"", + "jdsfRegion":"", + "jdsfPin":"", + "regionId":"", + "apiGroupId":"", + "backendConfigId":"" + }, + "delete-backend-config":{ + "regionId":"", + "apiGroupId":"", + "backendConfigId":"" + }, + "query-uc-access-keys":{ "pageNumber":"", "pageSize":"", "filters":[{ @@ -9,52 +99,153 @@ }], "regionId":"" }, - "create-access-auth":{ - "accessAuthView":{ - "authUserType":"", - "accessKey":"", - "deploymentIds":"", + "query-keys":{ + "pageNumber":"", + "pageSize":"", + "orderBy":"", + "userType":"", + "keyId":"", + "regionId":"" + }, + "create-key":{ + "keyName":"", + "keyDesc":"", + "regionId":"" + }, + "reset-key":{ + "keyId":"", + "regionId":"" + }, + "update-key":{ + "keyId":"", + "keyName":"", + "keyDesc":"", + "regionId":"" + }, + "query-key-info":{ + "regionId":"", + "keyId":"" + }, + "describe-api-groups":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "tagFilters":[{ + "key":"", + "values":"" + }], + "regionId":"" + }, + "create-api-group":{ + "groupName":"", + "description":"", + "prefix":"", + "keyCheck":"", + "authType":"", + "prefixStrip":"", + "groupType":"", + "jdsfName":"", + "jdsfRegistryName":"", + "jdsfId":"", + "regionId":"" + }, + "check-group-name-exist":{ + "groupName":"", + "regionId":"" + }, + "describe-api-group":{ + "regionId":"", + "apiGroupId":"" + }, + "modify-api-group-attribute":{ + "groupName":"", + "description":"", + "prefix":"", + "keyCheck":"", + "authType":"", + "prefixStrip":"", + "groupType":"", + "jdsfName":"", + "jdsfRegistryName":"", + "jdsfId":"", + "regionId":"", + "apiGroupId":"" + }, + "delete-api-group":{ + "regionId":"", + "apiGroupId":"" + }, + "describe-is-deploy-api-groups":{ + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "query-rate-limit-policies":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-rate-limit-policy":{ + "rateLimitPolicyView":{ + "policyName":"", + "timeUnit":"", + "apiLimitCount":"", + "userLimitCount":"", + "appLimitCount":"", "description":"" }, "regionId":"" }, - "check-auth-exist":{ - "accessKey":"", - "authUserType":"", + "check-policy-name":{ + "policyName":"", "regionId":"" }, - "query-access-auth":{ + "query-rate-limit-policy":{ "regionId":"", - "accessAuthId":"" + "policyId":"" }, - "update-access-auth":{ - "accessAuthView":{ - "authUserType":"", - "accessKey":"", - "deploymentIds":"", + "update-rate-limit-policy":{ + "rateLimitPolicyView":{ + "policyName":"", + "timeUnit":"", + "apiLimitCount":"", + "userLimitCount":"", + "appLimitCount":"", "description":"" }, "regionId":"", - "accessAuthId":"" + "policyId":"" }, - "delete-access-auth":{ + "delete-rate-limit-policy":{ "regionId":"", - "accessAuthId":"" + "policyId":"" }, - "query-bind-group-auth":{ + "query-bind-group-policy":{ "regionId":"", - "accessAuthId":"" + "policyId":"" }, - "bind-group-auth":{ + "bind-group-policy":{ "deploymentIds":"", "regionId":"", - "accessAuthId":"" + "policyId":"" }, - "query-auth-group-list":{ - "authUserType":"", - "regionId":"" + "query-policy-group-list":{ + "regionId":"", + "policyId":"" }, - "authorized-api-group-list":{ + "query-subscription-keys":{ "pageNumber":"", "pageSize":"", "filters":[{ @@ -64,6 +255,25 @@ }], "regionId":"" }, + "create-subscription-key":{ + "description":"", + "name":"", + "regionId":"" + }, + "query-subscription-key":{ + "regionId":"", + "subscriptionKeyId":"" + }, + "update-subscription-key":{ + "description":"", + "name":"", + "regionId":"", + "subscriptionKeyId":"" + }, + "delete-subscription-key":{ + "regionId":"", + "subscriptionKeyId":"" + }, "query-access-keys":{ "pageNumber":"", "pageSize":"", @@ -113,6 +323,10 @@ "regionId":"", "accessKeyId":"" }, + "check-pin":{ + "regionId":"", + "pin":"" + }, "query-apis":{ "pageNumber":"", "pageSize":"", @@ -176,220 +390,87 @@ "revision":"", "apiId":"" }, - "update-api":{ - "api":{ - "apiGroupId":"", - "apiName":"", - "action":"", - "path":"", - "matchType":"", - "description":"", - "reqParams":[""], - "reqBody":"", - "resBody":"", - "reqBodyType":"", - "resBodyType":"", - "apiBackendConfig":{ - "backendPath":"", - "backendAction":"", - "backendParams":[""], - "backendConstParams":[""] - }, - "backServiceType":"", - "backServicePath":"", - "backServiceId":"", - "backServiceName":"", - "backUrl":"", - "backServiceConfig":"", - "backServiceVersion":"", - "hufuAppTypeId":"", - "editableReqBodyType":"", - "editableResBodyType":"" - }, - "regionId":"", - "apiGroupId":"", - "revision":"", - "apiId":"" - }, - "delete-api":{ - "regionId":"", - "apiGroupId":"", - "revision":"", - "apiId":"" - }, - "update-api-by-name":{ - "api":{ - "apiGroupId":"", - "apiName":"", - "action":"", - "path":"", - "matchType":"", - "description":"", - "reqParams":[""], - "reqBody":"", - "resBody":"", - "reqBodyType":"", - "resBodyType":"", - "apiBackendConfig":{ - "backendPath":"", - "backendAction":"", - "backendParams":[""], - "backendConstParams":[""] - }, - "backServiceType":"", - "backServicePath":"", - "backServiceId":"", - "backServiceName":"", - "backUrl":"", - "backServiceConfig":"", - "backServiceVersion":"", - "hufuAppTypeId":"", - "editableReqBodyType":"", - "editableResBodyType":"" - }, - "regionId":"", - "apiGroupId":"", - "revision":"", - "apiName":"" - }, - "delete-api-by-name":{ - "regionId":"", - "apiGroupId":"", - "revision":"", - "apiName":"" - }, - "describe-api-groups":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "tagFilters":[{ - "key":"", - "values":"" - }], - "regionId":"" - }, - "create-api-group":{ - "groupName":"", - "description":"", - "prefix":"", - "keyCheck":"", - "authType":"", - "prefixStrip":"", - "groupType":"", - "jdsfName":"", - "jdsfRegistryName":"", - "jdsfId":"", - "regionId":"" - }, - "check-group-name-exist":{ - "groupName":"", - "regionId":"" - }, - "describe-api-group":{ - "regionId":"", - "apiGroupId":"" - }, - "modify-api-group-attribute":{ - "groupName":"", - "description":"", - "prefix":"", - "keyCheck":"", - "authType":"", - "prefixStrip":"", - "groupType":"", - "jdsfName":"", - "jdsfRegistryName":"", - "jdsfId":"", - "regionId":"", - "apiGroupId":"" - }, - "delete-api-group":{ - "regionId":"", - "apiGroupId":"" - }, - "describe-is-deploy-api-groups":{ - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, - "create-backend-config":{ - "backendConfigId":"", - "baseGroupId":"", - "environment":"", - "backendUrl":"", - "backendServiceType":"", - "headerParams":[{ - "name":"", - "value":"" - }], - "queryParams":[{ - "name":"", - "value":"" - }], - "description":"", - "createTime":"", - "sort":"", - "userSort":"", - "jdsfId":"", - "jdsfParam":"", - "jdsfRegion":"", - "jdsfPin":"", - "regionId":"", - "apiGroupId":"" - }, - "describe-backend-configs":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], + "update-api":{ + "api":{ + "apiGroupId":"", + "apiName":"", + "action":"", + "path":"", + "matchType":"", + "description":"", + "reqParams":[""], + "reqBody":"", + "resBody":"", + "reqBodyType":"", + "resBodyType":"", + "apiBackendConfig":{ + "backendPath":"", + "backendAction":"", + "backendParams":[""], + "backendConstParams":[""] + }, + "backServiceType":"", + "backServicePath":"", + "backServiceId":"", + "backServiceName":"", + "backUrl":"", + "backServiceConfig":"", + "backServiceVersion":"", + "hufuAppTypeId":"", + "editableReqBodyType":"", + "editableResBodyType":"" + }, "regionId":"", "apiGroupId":"", - "environment":"" + "revision":"", + "apiId":"" }, - "describe-backend-config":{ + "delete-api":{ "regionId":"", "apiGroupId":"", - "backendConfigId":"" + "revision":"", + "apiId":"" }, - "update-backend-config":{ - "baseGroupId":"", - "environment":"", - "backendUrl":"", - "backendServiceType":"", - "headerParams":[{ - "name":"", - "value":"" - }], - "queryParams":[{ - "name":"", - "value":"" - }], - "description":"", - "createTime":"", - "sort":"", - "userSort":"", - "jdsfId":"", - "jdsfParam":"", - "jdsfRegion":"", - "jdsfPin":"", + "update-api-by-name":{ + "api":{ + "apiGroupId":"", + "apiName":"", + "action":"", + "path":"", + "matchType":"", + "description":"", + "reqParams":[""], + "reqBody":"", + "resBody":"", + "reqBodyType":"", + "resBodyType":"", + "apiBackendConfig":{ + "backendPath":"", + "backendAction":"", + "backendParams":[""], + "backendConstParams":[""] + }, + "backServiceType":"", + "backServicePath":"", + "backServiceId":"", + "backServiceName":"", + "backUrl":"", + "backServiceConfig":"", + "backServiceVersion":"", + "hufuAppTypeId":"", + "editableReqBodyType":"", + "editableResBodyType":"" + }, "regionId":"", "apiGroupId":"", - "backendConfigId":"" + "revision":"", + "apiName":"" }, - "delete-backend-config":{ + "delete-api-by-name":{ "regionId":"", "apiGroupId":"", - "backendConfigId":"" + "revision":"", + "apiName":"" }, "describe-deployments":{ "filters":[{ @@ -427,91 +508,6 @@ "regionId":"", "apiGroupId":"" }, - "query-keys":{ - "pageNumber":"", - "pageSize":"", - "orderBy":"", - "userType":"", - "keyId":"", - "regionId":"" - }, - "create-key":{ - "keyName":"", - "keyDesc":"", - "regionId":"" - }, - "reset-key":{ - "keyId":"", - "regionId":"" - }, - "update-key":{ - "keyId":"", - "keyName":"", - "keyDesc":"", - "regionId":"" - }, - "query-key-info":{ - "regionId":"", - "keyId":"" - }, - "query-rate-limit-policies":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, - "create-rate-limit-policy":{ - "rateLimitPolicyView":{ - "policyName":"", - "timeUnit":"", - "apiLimitCount":"", - "userLimitCount":"", - "appLimitCount":"", - "description":"" - }, - "regionId":"" - }, - "check-policy-name":{ - "policyName":"", - "regionId":"" - }, - "query-rate-limit-policy":{ - "regionId":"", - "policyId":"" - }, - "update-rate-limit-policy":{ - "rateLimitPolicyView":{ - "policyName":"", - "timeUnit":"", - "apiLimitCount":"", - "userLimitCount":"", - "appLimitCount":"", - "description":"" - }, - "regionId":"", - "policyId":"" - }, - "delete-rate-limit-policy":{ - "regionId":"", - "policyId":"" - }, - "query-bind-group-policy":{ - "regionId":"", - "policyId":"" - }, - "bind-group-policy":{ - "deploymentIds":"", - "regionId":"", - "policyId":"" - }, - "query-policy-group-list":{ - "regionId":"", - "policyId":"" - }, "describe-revisions":{ "pageNumber":"", "pageSize":"", @@ -562,7 +558,7 @@ "apiGroupId":"", "revisionId":"" }, - "query-subscription-keys":{ + "query-access-auths":{ "pageNumber":"", "pageSize":"", "filters":[{ @@ -572,26 +568,52 @@ }], "regionId":"" }, - "create-subscription-key":{ - "description":"", - "name":"", + "create-access-auth":{ + "accessAuthView":{ + "authUserType":"", + "accessKey":"", + "deploymentIds":"", + "description":"" + }, "regionId":"" }, - "query-subscription-key":{ + "check-auth-exist":{ + "accessKey":"", + "authUserType":"", + "regionId":"" + }, + "query-access-auth":{ "regionId":"", - "subscriptionKeyId":"" + "accessAuthId":"" }, - "update-subscription-key":{ - "description":"", - "name":"", + "update-access-auth":{ + "accessAuthView":{ + "authUserType":"", + "accessKey":"", + "deploymentIds":"", + "description":"" + }, "regionId":"", - "subscriptionKeyId":"" + "accessAuthId":"" }, - "delete-subscription-key":{ + "delete-access-auth":{ "regionId":"", - "subscriptionKeyId":"" + "accessAuthId":"" }, - "query-uc-access-keys":{ + "query-bind-group-auth":{ + "regionId":"", + "accessAuthId":"" + }, + "bind-group-auth":{ + "deploymentIds":"", + "regionId":"", + "accessAuthId":"" + }, + "query-auth-group-list":{ + "authUserType":"", + "regionId":"" + }, + "authorized-api-group-list":{ "pageNumber":"", "pageSize":"", "filters":[{ @@ -601,26 +623,4 @@ }], "regionId":"" }, - "check-pin":{ - "regionId":"", - "pin":"" - }, - "query-user-domains":{ - "pageNumber":"", - "pageSize":"", - "orderBy":"", - "apiGroupId":"", - "regionId":"" - }, - "create-user-domain":{ - "domain":"", - "protocol":"", - "apiGroupId":"", - "regionId":"" - }, - "delete-user-domain":{ - "domainIds":"", - "apiGroupId":"", - "regionId":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/baseanti.json b/jdcloud_cli/resources/skeletons/baseanti.json index ad61cc4..c73dfa3 100644 --- a/jdcloud_cli/resources/skeletons/baseanti.json +++ b/jdcloud_cli/resources/skeletons/baseanti.json @@ -1,26 +1,4 @@ { - "describe-attack-logs":{ - "pageNumber":"", - "pageSize":"", - "startTime":"", - "endTime":"", - "ip":[""] - }, - "describe-attack-statistics":{ - "startTime":"", - "endTime":"", - "ip":[""] - }, - "describe-attack-type-count":{ - "startTime":"", - "endTime":"", - "ip":[""] - }, - "describe-ip-monitor-flow":{ - "startTime":"", - "endTime":"", - "ip":[""] - }, "describe-ip-resources":{ "ip":"", "regionId":"" @@ -28,16 +6,25 @@ "describe-elastic-ip-resources":{ "pageNumber":"", "pageSize":"", + "ip":"", "regionId":"" }, "describe-cps-ip-resources":{ "pageNumber":"", "pageSize":"", + "ip":"", "regionId":"" }, "describe-ccs-ip-resources":{ "pageNumber":"", "pageSize":"", + "ip":"", + "regionId":"" + }, + "describe-waf-ip-resources":{ + "pageNumber":"", + "pageSize":"", + "ip":"", "regionId":"" }, "describe-ip-resource-info":{ @@ -79,4 +66,26 @@ "regionId":"", "ip":"" }, + "describe-attack-logs":{ + "pageNumber":"", + "pageSize":"", + "startTime":"", + "endTime":"", + "ip":[""] + }, + "describe-attack-statistics":{ + "startTime":"", + "endTime":"", + "ip":[""] + }, + "describe-attack-type-count":{ + "startTime":"", + "endTime":"", + "ip":[""] + }, + "describe-ip-monitor-flow":{ + "startTime":"", + "endTime":"", + "ip":[""] + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/billing.json b/jdcloud_cli/resources/skeletons/billing.json index 1a29592..49c475f 100644 --- a/jdcloud_cli/resources/skeletons/billing.json +++ b/jdcloud_cli/resources/skeletons/billing.json @@ -48,6 +48,9 @@ "clientType":"", "packageCount":"", "processType":"", + "renewMode":"", + "unifyExpireDay":"", + "totalPriceRule":"", "regionId":"" }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/cdn.json b/jdcloud_cli/resources/skeletons/cdn.json index 78e669c..60caa99 100644 --- a/jdcloud_cli/resources/skeletons/cdn.json +++ b/jdcloud_cli/resources/skeletons/cdn.json @@ -1,195 +1,339 @@ { - "query-domains-log":{ - "domains":"", + "query-forbidden-info-list":{ + "queryDomain":"", + "forbiddenUrl":"", + "pageNumber":"", + "pageSize":"" + }, + "create-forbidden-info":{ + "forbiddenType":"", + "forbiddenDomain":"", + "forbiddenUrl":"", + "reason":"", + "linkOther":"", + "shareCacheDomainFlag":"", + "token":"" + }, + "delete-forbidden-info":{ + "forbiddenType":"", + "forbiddenDomain":"", + "forbiddenUrl":"", + "shareCacheDomainFlag":"", + "token":"" + }, + "query-un-forbidden-status":{ + "domain":"", + "url":"", + "taskId":"", + "pageNumber":"", + "pageSize":"" + }, + "create-live-domain-prefecth-task":{ + "urlList":"", + "prefetchTime":"", + "action":"" + }, + "query-live-prefetch-task":{ + "urlList":"" + }, + "query-area-isp-list":{ + }, + "query-area-isp-list-v2":{ + }, + "query-mix-statistics-data":{ "startTime":"", "endTime":"", - "interval":"", - "logType":"" + "domain":"", + "fields":"", + "area":"", + "isp":"", + "period":"", + "scheme":"", + "cacheType":"" }, - "query-domain-log":{ + "query-mix-statistics-with-area-data":{ "startTime":"", "endTime":"", - "interval":"", - "logType":"", - "pageSize":"", - "pageNumber":"", - "domain":"" + "domain":"", + "fields":"", + "area":"", + "isp":"", + "period":"", + "cacheType":"" }, - "query-online-billing-type":{ + "query-mix-traffic-group-sum":{ + "startTime":"", + "endTime":"", + "domain":"", + "fields":"", + "area":"", + "isp":"", + "period":"", + "groupBy":"", + "cacheType":"" }, - "set-online-billing-type":{ - "allType":"" + "query-statistics-data":{ + "startTime":"", + "endTime":"", + "domain":"", + "subDomain":"", + "fields":"", + "area":"", + "isp":"", + "origin":"", + "period":"", + "abroad":"", + "cacheType":"" }, - "query-band":{ + "query-statistics-data-group-by-area":{ "startTime":"", "endTime":"", "domain":"", + "subDomain":"", + "fields":"", "area":"", "isp":"", - "period":"" + "origin":"", + "period":"", + "groupBy":"", + "scheme":"", + "abroad":"", + "cacheType":"" }, - "query-band-with-area":{ + "query-statistics-data-group-sum":{ "startTime":"", "endTime":"", "domain":"", + "subDomain":"", + "fields":"", "area":"", "isp":"", - "period":"" + "origin":"", + "period":"", + "groupBy":"", + "abroad":"", + "cacheType":"" }, - "query-domain-config-status":{ - "taskId":"" + "query-live-statistics-data":{ + "startTime":"", + "endTime":"", + "domain":"", + "appName":"", + "streamName":"", + "subDomain":"", + "fields":"", + "area":"", + "isp":"", + "reqMethod":"", + "scheme":"", + "cacheLevel":"", + "period":"", + "cacheType":"" }, - "query-area-isp-list":{ + "query-live-statistics-area-data-group-by":{ + "startTime":"", + "endTime":"", + "domain":"", + "appName":"", + "fields":"", + "area":"", + "isp":"", + "streamName":"", + "period":"", + "groupBy":"", + "subDomain":"", + "scheme":"", + "reqMethod":"", + "cacheLevel":"", + "cacheType":"" }, - "preview-certificate":{ - "content":"", - "domain":"" + "query-live-traffic-group-sum":{ + "startTime":"", + "endTime":"", + "domain":"", + "subDomain":"", + "appName":"", + "streamName":"", + "fields":"", + "area":"", + "isp":"", + "scheme":"", + "period":"", + "groupBy":"", + "reqMethod":"", + "cacheLevel":"", + "cacheType":"" }, - "query-default-http-header-key":{ + "query-statistics-top-ip":{ + "startTime":"", + "endTime":"", + "domain":"", + "subDomain":"", + "size":"", + "topBy":"" }, - "query-ip-black-list":{ - "domain":"" + "query-statistics-top-url":{ + "startTime":"", + "endTime":"", + "domain":"", + "subDomain":"", + "size":"", + "topBy":"" }, - "set-ip-black-list":{ - "ips":"", - "domain":"" + "query-dir-bandwidth":{ + "startTime":"", + "endTime":"", + "domain":"", + "dirs":"", + "regions":"", + "cacheType":"" }, - "operate-ip-black-list":{ - "status":"", - "domain":"" + "query-dir-stats-data":{ + "startTime":"", + "endTime":"", + "domain":"", + "dirs":"", + "cacheType":"" }, - "create-cache-rule":{ - "weight":"", - "ttl":"", - "contents":"", - "cacheType":"", - "domain":"" + "query-customized-dir-band-width":{ + "startTime":"", + "endTime":"", + "domain":"", + "dir":"" }, - "update-cache-rule":{ - "weight":"", - "ttl":"", - "contents":"", - "cacheType":"", - "configId":"", + "query-stream-info":{ + "startTime":"", + "endTime":"", + "appName":"", + "streamName":"", + "pageNum":"", + "pageSize":"", "domain":"" }, - "delete-cache-rule":{ - "configId":"", - "domain":"" + "query-domain-temp-inst-list":{ + "instName":"", + "pageNumber":"", + "pageSize":"" }, - "query-http-header":{ - "domain":"" + "query-domain-temp-pro-keys":{ }, - "set-http-header":{ - "headerType":"", - "headerName":"", - "headerValue":"", - "domain":"" + "modify-domain-temp-inst":{ + "tempId":"", + "instId":"", + "instName":"", + "instProInfoMap":"" }, - "delete-http-header":{ - "headerType":"", - "headerName":"", - "domain":"" + "query-domain-temp-inst":{ + "instId":"" }, - "set-video-draft":{ - "status":"", - "domain":"" + "del-domain-temp-instance":{ + "instId":"" }, - "set-range":{ + "get-domain-list":{ + "keyWord":"", + "pageNumber":"", + "pageSize":"", "status":"", - "domain":"" + "type":"", + "accelerateRegion":"" }, - "set-ignore-query-string":{ + "get-domain-list-by-filter":{ + "keyWord":"", + "pageNumber":"", + "pageSize":"", "status":"", - "domain":"" + "type":"", + "accelerateRegion":"", + "filterBy":"", + "tagFilters":[{ + "key":"", + "values":"" + }] }, - "query-user-agent":{ + "get-domain-detail":{ "domain":"" }, - "set-user-agent-config":{ - "userAgentType":"", - "userAgentList":"", + "create-domain":{ + "sourceType":"", + "cdnType":"", + "backSourceType":"", + "dailyBandWidth":"", + "quaility":"", + "maxFileSize":"", + "minFileSize":"", + "sumFileSize":"", + "avgFileSize":"", + "defaultSourceHost":"", + "httpType":"", + "ipSource":[""], + "domainSource":[""], + "ossSource":"", + "accelerateRegion":"", + "tempInstId":"", "domain":"" }, - "query-accesskey-config":{ + "delete-domain":{ "domain":"" }, - "set-accesskey-config":{ - "accesskeyType":"", - "accesskeyKey":"", - "accesskeyKeep":"", + "start-domain":{ "domain":"" }, - "set-refer":{ - "referType":"", - "referList":"", - "allowNoReferHeader":"", - "allowNullReferHeader":"", + "stop-domain":{ "domain":"" }, - "query-monitor":{ - "domain":"" + "query-oss-buckets":{ }, - "set-monitor":{ - "cycle":"", - "monitorPath":"", - "httpRequestHeader":"", - "domain":"" - }, - "stop-monitor":{ - "domain":"" - }, - "set-source":{ + "batch-create":{ + "domains":"", "sourceType":"", + "cdnType":"", "backSourceType":"", + "dailyBandWidth":"", + "quaility":"", + "maxFileSize":"", + "minFileSize":"", + "sumFileSize":"", + "avgFileSize":"", + "defaultSourceHost":"", + "httpType":"", "ipSource":[""], "domainSource":[""], "ossSource":"", - "defaultSourceHost":"", - "domain":"" - }, - "operate-share-cache":{ - "status":"", - "domain":"" + "accelerateRegion":"", + "tempInstId":"" }, - "set-http-type":{ - "httpType":"", - "certificate":"", - "rsaKey":"", - "jumpType":"", - "certFrom":"", - "sslCertId":"", - "syncToSsl":"", - "certName":"", + "query-domain-config":{ "domain":"" }, - "query-follow-redirect":{ - "domain":"" + "config-service-notice":{ + "id":"", + "noticeType":"", + "noticeWay":"", + "noticeTo":"", + "noticeCC":"", + "noticeContent":"", + "noticePeriod":"", + "noticeStatus":"" + }, + "query-service-notice":{ + "noticeType":"", + "noticeWay":"" }, - "set-follow-redirect":{ - "status":"", - "domain":"" + "query-online-billing-type":{ }, - "query-follow-source-protocol":{ - "domain":"" + "set-online-billing-type":{ + "allType":"" }, - "set-follow-source-protocol":{ - "status":"", - "domain":"" + "query-domain-config-status":{ + "taskId":"" }, - "set-domain-config":{ - "httpType":"", - "backSourceType":"", - "jumpType":"", - "domain":"" + "check-whether-ip-belong-to-jcloud":{ + "ips":"" }, - "query-domain-all-config-classify":{ - "domain":"" + "query-service-ip":{ + "domainList":"" }, - "execute-domain-copy":{ - "domain":"", - "copyDomains":"", - "configKeys":"" + "get-all-upper-node-ip-list":{ }, "query-domain-group-list":{ "shareCache":"", @@ -219,189 +363,203 @@ "batch-delete-domain-group":{ "ids":[""] }, - "get-domain-list":{ - "keyWord":"", - "pageNumber":"", - "pageSize":"", - "status":"", - "type":"", - "accelerateRegion":"" - }, - "get-domain-list-by-filter":{ - "keyWord":"", - "pageNumber":"", - "pageSize":"", - "status":"", - "type":"", - "accelerateRegion":"", - "tagFilters":[{ - "key":"", - "values":"" - }] + "query-waf-switch":{ + "domain":"" }, - "get-domain-detail":{ + "set-waf-switch":{ + "switchStatus":"", "domain":"" }, - "create-domain":{ - "sourceType":"", - "cdnType":"", - "backSourceType":"", - "dailyBandWidth":"", - "quaility":"", - "maxFileSize":"", - "minFileSize":"", - "sumFileSize":"", - "avgFileSize":"", - "defaultSourceHost":"", - "httpType":"", - "ipSource":[""], - "domainSource":[""], - "ossSource":"", - "accelerateRegion":"", + "query-waf-white-rule-switch":{ "domain":"" }, - "delete-domain":{ + "set-waf-white-rule-switch":{ + "switchStatus":"", "domain":"" }, - "start-domain":{ + "querywaf-white-rules":{ + "ruleType":"", + "id":"", + "pageSize":"", + "pageIndex":"", "domain":"" }, - "stop-domain":{ + "create-waf-white-rule":{ + "ruleType":"", + "matchOp":"", + "val":"", + "actions":"", "domain":"" }, - "query-oss-buckets":{ + "update-waf-white-rule":{ + "ruleType":"", + "matchOp":"", + "val":"", + "actions":"", + "domain":"", + "id":"" }, - "batch-create":{ - "domains":"", - "sourceType":"", - "cdnType":"", - "backSourceType":"", - "dailyBandWidth":"", - "quaility":"", - "maxFileSize":"", - "minFileSize":"", - "sumFileSize":"", - "avgFileSize":"", - "defaultSourceHost":"", - "httpType":"", - "ipSource":[""], - "domainSource":[""], - "ossSource":"", - "accelerateRegion":"" + "enable-waf-white-rules":{ + "ids":"", + "ruleType":"", + "domain":"" }, - "query-domain-config":{ + "disable-waf-white-rules":{ + "ids":"", + "ruleType":"", "domain":"" }, - "check-whether-ip-belong-to-jcloud":{ - "ips":"" + "delete-waf-white-rules":{ + "ruleType":"", + "domain":"", + "ids":"" }, - "set-live-domain-back-source":{ - "sourceType":"", - "backSourceType":"", - "defaultSourceHost":"", - "domainSource":[""], - "ipSource":[""], + "query-waf-black-rule-switch":{ "domain":"" }, - "set-live-domain-ip-black-list":{ - "ips":"", + "set-waf-black-rule-switch":{ + "switchStatus":"", "domain":"" }, - "set-live-domain-refer":{ - "referType":"", - "referList":"", - "allowNoReferHeader":"", - "allowNullReferHeader":"", + "querywaf-black-rules":{ + "ruleType":"", + "id":"", + "pageSize":"", + "pageIndex":"", "domain":"" }, - "operate-live-domain-ip-black-list":{ - "blackIpsEnable":"", + "create-waf-black-rule":{ + "ruleType":"", + "matchOp":"", + "val":"", + "atOp":"", + "atVal":"", "domain":"" }, - "set-live-domain-back-source-host":{ - "sourceHost":"", - "domain":"" + "update-waf-black-rule":{ + "ruleType":"", + "matchOp":"", + "val":"", + "atOp":"", + "atVal":"", + "domain":"", + "id":"" }, - "set-live-domain-access-key":{ - "accesskeyType":"", - "accesskeyKey":"", - "authLifeTime":"", + "enable-waf-black-rules":{ + "ids":"", + "ruleType":"", "domain":"" }, - "set-protocol-convert":{ - "certificate":"", - "rsaKey":"", - "certFrom":"", - "sslCertId":"", - "syncToSsl":"", - "certName":"", - "protocolConverts":[""], + "disable-waf-black-rules":{ + "ids":"", + "ruleType":"", "domain":"" }, - "delete-forbidden-stream":{ - "deleteStreams":[""], - "domain":"" + "delete-waf-black-rules":{ + "ruleType":"", + "domain":"", + "ids":"" }, - "query-push-domain-orapp-or-stream":{ - "app":"", - "stream":"", - "limit":"", + "query-ccprotect-switch":{ "domain":"" }, - "batch-create-live-domain":{ - "playDomain":"", - "publishDomain":"", - "sourceType":"", - "backHttpType":"", - "defaultSourceHost":"", - "siteType":"", - "backSourceType":"", - "ipSource":[""], - "domainSource":[""], - "accelerateRegion":"" - }, - "query-live-domain-detail":{ + "set-ccprotect-switch":{ + "switchStatus":"", "domain":"" }, - "query-live-domain-apps":{ + "query-ccprotect-rules":{ + "id":"", + "pageSize":"", + "pageIndex":"", "domain":"" }, - "create-live-domain-prefecth-task":{ - "urlList":"", - "prefetchTime":"", - "action":"" + "create-ccprotect-rule":{ + "uri":"", + "detectPeriod":"", + "singleIpLimit":"", + "blockType":"", + "blockTime":"", + "domain":"" }, - "query-live-prefetch-task":{ - "urlList":"" + "update-ccprotect-rule":{ + "uri":"", + "detectPeriod":"", + "singleIpLimit":"", + "blockType":"", + "blockTime":"", + "domain":"", + "id":"" }, - "query-refresh-task-by-ids":{ - "taskIds":"", - "keyword":"" + "enable-ccprotect-rule":{ + "ids":"", + "domain":"" }, - "query-refresh-task-by-id":{ - "taskId":"" + "disable-ccprotect-rule":{ + "ids":"", + "domain":"" }, - "create-refresh-task-for-callback":{ - "taskType":"", - "urlItems":[""] + "delete-ccprotect-rule":{ + "domain":"", + "ids":"" }, - "create-refresh-task-for-callback-v2":{ - "taskType":"", - "urlItems":[""] + "query-web-protect-switch":{ + "domain":"" }, - "query-refresh-task":{ - "startTime":"", - "endTime":"", - "keyword":"", - "taskId":"", - "taskStatus":"", - "taskType":"", - "pageNumber":"", - "pageSize":"" + "set-web-protect-switch":{ + "switchStatus":"", + "domain":"" }, - "create-refresh-task":{ + "query-web-protect-settings":{ + "domain":"" + }, + "update-web-protect-settings":{ + "wafMode":"", + "wafLevel":"", + "redirection":"", + "domain":"" + }, + "query-waf-regions":{ + "skipType":"" + }, + "query-ip-black-setting-status":{ + "domain":"" + }, + "bat-create-prefetch-task":{ + "tasks":[""] + }, + "update-prefetch-task":{ + "url":"", + "region":"", + "isp":"", + "copyNum":"" + }, + "query-prefetch-task":{ + "url":"", + "region":"", + "isp":"", + "status":"", + "fileId":"", + "pageNumber":"", + "pageSize":"", "taskType":"", - "urls":"" + "domain":"" + }, + "stop-prefetch-task":{ + "urls":"", + "region":"", + "isp":"" + }, + "operate-purge-task":{ + "urls":"", + "optType":"" + }, + "query-purge-task":{ + "url":"", + "status":"", + "fileId":"", + "pageNumber":"", + "pageSize":"", + "domain":"" }, "query-net-protection-rules":{ }, @@ -439,313 +597,391 @@ "sortField":"", "sortRule":"" }, - "get-all-upper-node-ip-list":{ + "preview-certificate":{ + "content":"", + "domain":"" }, - "get-ssl-cert-list":{ - "pageNumber":"", - "pageSize":"", + "query-default-http-header-key":{ + }, + "query-ip-black-list":{ "domain":"" }, - "get-ssl-cert-detail":{ - "sslCertId":"" + "set-ip-black-list":{ + "ips":"", + "ipListType":"", + "domain":"" }, - "upload-cert":{ - "certName":"", - "keyFile":"", - "certFile":"", - "aliasName":"" + "operate-ip-black-list":{ + "status":"", + "domain":"" }, - "query-mix-statistics-data":{ - "startTime":"", - "endTime":"", - "domain":"", - "fields":"", - "area":"", - "isp":"", - "period":"", - "scheme":"" + "query-custom-error-page":{ + "domain":"" }, - "query-mix-statistics-with-area-data":{ - "startTime":"", - "endTime":"", - "domain":"", - "fields":"", - "area":"", - "isp":"", - "period":"" + "set-custom-error-page":{ + "errorPageConfigs":[""], + "domain":"" }, - "query-mix-traffic-group-sum":{ - "startTime":"", - "endTime":"", - "domain":"", - "fields":"", - "area":"", - "isp":"", - "period":"", - "groupBy":"" + "create-cache-rule":{ + "weight":"", + "ttl":"", + "contents":"", + "cacheType":"", + "domain":"" }, - "query-statistics-data":{ - "startTime":"", - "endTime":"", - "domain":"", - "subDomain":"", - "fields":"", - "area":"", - "isp":"", - "origin":"", - "period":"" + "update-cache-rule":{ + "weight":"", + "ttl":"", + "contents":"", + "cacheType":"", + "configId":"", + "domain":"" }, - "query-statistics-data-group-by-area":{ - "startTime":"", - "endTime":"", - "domain":"", - "subDomain":"", - "fields":"", - "area":"", - "isp":"", - "origin":"", - "period":"", - "groupBy":"", - "scheme":"" + "delete-cache-rule":{ + "configId":"", + "domain":"" }, - "query-statistics-data-group-sum":{ - "startTime":"", - "endTime":"", - "domain":"", - "subDomain":"", - "fields":"", - "area":"", - "isp":"", - "origin":"", - "period":"", - "groupBy":"" + "set-cache-rules":{ + "cacheRules":[""], + "domain":"" }, - "query-live-statistics-data":{ - "startTime":"", - "endTime":"", - "domain":"", - "appName":"", - "streamName":"", - "subDomain":"", - "fields":"", - "area":"", - "isp":"", - "reqMethod":"", - "scheme":"", - "period":"" + "query-http-header":{ + "edgeType":"", + "domain":"" }, - "query-live-statistics-area-data-group-by":{ - "startTime":"", - "endTime":"", - "domain":"", - "appName":"", - "fields":"", - "area":"", - "isp":"", - "streamName":"", - "period":"", - "groupBy":"", - "subDomain":"", - "scheme":"", - "reqMethod":"" + "set-http-header":{ + "edgeType":"", + "headerType":"", + "headerName":"", + "headerValue":"", + "domain":"" }, - "query-live-traffic-group-sum":{ - "startTime":"", - "endTime":"", - "domain":"", - "subDomain":"", - "appName":"", - "streamName":"", - "fields":"", - "area":"", - "isp":"", - "scheme":"", - "period":"", - "groupBy":"", - "reqMethod":"" + "delete-http-header":{ + "edgeType":"", + "headerType":"", + "headerName":"", + "domain":"" }, - "query-statistics-top-ip":{ - "startTime":"", - "endTime":"", - "domain":"", - "subDomain":"", - "size":"", - "topBy":"" + "set-video-draft":{ + "status":"", + "domain":"" }, - "query-statistics-top-url":{ - "startTime":"", - "endTime":"", - "domain":"", - "subDomain":"", - "size":"", - "topBy":"" + "set-range":{ + "status":"", + "domain":"" }, - "query-dir-bandwidth":{ - "startTime":"", - "endTime":"", - "domain":"", - "dirs":"", - "regions":"" + "set-ignore-query-string":{ + "status":"", + "domain":"" }, - "query-waf-switch":{ + "set-filter-args":{ + "retainArgs":"", + "status":"", "domain":"" }, - "set-waf-switch":{ - "switchStatus":"", + "query-filter-args":{ "domain":"" }, - "query-waf-white-rule-switch":{ + "query-user-agent":{ "domain":"" }, - "set-waf-white-rule-switch":{ - "switchStatus":"", + "set-user-agent-config":{ + "userAgentType":"", + "userAgentList":"", "domain":"" }, - "querywaf-white-rules":{ - "ruleType":"", - "id":"", - "pageSize":"", - "pageIndex":"", + "query-accesskey-config":{ "domain":"" }, - "create-waf-white-rule":{ - "ruleType":"", - "matchOp":"", - "val":"", - "actions":"", + "set-accesskey-config":{ + "accesskeyType":"", + "accesskeyKey":"", + "accesskeyKeep":"", "domain":"" }, - "update-waf-white-rule":{ - "ruleType":"", - "matchOp":"", - "val":"", - "actions":"", - "domain":"", - "id":"" + "set-refer":{ + "referType":"", + "referList":"", + "allowNoReferHeader":"", + "allowNullReferHeader":"", + "domain":"" }, - "enable-waf-white-rules":{ - "ids":"", - "ruleType":"", + "query-monitor":{ "domain":"" }, - "disable-waf-white-rules":{ - "ids":"", - "ruleType":"", + "set-monitor":{ + "cycle":"", + "monitorPath":"", + "httpRequestHeader":"", + "domain":"" + }, + "stop-monitor":{ + "domain":"" + }, + "set-source":{ + "sourceType":"", + "backSourceType":"", + "accelerateRegion":"", + "ipSource":[""], + "domainSource":[""], + "ossSource":"", + "defaultSourceHost":"", + "domain":"" + }, + "operate-share-cache":{ + "status":"", + "domain":"" + }, + "set-http-type":{ + "httpType":"", + "certificate":"", + "rsaKey":"", + "jumpType":"", + "certFrom":"", + "sslCertId":"", + "syncToSsl":"", + "certName":"", + "domain":"" + }, + "query-follow-redirect":{ + "domain":"" + }, + "set-follow-redirect":{ + "status":"", + "domain":"" + }, + "query-follow-source-protocol":{ + "domain":"" + }, + "set-follow-source-protocol":{ + "status":"", + "domain":"" + }, + "set-domain-config":{ + "httpType":"", + "backSourceType":"", + "jumpType":"", + "jcdnTimeAnti":"", + "hdrCtrl":"", + "toutiaoHeader":"", + "domain":"" + }, + "query-domain-all-config-classify":{ "domain":"" }, - "delete-waf-white-rules":{ - "ruleType":"", + "execute-domain-copy":{ "domain":"", - "ids":"" + "copyDomains":"", + "configKeys":"" }, - "query-waf-black-rule-switch":{ + "query-extra-cache-time":{ "domain":"" }, - "set-waf-black-rule-switch":{ - "switchStatus":"", + "set-extra-cache-time":{ + "httpCode":"", + "cacheTime":"", "domain":"" }, - "querywaf-black-rules":{ - "ruleType":"", - "id":"", - "pageSize":"", - "pageIndex":"", + "delete-extra-cache-time":{ + "httpCode":"", "domain":"" }, - "create-waf-black-rule":{ - "ruleType":"", - "matchOp":"", - "val":"", - "atOp":"", - "atVal":"", + "batch-set-extra-cache-time":{ + "content":"", "domain":"" }, - "update-waf-black-rule":{ - "ruleType":"", - "matchOp":"", - "val":"", - "atOp":"", - "atVal":"", - "domain":"", - "id":"" + "set-gzip":{ + "status":"", + "gzipTypes":"", + "domain":"" }, - "enable-waf-black-rules":{ - "ids":"", - "ruleType":"", + "config-back-source-rule":{ + "beforeRegex":"", + "afterRegex":"", "domain":"" }, - "disable-waf-black-rules":{ - "ids":"", - "ruleType":"", + "query-back-source-rule":{ "domain":"" }, - "delete-waf-black-rules":{ - "ruleType":"", - "domain":"", - "ids":"" + "config-url-rule":{ + "beforeRegex":"", + "afterRegex":"", + "domain":"" }, - "query-ccprotect-switch":{ + "query-url-rule":{ "domain":"" }, - "set-ccprotect-switch":{ - "switchStatus":"", + "config-http2":{ + "status":"", "domain":"" }, - "query-ccprotect-rules":{ - "id":"", - "pageSize":"", - "pageIndex":"", + "query-http2":{ "domain":"" }, - "create-ccprotect-rule":{ - "uri":"", - "detectPeriod":"", - "singleIpLimit":"", - "blockType":"", - "blockTime":"", + "config-back-source-path":{ + "configs":[""], "domain":"" }, - "update-ccprotect-rule":{ - "uri":"", - "detectPeriod":"", - "singleIpLimit":"", - "blockType":"", - "blockTime":"", - "domain":"", - "id":"" + "query-back-source-path":{ + "domain":"" }, - "enable-ccprotect-rule":{ - "ids":"", + "set-accelerate-region":{ + "accelerateRegion":"", "domain":"" }, - "disable-ccprotect-rule":{ - "ids":"", + "config-back-source-rules":{ + "status":"", + "rules":[""], "domain":"" }, - "delete-ccprotect-rule":{ - "domain":"", - "ids":"" + "query-back-source-rules":{ + "domain":"" }, - "query-web-protect-switch":{ + "config-back-source-oss":{ + "status":"", + "accessKey":"", + "secretKey":"", + "bucket":"", + "suffix":"", + "domain2":"", "domain":"" }, - "set-web-protect-switch":{ - "switchStatus":"", + "query-back-source-oss":{ "domain":"" }, - "query-web-protect-settings":{ + "speed-limit":{ + "limitRate":"", "domain":"" }, - "update-web-protect-settings":{ - "wafMode":"", - "wafLevel":"", - "redirection":"", + "query-band":{ + "startTime":"", + "endTime":"", + "domain":"", + "area":"", + "isp":"", + "period":"" + }, + "query-band-with-area":{ + "startTime":"", + "endTime":"", + "domain":"", + "area":"", + "isp":"", + "period":"" + }, + "query-cdn-user-quota":{ + }, + "query-refresh-task-by-ids":{ + "taskIds":"", + "keyword":"" + }, + "set-refresh-limit":{ + "subUsers":"", + "refreshCount":"", + "prefetchCount":"", + "dirCount":"" + }, + "query-refresh-limit":{ + "subUsers":"", + "pageNumber":"", + "pageSize":"" + }, + "query-refresh-task-by-id":{ + "taskId":"" + }, + "create-refresh-task-for-callback":{ + "taskType":"", + "urlItems":[""] + }, + "create-refresh-task-for-callback-v2":{ + "taskType":"", + "urlItems":[""] + }, + "query-refresh-task":{ + "startTime":"", + "endTime":"", + "keyword":"", + "taskId":"", + "taskStatus":"", + "taskType":"", + "pageNumber":"", + "pageSize":"", + "accountType":"", + "subUsers":"" + }, + "create-refresh-task":{ + "taskType":"", + "urls":"" + }, + "get-ssl-cert-list":{ + "pageNumber":"", + "pageSize":"", "domain":"" }, - "query-waf-regions":{ - "skipType":"" + "get-ssl-cert-detail":{ + "sslCertId":"" }, - "query-ip-black-setting-status":{ + "upload-cert":{ + "certName":"", + "keyFile":"", + "certFile":"", + "aliasName":"" + }, + "query-avg-bandwidth-for-pcdn":{ + "starttime":"", + "stoptime":"", + "clientid":"", + "page":"", + "size":"" + }, + "query-device-status-for-pcdn":{ + "macAddr":"" + }, + "query-jdbox-statistics-data":{ + "startTime":"", + "endTime":"", + "fields":"", + "area":"", + "isp":"", + "period":"", + "category":"", + "macAddr":"", + "pluginPin":"" + }, + "query-jdbox-statistics-data-with-group":{ + "startTime":"", + "endTime":"", + "groupBy":"", + "fields":"", + "area":"", + "isp":"", + "period":"", + "category":"", + "macAddr":"", + "pluginPin":"" + }, + "query-jbox-avg-bandwidth":{ + "starttime":"", + "stoptime":"", + "pluginPin":"", + "clientid":"", + "page":"", + "size":"" + }, + "query-domains-log":{ + "domains":"", + "startTime":"", + "endTime":"", + "interval":"", + "logType":"" + }, + "query-domain-log":{ + "startTime":"", + "endTime":"", + "interval":"", + "logType":"", + "pageSize":"", + "pageNumber":"", "domain":"" }, "waf-query-pv-for-area-and-ip":{ @@ -767,4 +1003,108 @@ "pageNumber":"", "pageSize":"" }, + "set-auth-config":{ + "enableUrlAuth":"", + "authKey":"", + "age":"", + "encAlgorithm":"", + "timeFormat":"", + "uriType":"", + "rule":"", + "domain":"" + }, + "set-source-auth-config":{ + "enable":"", + "originRole":"", + "authType":"", + "tosAuthInfo":{ + "accessKey":"", + "secretKey":"", + "authVersion":"", + "AuthHeaders":[""], + "ExpireTime":"" + }, + "ossAuthInfo":{ + "accessKey":"", + "secretKey":"", + "BucketName":"", + "ObjectName":"" + }, + "domain":"" + }, + "set-live-domain-back-source":{ + "sourceType":"", + "backSourceType":"", + "defaultSourceHost":"", + "domainSource":[""], + "ipSource":[""], + "domain":"" + }, + "set-live-domain-ip-black-list":{ + "ips":"", + "ipListType":"", + "domain":"" + }, + "set-live-domain-refer":{ + "referType":"", + "referList":"", + "allowNoReferHeader":"", + "allowNullReferHeader":"", + "domain":"" + }, + "operate-live-domain-ip-black-list":{ + "blackIpsEnable":"", + "domain":"" + }, + "set-live-domain-back-source-host":{ + "sourceHost":"", + "domain":"" + }, + "set-live-domain-access-key":{ + "accesskeyType":"", + "accesskeyKey":"", + "authLifeTime":"", + "domain":"" + }, + "set-protocol-convert":{ + "certificate":"", + "rsaKey":"", + "certFrom":"", + "sslCertId":"", + "syncToSsl":"", + "certName":"", + "protocolConverts":[""], + "domain":"" + }, + "delete-forbidden-stream":{ + "deleteStreams":[""], + "domain":"" + }, + "query-push-domain-orapp-or-stream":{ + "app":"", + "stream":"", + "limit":"", + "domain":"" + }, + "query-live-domain-ip-black-white-list":{ + "domain":"" + }, + "batch-create-live-domain":{ + "playDomain":"", + "publishDomain":"", + "sourceType":"", + "backHttpType":"", + "defaultSourceHost":"", + "siteType":"", + "backSourceType":"", + "ipSource":[""], + "domainSource":[""], + "accelerateRegion":"" + }, + "query-live-domain-detail":{ + "domain":"" + }, + "query-live-domain-apps":{ + "domain":"" + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/clouddnsservice.json b/jdcloud_cli/resources/skeletons/clouddnsservice.json index 94c5dec..1f4ab4b 100644 --- a/jdcloud_cli/resources/skeletons/clouddnsservice.json +++ b/jdcloud_cli/resources/skeletons/clouddnsservice.json @@ -1,53 +1,4 @@ { - "get-action-log":{ - "pageNumber":"", - "pageSize":"", - "startTime":"", - "endTime":"", - "keyWord":"", - "success":"", - "type":"", - "regionId":"" - }, - "get-domains":{ - "pageNumber":"", - "pageSize":"", - "domainName":"", - "regionId":"" - }, - "add-domain":{ - "packId":"", - "domainName":"", - "domainId":"", - "buyType":"", - "timeSpan":"", - "timeUnit":"", - "billingType":"", - "regionId":"" - }, - "del-domain":{ - "domainId":"", - "regionId":"" - }, - "update-domain":{ - "domainName":"", - "id":"", - "regionId":"" - }, - "get-domain-query-count":{ - "domainName":"", - "start":"", - "end":"", - "regionId":"", - "domainId":"" - }, - "get-domain-query-traffic":{ - "domainName":"", - "start":"", - "end":"", - "regionId":"", - "domainId":"" - }, "search-rr":{ "pageNumber":"", "pageSize":"", @@ -115,6 +66,55 @@ }], "regionId":"" }, + "get-domains":{ + "pageNumber":"", + "pageSize":"", + "domainName":"", + "regionId":"" + }, + "add-domain":{ + "packId":"", + "domainName":"", + "domainId":"", + "buyType":"", + "timeSpan":"", + "timeUnit":"", + "billingType":"", + "regionId":"" + }, + "del-domain":{ + "domainId":"", + "regionId":"" + }, + "update-domain":{ + "domainName":"", + "id":"", + "regionId":"" + }, + "get-domain-query-count":{ + "domainName":"", + "start":"", + "end":"", + "regionId":"", + "domainId":"" + }, + "get-domain-query-traffic":{ + "domainName":"", + "start":"", + "end":"", + "regionId":"", + "domainId":"" + }, + "get-action-log":{ + "pageNumber":"", + "pageSize":"", + "startTime":"", + "endTime":"", + "keyWord":"", + "success":"", + "type":"", + "regionId":"" + }, "add-user-view":{ "req":{ "domainId":"", diff --git a/jdcloud_cli/resources/skeletons/containerregistry.json b/jdcloud_cli/resources/skeletons/containerregistry.json index ff204d5..3604853 100644 --- a/jdcloud_cli/resources/skeletons/containerregistry.json +++ b/jdcloud_cli/resources/skeletons/containerregistry.json @@ -1,25 +1,31 @@ { - "get-authorization-token":{ - "expiredAfterHours":"", + "create-repository":{ + "repositoryName":"", + "description":"", "regionId":"", "registryName":"" }, - "describe-authorization-tokens":{ + "describe-repositories":{ "filters":[{ "name":"", "operator":"", "values":"" }], + "registryName":"", "pageNumber":"", "pageSize":"", - "regionId":"", - "registryName":"" + "regionId":"" }, - "release-authorization-token":{ - "authorizationToken":"", - "forceAll":"", + "delete-repository":{ + "force":"", "regionId":"", - "registryName":"" + "registryName":"", + "repositoryName":"" + }, + "check-repository-name":{ + "registryName":"", + "repositoryName":"", + "regionId":"" }, "describe-images":{ "filters":[{ @@ -39,14 +45,6 @@ "registryName":"", "repositoryName":"" }, - "describe-quotas":{ - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, "describe-registries":{ "regionId":"" }, @@ -67,32 +65,34 @@ "registryName":"", "regionId":"" }, - "create-repository":{ - "repositoryName":"", - "description":"", + "describe-quotas":{ + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "get-authorization-token":{ + "expiredAfterHours":"", "regionId":"", "registryName":"" }, - "describe-repositories":{ + "describe-authorization-tokens":{ "filters":[{ "name":"", "operator":"", "values":"" }], - "registryName":"", "pageNumber":"", "pageSize":"", - "regionId":"" - }, - "delete-repository":{ - "force":"", "regionId":"", - "registryName":"", - "repositoryName":"" + "registryName":"" }, - "check-repository-name":{ - "registryName":"", - "repositoryName":"", - "regionId":"" + "release-authorization-token":{ + "authorizationToken":"", + "forceAll":"", + "regionId":"", + "registryName":"" }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/cps.json b/jdcloud_cli/resources/skeletons/cps.json index 966df6a..9d584b8 100644 --- a/jdcloud_cli/resources/skeletons/cps.json +++ b/jdcloud_cli/resources/skeletons/cps.json @@ -1,9 +1,14 @@ { - "describe-elastic-ips":{ + "describe-ipv6address":{ + "regionId":"", + "ipv6AddressId":"" + }, + "describe-ipv6addresses":{ "pageNumber":"", "pageSize":"", - "status":"", - "includeLB":"", + "ipv6GatewayId":"", + "ipv6Address":"", + "enableInternet":"", "filters":[{ "name":"", "operator":"", @@ -11,11 +16,11 @@ }], "regionId":"" }, - "apply-elastic-ips":{ + "assign-ipv6addresses-bandwidth":{ "clientToken":"", - "elasticIpSpec":{ + "ipv6AddressSpec":{ "bandwidth":"", - "count":"", + "ipv6Addresses":"", "charge":{ "chargeMode":"", "chargeUnit":"", @@ -26,45 +31,16 @@ }, "regionId":"" }, - "describe-elastic-ip":{ - "regionId":"", - "elasticIpId":"" - }, - "modify-elastic-ip-bandwidth":{ + "modify-ipv6address-bandwidth":{ "clientToken":"", "bandwidth":"", "regionId":"", - "elasticIpId":"" - }, - "describe-device-types":{ - "az":"", - "regionId":"" - }, - "describe-os":{ - "deviceType":"", - "osType":"", - "regionId":"" - }, - "describe-device-raids":{ - "deviceType":"", - "volumeType":"", - "regionId":"" - }, - "describe-instance":{ - "regionId":"", - "instanceId":"" + "ipv6AddressId":"" }, - "describe-instances":{ + "describe-certs":{ "pageNumber":"", "pageSize":"", - "az":"", "name":"", - "networkType":"", - "deviceType":"", - "subnetId":"", - "keypairId":"", - "enableInternet":"", - "privateIp":"", "filters":[{ "name":"", "operator":"", @@ -72,124 +48,149 @@ }], "regionId":"" }, - "create-instances":{ + "create-cert":{ "clientToken":"", - "instanceSpec":{ - "az":"", - "deviceType":"", - "hostname":"", - "imageType":"", - "osTypeId":"", - "sysRaidTypeId":"", - "dataRaidTypeId":"", - "subnetId":"", - "enableInternet":"", - "enableIpv6":"", - "networkType":"", - "cidr":"", - "privateIp":"", - "lineType":"", - "bandwidth":"", + "certSpec":{ "name":"", - "description":"", - "password":"", - "count":"", - "userData":"", - "keypairId":"", - "charge":{ - "chargeMode":"", - "chargeUnit":"", - "chargeDuration":"", - "autoRenew":"", - "buyScenario":"" - } + "certificate":"", + "privateKey":"" }, "regionId":"" }, - "describe-instance-name":{ + "describe-cert":{ "regionId":"", - "instanceId":"" + "certId":"" }, - "modify-instance":{ - "name":"", - "description":"", + "remove-cert":{ "regionId":"", - "instanceId":"" + "certId":"" }, - "describe-instance-raid":{ + "modify-cert":{ + "name":"", "regionId":"", - "instanceId":"" + "certId":"" }, - "describe-instance-status":{ - "regionId":"", - "instanceId":"" + "describe-alias-ips":{ + "pageNumber":"", + "pageSize":"", + "subnetId":"", + "instanceId":"", + "cidr":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" }, - "restart-instance":{ + "create-alias-ip":{ "clientToken":"", - "regionId":"", - "instanceId":"" + "aliasIpSpec":{ + "instanceId":"", + "aliasIps":[""] + }, + "regionId":"" }, - "stop-instance":{ + "delete-alias-ip":{ "clientToken":"", "regionId":"", - "instanceId":"" + "aliasIpId":"" }, - "start-instance":{ - "clientToken":"", - "regionId":"", - "instanceId":"" + "describe-secondary-cidrs":{ + "subnetId":"", + "regionId":"" }, - "reinstall-instance":{ + "create-secondary-cidr":{ "clientToken":"", - "instanceSpec":{ - "az":"", - "imageType":"", - "osTypeId":"", - "sysRaidTypeId":"", - "keepData":"", - "dataRaidTypeId":"", - "password":"", - "hostname":"", - "userData":"", - "keypairId":"" + "secondaryCidrSpec":{ + "subnetId":"", + "cidr":"", + "name":"" }, - "regionId":"", - "instanceId":"" + "regionId":"" }, - "modify-bandwidth":{ + "delete-secondary-cidr":{ "clientToken":"", - "bandwidth":"", "regionId":"", - "instanceId":"" + "secondaryCidrId":"" }, - "associate-elastic-ip":{ + "describe-elastic-ips":{ + "pageNumber":"", + "pageSize":"", + "status":"", + "includeLB":"", + "chargeMode":"", + "instanceId":"", + "subnetId":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "apply-elastic-ips":{ "clientToken":"", - "elasticIpId":"", + "elasticIpSpec":{ + "bandwidth":"", + "count":"", + "charge":{ + "chargeMode":"", + "chargeUnit":"", + "chargeDuration":"", + "autoRenew":"", + "buyScenario":"" + }, + "resourceTags":[""] + }, + "regionId":"" + }, + "describe-elastic-ip":{ "regionId":"", - "instanceId":"" + "elasticIpId":"" }, - "disassociate-elastic-ip":{ + "modify-elastic-ip-bandwidth":{ "clientToken":"", - "elasticIpId":"", + "bandwidth":"", "regionId":"", - "instanceId":"" + "elasticIpId":"" }, - "reset-password":{ - "clientToken":"", - "password":"", + "describe-elastic-ip-name":{ "regionId":"", - "instanceId":"" + "elasticIpId":"" }, - "describe-instance-monitor-info":{ - "startTime":"", - "endTime":"", + "describe-server-groups":{ + "pageNumber":"", + "pageSize":"", + "name":"", + "loadBalancerId":"", "filters":[{ "name":"", "operator":"", "values":"" }], + "regionId":"" + }, + "create-server-group":{ + "clientToken":"", + "serverGroupSpec":{ + "loadBalancerId":"", + "name":"" + }, + "regionId":"" + }, + "describe-server-group":{ "regionId":"", - "instanceId":"" + "serverGroupId":"" + }, + "modify-server-group":{ + "name":"", + "regionId":"", + "serverGroupId":"" + }, + "delete-server-group":{ + "regionId":"", + "serverGroupId":"" }, "describe-keypairs":{ "pageNumber":"", @@ -221,11 +222,13 @@ "regionId":"", "keypairId":"" }, - "describe-listeners":{ + "describe-load-balancers":{ "pageNumber":"", "pageSize":"", + "status":"", "name":"", - "loadBalancerId":"", + "vpcId":"", + "bindEip":"", "filters":[{ "name":"", "operator":"", @@ -233,112 +236,46 @@ }], "regionId":"" }, - "create-listener":{ + "create-load-balancer":{ "clientToken":"", - "listenerSpec":{ - "loadBalancerId":"", - "protocol":"", - "port":"", - "algorithm":"", - "stickySession":"", - "realIp":"", + "loadBalancerSpec":{ + "netType":"", + "ipAddressType":"", + "vpcId":"", "name":"", "description":"", - "healthCheck":"", - "healthCheckTimeout":"", - "healthCheckInterval":"", - "healthyThreshold":"", - "unhealthyThreshold":"", - "serverGroupId":"" + "applyElasticIp":"", + "bandwidth":"", + "charge":{ + "chargeMode":"", + "chargeUnit":"", + "chargeDuration":"", + "autoRenew":"", + "buyScenario":"" + }, + "resourceTags":[""] }, "regionId":"" }, - "modify-listener":{ - "algorithm":"", - "stickySession":"", - "realIp":"", + "modify-load-balancer":{ "name":"", "description":"", - "healthCheck":"", - "healthCheckTimeout":"", - "healthCheckInterval":"", - "healthyThreshold":"", - "unhealthyThreshold":"", - "serverGroupId":"", "regionId":"", - "listenerId":"" + "loadBalancerId":"" }, - "describe-listener":{ + "describe-load-balancer":{ "regionId":"", - "listenerId":"" + "loadBalancerId":"" }, - "delete-listener":{ + "start-load-balancer":{ + "clientToken":"", "regionId":"", - "listenerId":"" + "loadBalancerId":"" }, - "start-listener":{ + "stop-load-balancer":{ "clientToken":"", "regionId":"", - "listenerId":"" - }, - "stop-listener":{ - "clientToken":"", - "regionId":"", - "listenerId":"" - }, - "describe-load-balancers":{ - "pageNumber":"", - "pageSize":"", - "status":"", - "name":"", - "vpcId":"", - "bindEip":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, - "create-load-balancer":{ - "clientToken":"", - "loadBalancerSpec":{ - "netType":"", - "ipAddressType":"", - "vpcId":"", - "name":"", - "description":"", - "applyElasticIp":"", - "bandwidth":"", - "charge":{ - "chargeMode":"", - "chargeUnit":"", - "chargeDuration":"", - "autoRenew":"", - "buyScenario":"" - } - }, - "regionId":"" - }, - "modify-load-balancer":{ - "name":"", - "description":"", - "regionId":"", - "loadBalancerId":"" - }, - "describe-load-balancer":{ - "regionId":"", - "loadBalancerId":"" - }, - "start-load-balancer":{ - "clientToken":"", - "regionId":"", - "loadBalancerId":"" - }, - "stop-load-balancer":{ - "clientToken":"", - "regionId":"", - "loadBalancerId":"" + "loadBalancerId":"" }, "associate-elastic-ip-lb":{ "clientToken":"", @@ -352,26 +289,9 @@ "regionId":"", "loadBalancerId":"" }, - "describe-regiones":{ - "networkType":"" - }, - "describe-cpslbregions":{ - }, - "describe-route-table":{ + "describe-slbs-name":{ "regionId":"", - "routeTableId":"" - }, - "describe-route-tables":{ - "pageNumber":"", - "pageSize":"", - "name":"", - "vpcId":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" + "loadBalancerId":"" }, "describe-servers":{ "pageNumber":"", @@ -390,7 +310,10 @@ "serverSpec":[{ "instanceId":"", "port":"", - "weight":"" + "weight":"", + "aliasip":"", + "rip":"", + "networkPort":"" }], "regionId":"", "serverGroupId":"" @@ -406,11 +329,10 @@ "serverGroupId":"", "serverId":"" }, - "describe-server-groups":{ + "describe-ipv6gateways":{ "pageNumber":"", "pageSize":"", - "name":"", - "loadBalancerId":"", + "ipv6GatewayName":"", "filters":[{ "name":"", "operator":"", @@ -418,26 +340,15 @@ }], "regionId":"" }, - "create-server-group":{ - "clientToken":"", - "serverGroupSpec":{ - "loadBalancerId":"", - "name":"" - }, - "regionId":"" - }, - "describe-server-group":{ + "describe-ipv6gateway":{ "regionId":"", - "serverGroupId":"" + "ipv6GatewayId":"" }, - "modify-server-group":{ - "name":"", - "regionId":"", - "serverGroupId":"" - }, - "delete-server-group":{ + "modify-ipv6gateway":{ + "clientToken":"", + "ipv6GatewayName":"", "regionId":"", - "serverGroupId":"" + "ipv6GatewayId":"" }, "describe-basic-subnet":{ "az":"", @@ -462,11 +373,20 @@ "az":"", "vpcId":"", "cidr":"", + "ipv6Cidr":"", "name":"", - "description":"" + "description":"", + "secondaryCidr":"", + "secondaryCidrName":"" }, "regionId":"" }, + "assign-ipv6cidr":{ + "clientToken":"", + "ipv6Cidr":"", + "regionId":"", + "subnetId":"" + }, "describe-subnet":{ "regionId":"", "subnetId":"" @@ -513,8 +433,317 @@ "vpcSpec":{ "cidr":"", "name":"", + "enableIpv6":"", "description":"" }, "regionId":"" }, + "assign-ipv6gateway":{ + "clientToken":"", + "regionId":"", + "vpcId":"" + }, + "describe-listeners":{ + "pageNumber":"", + "pageSize":"", + "name":"", + "loadBalancerId":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-listener":{ + "clientToken":"", + "listenerSpec":{ + "loadBalancerId":"", + "protocol":"", + "port":"", + "algorithm":"", + "stickySession":"", + "realIp":"", + "name":"", + "description":"", + "healthCheck":"", + "healthCheckTimeout":"", + "healthCheckInterval":"", + "healthyThreshold":"", + "unhealthyThreshold":"", + "serverGroupId":"", + "stickySessionTimeout":"", + "cookieType":"", + "healthCheckUri":"", + "healthCheckHttpCode":"", + "certificateId":"", + "headers":"" + }, + "regionId":"" + }, + "modify-listener":{ + "algorithm":"", + "stickySession":"", + "realIp":"", + "name":"", + "description":"", + "healthCheck":"", + "healthCheckTimeout":"", + "healthCheckInterval":"", + "healthyThreshold":"", + "unhealthyThreshold":"", + "serverGroupId":"", + "stickySessionTimeout":"", + "cookieType":"", + "healthCheckUri":"", + "healthCheckHttpCode":"", + "certificateId":"", + "headers":[""], + "regionId":"", + "listenerId":"" + }, + "describe-listener":{ + "regionId":"", + "listenerId":"" + }, + "delete-listener":{ + "regionId":"", + "listenerId":"" + }, + "start-listener":{ + "clientToken":"", + "regionId":"", + "listenerId":"" + }, + "stop-listener":{ + "clientToken":"", + "regionId":"", + "listenerId":"" + }, + "describe-device-types":{ + "az":"", + "regionId":"" + }, + "describe-os":{ + "deviceType":"", + "osType":"", + "regionId":"" + }, + "describe-device-raids":{ + "deviceType":"", + "volumeType":"", + "regionId":"" + }, + "describe-instance":{ + "regionId":"", + "instanceId":"" + }, + "describe-instances":{ + "pageNumber":"", + "pageSize":"", + "az":"", + "name":"", + "networkType":"", + "deviceType":"", + "subnetId":"", + "keypairId":"", + "enableInternet":"", + "privateIp":"", + "interfaceMode":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-instances":{ + "clientToken":"", + "instanceSpec":{ + "az":"", + "deviceType":"", + "hostname":"", + "imageType":"", + "osTypeId":"", + "sysRaidTypeId":"", + "dataRaidTypeId":"", + "subnetId":"", + "enableInternet":"", + "internetChargeMode":"", + "enableIpv6":"", + "ipv6Address":"", + "networkType":"", + "cidr":"", + "privateIp":"", + "aliasIps":[""], + "lineType":"", + "bandwidth":"", + "name":"", + "description":"", + "password":"", + "count":"", + "userData":"", + "keypairId":"", + "charge":{ + "chargeMode":"", + "chargeUnit":"", + "chargeDuration":"", + "autoRenew":"", + "buyScenario":"" + }, + "interfaceMode":"", + "extensionEnableIpv6":"", + "extensionIpv6Address":"", + "extensionSubnetId":"", + "extensionPrivateIp":"", + "extensionAliasIps":[""], + "extensionEnableInternet":"", + "extensionLineType":"", + "extensionBandwidth":"", + "extensionInternetChargeMode":"", + "resourceTags":[""] + }, + "regionId":"" + }, + "describe-instance-name":{ + "regionId":"", + "instanceId":"" + }, + "assign-ipv6address":{ + "clientToken":"", + "ipv6Address":"", + "subnetId":"", + "regionId":"", + "instanceId":"" + }, + "modify-instance":{ + "name":"", + "description":"", + "regionId":"", + "instanceId":"" + }, + "describe-instance-raid":{ + "regionId":"", + "instanceId":"" + }, + "describe-instance-status":{ + "regionId":"", + "instanceId":"" + }, + "restart-instance":{ + "clientToken":"", + "regionId":"", + "instanceId":"" + }, + "stop-instance":{ + "clientToken":"", + "regionId":"", + "instanceId":"" + }, + "start-instance":{ + "clientToken":"", + "regionId":"", + "instanceId":"" + }, + "restart-instances":{ + "clientToken":"", + "instanceIds":[""], + "regionId":"" + }, + "stop-instances":{ + "clientToken":"", + "instanceIds":[""], + "regionId":"" + }, + "start-instances":{ + "clientToken":"", + "instanceIds":[""], + "regionId":"" + }, + "reinstall-instance":{ + "clientToken":"", + "instanceSpec":{ + "az":"", + "imageType":"", + "osTypeId":"", + "sysRaidTypeId":"", + "keepData":"", + "dataRaidTypeId":"", + "password":"", + "hostname":"", + "userData":"", + "keypairId":"" + }, + "regionId":"", + "instanceId":"" + }, + "modify-bandwidth":{ + "clientToken":"", + "bandwidth":"", + "regionId":"", + "instanceId":"" + }, + "associate-elastic-ip":{ + "clientToken":"", + "elasticIpId":"", + "targetIp":"", + "subnetId":"", + "regionId":"", + "instanceId":"" + }, + "disassociate-elastic-ip":{ + "clientToken":"", + "elasticIpId":"", + "regionId":"", + "instanceId":"" + }, + "reset-password":{ + "clientToken":"", + "password":"", + "regionId":"", + "instanceId":"" + }, + "describe-available-private-ip":{ + "subnetId":"", + "regionId":"", + "instanceId":"" + }, + "describe-instance-monitor-info":{ + "startTime":"", + "endTime":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"", + "instanceId":"" + }, + "describe-event-logs":{ + "pageNumber":"", + "pageSize":"", + "regionId":"", + "instanceId":"" + }, + "describe-route-table":{ + "regionId":"", + "routeTableId":"" + }, + "describe-route-tables":{ + "pageNumber":"", + "pageSize":"", + "name":"", + "vpcId":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "describe-regiones":{ + "networkType":"" + }, + "describe-cpslbregions":{ + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/cr.json b/jdcloud_cli/resources/skeletons/cr.json deleted file mode 100644 index ca84ae1..0000000 --- a/jdcloud_cli/resources/skeletons/cr.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "get-authorization-token":{ - "expiredAfterHours":"", - "regionId":"", - "registryName":"" - }, - "describe-authorization-tokens":{ - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "pageNumber":"", - "pageSize":"", - "regionId":"", - "registryName":"" - }, - "release-authorization-token":{ - "authorizationToken":"", - "forceAll":"", - "regionId":"", - "registryName":"" - }, - "describe-images":{ - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "pageNumber":"", - "pageSize":"", - "regionId":"" - }, - "delete-image":{ - "imageDigest":"", - "imageTag":"", - "imageTagStatus":"", - "regionId":"", - "registryName":"", - "repositoryName":"" - }, - "describe-quotas":{ - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, - "describe-registries":{ - "regionId":"" - }, - "create-registry":{ - "registryName":"", - "description":"", - "regionId":"" - }, - "describe-registry":{ - "regionId":"", - "registryName":"" - }, - "delete-registry":{ - "regionId":"", - "registryName":"" - }, - "check-registry-name":{ - "registryName":"", - "regionId":"" - }, - "create-repository":{ - "repositoryName":"", - "description":"", - "regionId":"", - "registryName":"" - }, - "describe-repositories":{ - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "pageNumber":"", - "pageSize":"", - "regionId":"" - }, - "delete-repository":{ - "regionId":"", - "registryName":"", - "repositoryName":"" - }, - "check-repository-name":{ - "registryName":"", - "repositoryName":"", - "regionId":"" - }, -} \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/deploy.json b/jdcloud_cli/resources/skeletons/deploy.json index 3c01265..c4ac296 100644 --- a/jdcloud_cli/resources/skeletons/deploy.json +++ b/jdcloud_cli/resources/skeletons/deploy.json @@ -13,6 +13,20 @@ "regionId":"", "appId":"" }, + "describe-groups":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "describe-group":{ + "regionId":"", + "groupId":"" + }, "create-deploy":{ "groupId":"", "desc":"", @@ -34,18 +48,4 @@ "regionId":"", "deployId":"" }, - "describe-groups":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, - "describe-group":{ - "regionId":"", - "groupId":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/detection.json b/jdcloud_cli/resources/skeletons/detection.json index 6e1725e..4dd6723 100644 --- a/jdcloud_cli/resources/skeletons/detection.json +++ b/jdcloud_cli/resources/skeletons/detection.json @@ -1,90 +1,4 @@ { - "describe-agent-status":{ - "filters":[{ - "Name":"", - "Values":"" - }] - }, - "describe-metric-data-am":{ - "resourceId":"", - "startTime":"", - "endTime":"", - "timeInterval":"" - }, - "create-probe-task":{ - "clientToken":"", - "createProbeTaskSpec":{ - "address":"", - "httpBody":"", - "httpCookie":[""], - "httpHeader":[""], - "httpType":"", - "name":"", - "port":"", - "probeType":"", - "probes":[""], - "targetId":"", - "targetRegion":"", - "taskType":"" - } - }, - "delete-probe-task":{ - "probeTaskIDs":"" - }, - "describe-probe-task":{ - "probeTaskID":"" - }, - "update-probe-task":{ - "httpBody":"", - "httpCookie":[{ - "key":"", - "value":"" - }], - "httpHeader":[{ - "key":"", - "value":"" - }], - "httpType":"", - "name":"", - "probes":[{ - "privateIp":"", - "publicIp":"", - "region":"", - "uuid":"" - }], - "probeTaskID":"" - }, - "describe-probe-history":{ - "startTime":"", - "endTime":"", - "probeTaskID":"", - "probeID":"" - }, - "discribe-probes":{ - "filters":[{ - "Name":"", - "Values":"" - }], - "probeTaskID":"" - }, - "probe-task-enable":{ - "enabled":"", - "taskId":[""] - }, - "describe-probe-tasks":{ - "pageNumber":"", - "pageSize":"", - "name":"", - "type":"", - "timeInterval":"", - "withStats":"", - "withDeleted":"", - "enabled":"", - "filters":[{ - "Name":"", - "Values":"" - }] - }, "get-site-monitor":{ "nameOrAddr":"", "name":"", @@ -344,4 +258,90 @@ }, "updatedTime":"" }, + "describe-agent-status":{ + "filters":[{ + "Name":"", + "Values":"" + }] + }, + "describe-metric-data-am":{ + "resourceId":"", + "startTime":"", + "endTime":"", + "timeInterval":"" + }, + "create-probe-task":{ + "clientToken":"", + "createProbeTaskSpec":{ + "address":"", + "httpBody":"", + "httpCookie":[""], + "httpHeader":[""], + "httpType":"", + "name":"", + "port":"", + "probeType":"", + "probes":[""], + "targetId":"", + "targetRegion":"", + "taskType":"" + } + }, + "delete-probe-task":{ + "probeTaskIDs":"" + }, + "describe-probe-task":{ + "probeTaskID":"" + }, + "update-probe-task":{ + "httpBody":"", + "httpCookie":[{ + "key":"", + "value":"" + }], + "httpHeader":[{ + "key":"", + "value":"" + }], + "httpType":"", + "name":"", + "probes":[{ + "privateIp":"", + "publicIp":"", + "region":"", + "uuid":"" + }], + "probeTaskID":"" + }, + "describe-probe-history":{ + "startTime":"", + "endTime":"", + "probeTaskID":"", + "probeID":"" + }, + "discribe-probes":{ + "filters":[{ + "Name":"", + "Values":"" + }], + "probeTaskID":"" + }, + "probe-task-enable":{ + "enabled":"", + "taskId":[""] + }, + "describe-probe-tasks":{ + "pageNumber":"", + "pageSize":"", + "name":"", + "type":"", + "timeInterval":"", + "withStats":"", + "withDeleted":"", + "enabled":"", + "filters":[{ + "Name":"", + "Values":"" + }] + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/disk.json b/jdcloud_cli/resources/skeletons/disk.json index a1d066d..2e37d45 100644 --- a/jdcloud_cli/resources/skeletons/disk.json +++ b/jdcloud_cli/resources/skeletons/disk.json @@ -22,6 +22,7 @@ "diskSizeGB":"", "iops":"", "snapshotId":"", + "policyId":"", "charge":{ "chargeMode":"", "chargeUnit":"", @@ -65,6 +66,22 @@ "regionId":"", "diskId":"" }, + "describe-volumes-ignore-service-code":{ + "pageNumber":"", + "pageSize":"", + "tags":[{ + "key":"", + "values":"" + }], + "filterGroups":[{ + "filters":[""] + }], + "regionId":"" + }, + "describe-quota":{ + "type":"", + "regionId":"" + }, "describe-snapshots":{ "pageNumber":"", "pageSize":"", @@ -96,6 +113,7 @@ "modify-snapshot-attribute":{ "name":"", "description":"", + "expireTime":"", "regionId":"", "snapshotId":"" }, @@ -103,4 +121,89 @@ "regionId":"", "snapshotId":"" }, + "describe-snapshots-capacity":{ + "regionId":"" + }, + "describe-snapshot-chain":{ + "diskId":"", + "snapshotId":"", + "regionId":"" + }, + "describe-soldout":{ + "regionId":"" + }, + "create-snapshot-policy":{ + "name":"", + "interval":"", + "effectiveTime":"", + "snapshotLifecycle":"", + "contactInfo":{ + "sms":"", + "email":"", + "personIds":"", + "groupIds":"" + }, + "status":"", + "regionId":"" + }, + "update-snapshot-policy":{ + "name":"", + "interval":"", + "effectiveTime":"", + "snapshotLifecycle":"", + "contactInfo":{ + "sms":"", + "email":"", + "personIds":"", + "groupIds":"" + }, + "status":"", + "regionId":"", + "policyId":"" + }, + "delete-snapshot-policy":{ + "regionId":"", + "policyId":"" + }, + "describe-snapshot-policies":{ + "name":"", + "policyId":[""], + "status":[""], + "order":{ + "name":"", + "direction":"" + }, + "pageNumber":"", + "pageSize":"", + "regionId":"" + }, + "describe-snap-polices":{ + "filterGroups":[{ + "filters":[""] + }], + "order":{ + "name":"", + "direction":"" + }, + "pageNumber":"", + "pageSize":"", + "regionId":"" + }, + "apply-snapshot-policies":{ + "relations":[{ + "diskId":"", + "diskRegion":"", + "policyId":"", + "op":"" + }], + "regionId":"" + }, + "describe-snapshot-policy-disk-relations":{ + "diskId":[""], + "diskRegion":[""], + "policyId":[""], + "pageNumber":"", + "pageSize":"", + "regionId":"" + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/domainservice.json b/jdcloud_cli/resources/skeletons/domainservice.json index 92b639f..614ab85 100644 --- a/jdcloud_cli/resources/skeletons/domainservice.json +++ b/jdcloud_cli/resources/skeletons/domainservice.json @@ -1,54 +1,4 @@ { - "describe-action-log":{ - "pageNumber":"", - "pageSize":"", - "startTime":"", - "endTime":"", - "keyWord":"", - "success":"", - "type":"", - "regionId":"" - }, - "describe-domains":{ - "pageNumber":"", - "pageSize":"", - "domainName":"", - "domainId":"", - "regionId":"" - }, - "create-domain":{ - "packId":"", - "domainName":"", - "domainId":"", - "buyType":"", - "timeSpan":"", - "timeUnit":"", - "billingType":"", - "regionId":"" - }, - "modify-domain":{ - "domainName":"", - "regionId":"", - "domainId":"" - }, - "delete-domain":{ - "regionId":"", - "domainId":"" - }, - "describe-domain-query-count":{ - "domainName":"", - "start":"", - "end":"", - "regionId":"", - "domainId":"" - }, - "describe-domain-query-traffic":{ - "domainName":"", - "start":"", - "end":"", - "regionId":"", - "domainId":"" - }, "describe-resource-record":{ "pageNumber":"", "pageSize":"", @@ -122,6 +72,56 @@ "regionId":"", "domainId":"" }, + "describe-domains":{ + "pageNumber":"", + "pageSize":"", + "domainName":"", + "domainId":"", + "regionId":"" + }, + "create-domain":{ + "packId":"", + "domainName":"", + "domainId":"", + "buyType":"", + "timeSpan":"", + "timeUnit":"", + "billingType":"", + "regionId":"" + }, + "modify-domain":{ + "domainName":"", + "regionId":"", + "domainId":"" + }, + "delete-domain":{ + "regionId":"", + "domainId":"" + }, + "describe-domain-query-count":{ + "domainName":"", + "start":"", + "end":"", + "regionId":"", + "domainId":"" + }, + "describe-domain-query-traffic":{ + "domainName":"", + "start":"", + "end":"", + "regionId":"", + "domainId":"" + }, + "describe-action-log":{ + "pageNumber":"", + "pageSize":"", + "startTime":"", + "endTime":"", + "keyWord":"", + "success":"", + "type":"", + "regionId":"" + }, "describe-user-view":{ "viewId":"", "viewName":"", diff --git a/jdcloud_cli/resources/skeletons/elite.json b/jdcloud_cli/resources/skeletons/elite.json index 68743dc..9d20e5a 100644 --- a/jdcloud_cli/resources/skeletons/elite.json +++ b/jdcloud_cli/resources/skeletons/elite.json @@ -3,31 +3,10 @@ "orderNumber":"", "regionId":"" }, - "jdx-report-order":{ - "reportOrderInfo":{ - "orderNumber":"", - "distributorAccount":"", - "distributorName":"", - "extraInfo":"" - }, - "regionId":"" - }, - "jdx-create-order":{ - "createOrderInfo":{ - "productId":"", - "skuId":"", - "buyNum":"", - "remark":"", - "cartExtraChargeVos":[""] - }, - "regionId":"" - }, - "jdx-query-price":{ - "queryPriceParam":{ - "cmd":"", - "packageCount":"", - "orderList":[""] - }, + "get-store-service":{ + "buyerPin":"", + "businessData":"", + "queryAll":"", "regionId":"" }, "jdx-query-product":{ @@ -55,10 +34,31 @@ }, "regionId":"" }, - "get-store-service":{ - "buyerPin":"", - "businessData":"", - "queryAll":"", + "jdx-report-order":{ + "reportOrderInfo":{ + "orderNumber":"", + "distributorAccount":"", + "distributorName":"", + "extraInfo":"" + }, + "regionId":"" + }, + "jdx-create-order":{ + "createOrderInfo":{ + "productId":"", + "skuId":"", + "buyNum":"", + "remark":"", + "cartExtraChargeVos":[""] + }, + "regionId":"" + }, + "jdx-query-price":{ + "queryPriceParam":{ + "cmd":"", + "packageCount":"", + "orderList":[""] + }, "regionId":"" }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/function.json b/jdcloud_cli/resources/skeletons/function.json index 692dadd..c21a6e4 100644 --- a/jdcloud_cli/resources/skeletons/function.json +++ b/jdcloud_cli/resources/skeletons/function.json @@ -1,32 +1,4 @@ { - "list-alias":{ - "regionId":"", - "functionName":"" - }, - "create-alias":{ - "aliasName":"", - "description":"", - "version":"", - "regionId":"", - "functionName":"" - }, - "get-alias":{ - "regionId":"", - "functionName":"", - "aliasName":"" - }, - "update-alias":{ - "description":"", - "version":"", - "regionId":"", - "functionName":"", - "aliasName":"" - }, - "delete-alias":{ - "regionId":"", - "functionName":"", - "aliasName":"" - }, "list-function":{ "listAll":"", "pageNumber":"", @@ -104,12 +76,6 @@ "functionName":"", "versionName":"" }, - "get-trigger":{ - "triggerId":"", - "regionId":"", - "functionName":"", - "versionName":"" - }, "list-version":{ "regionId":"", "functionName":"" @@ -129,4 +95,38 @@ "functionName":"", "versionName":"" }, + "list-alias":{ + "regionId":"", + "functionName":"" + }, + "create-alias":{ + "aliasName":"", + "description":"", + "version":"", + "regionId":"", + "functionName":"" + }, + "get-alias":{ + "regionId":"", + "functionName":"", + "aliasName":"" + }, + "update-alias":{ + "description":"", + "version":"", + "regionId":"", + "functionName":"", + "aliasName":"" + }, + "delete-alias":{ + "regionId":"", + "functionName":"", + "aliasName":"" + }, + "get-trigger":{ + "triggerId":"", + "regionId":"", + "functionName":"", + "versionName":"" + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/iam.json b/jdcloud_cli/resources/skeletons/iam.json index 02be746..3ff0814 100644 --- a/jdcloud_cli/resources/skeletons/iam.json +++ b/jdcloud_cli/resources/skeletons/iam.json @@ -1,63 +1,50 @@ { - "enable-sub-user-access-key":{ - "subUser":"", - "accessKey":"" - }, - "disable-sub-user-access-key":{ - "subUser":"", - "accessKey":"" - }, - "delete-sub-user-access-key":{ - "subUser":"", - "accessKey":"" - }, - "create-group":{ - "createGroupInfo":{ + "create-sub-user":{ + "createSubUserInfo":{ "name":"", - "description":"" + "description":"", + "password":"", + "phone":"", + "email":"", + "createAk":"", + "needResetPassword":"", + "consoleLogin":"", + "autoGeneratePassword":"" } }, - "describe-group":{ - "groupName":"" + "describe-sub-user":{ + "subUser":"" }, - "update-group":{ - "updateGroupInfo":{ - "description":"" + "update-sub-user":{ + "updateSubUserInfo":{ + "description":"", + "phone":"", + "email":"" }, - "groupName":"" - }, - "delete-group":{ - "groupName":"" + "subUser":"" }, - "describe-group-sub-users":{ - "pageNumber":"", - "pageSize":"", - "groupName":"" + "delete-sub-user":{ + "subUser":"" }, - "describe-groups":{ + "describe-sub-users":{ "pageNumber":"", "pageSize":"", "keyword":"", "sort":"" }, - "describe-attached-group-policies":{ - "groupName":"" + "describe-sub-user-groups":{ + "subUser":"" }, - "detach-group-policy":{ - "policyName":"", - "groupName":"" + "describe-attached-sub-user-policies":{ + "subUser":"" }, - "attach-group-policy":{ + "detach-sub-user-policy":{ "policyName":"", - "groupName":"" - }, - "remove-sub-user-from-group":{ - "subUser":"", - "groupName":"" + "subUser":"" }, - "add-sub-user-to-group":{ - "subUser":"", - "groupName":"" + "attach-sub-user-policy":{ + "policyName":"", + "subUser":"" }, "create-permission":{ "createPermissionInfo":{ @@ -105,6 +92,18 @@ "permissionId":"", "subUser":"" }, + "enable-sub-user-access-key":{ + "subUser":"", + "accessKey":"" + }, + "disable-sub-user-access-key":{ + "subUser":"", + "accessKey":"" + }, + "delete-sub-user-access-key":{ + "subUser":"", + "accessKey":"" + }, "create-policy":{ "createPolicyInfo":{ "name":"", @@ -137,6 +136,54 @@ "queryType":"", "sort":"" }, + "create-group":{ + "createGroupInfo":{ + "name":"", + "description":"" + } + }, + "describe-group":{ + "groupName":"" + }, + "update-group":{ + "updateGroupInfo":{ + "description":"" + }, + "groupName":"" + }, + "delete-group":{ + "groupName":"" + }, + "describe-group-sub-users":{ + "pageNumber":"", + "pageSize":"", + "groupName":"" + }, + "describe-groups":{ + "pageNumber":"", + "pageSize":"", + "keyword":"", + "sort":"" + }, + "describe-attached-group-policies":{ + "groupName":"" + }, + "detach-group-policy":{ + "policyName":"", + "groupName":"" + }, + "attach-group-policy":{ + "policyName":"", + "groupName":"" + }, + "remove-sub-user-from-group":{ + "subUser":"", + "groupName":"" + }, + "add-sub-user-to-group":{ + "subUser":"", + "groupName":"" + }, "create-role":{ "createRoleInfo":{ "roleName":"", @@ -180,53 +227,6 @@ "sort":"", "roleName":"" }, - "create-sub-user":{ - "createSubUserInfo":{ - "name":"", - "description":"", - "password":"", - "phone":"", - "email":"", - "createAk":"", - "needResetPassword":"", - "consoleLogin":"", - "autoGeneratePassword":"" - } - }, - "describe-sub-user":{ - "subUser":"" - }, - "update-sub-user":{ - "updateSubUserInfo":{ - "description":"", - "phone":"", - "email":"" - }, - "subUser":"" - }, - "delete-sub-user":{ - "subUser":"" - }, - "describe-sub-users":{ - "pageNumber":"", - "pageSize":"", - "keyword":"", - "sort":"" - }, - "describe-sub-user-groups":{ - "subUser":"" - }, - "describe-attached-sub-user-policies":{ - "subUser":"" - }, - "detach-sub-user-policy":{ - "policyName":"", - "subUser":"" - }, - "attach-sub-user-policy":{ - "policyName":"", - "subUser":"" - }, "describe-user-access-keys":{ "regionId":"" }, diff --git a/jdcloud_cli/resources/skeletons/iotcard.json b/jdcloud_cli/resources/skeletons/iotcard.json deleted file mode 100644 index 38a6e2d..0000000 --- a/jdcloud_cli/resources/skeletons/iotcard.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "gprs-status":{ - "iccid":"", - "regionId":"" - }, - "on-off-status":{ - "iccid":"", - "regionId":"" - }, - "life-status":{ - "iccid":"", - "regionId":"" - }, - "gprs-realtime-info":{ - "iccid":"", - "regionId":"" - }, - "open-iot-card":{ - "iccids":[""], - "regionId":"" - }, - "close-iot-card":{ - "iccids":[""], - "regionId":"" - }, - "open-iot-flow":{ - "iccids":[""], - "regionId":"" - }, - "close-iot-flow":{ - "iccids":[""], - "regionId":"" - }, -} \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/iotcore.json b/jdcloud_cli/resources/skeletons/iotcore.json index c763379..f923168 100644 --- a/jdcloud_cli/resources/skeletons/iotcore.json +++ b/jdcloud_cli/resources/skeletons/iotcore.json @@ -1,119 +1,26 @@ { - "device-query":{ - "deviceId":"", - "regionId":"", - "instanceId":"" - }, - "thing-type-list":{ - "deviceMetaId":"", - "deviceMetaName":"", - "nodeType":"", - "pageNo":"", + "list-product-abilities":{ + "pageNumber":"", "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], "regionId":"", - "instanceId":"" - }, - "thing-type-describe":{ - "deviceMetaId":"", - "regionId":"", - "instanceId":"" - }, - "describe-thing-model":{ - "thingModelId":"", - "thingModelVersion":"", - "regionId":"", - "instanceId":"" - }, - "device-register":{ - "deviceInfoVO":{ - "activateTime":"", - "connectAgentDeviceId":"", - "createTime":"", - "customProfiles":[""], - "deviceId":"", - "deviceName":"", - "deviceTagList":[""], - "globalProfiles":{ - "dataType":"", - "editable":"", - "mandatory":"", - "profileCode":"", - "profileDesc":"", - "profileName":"", - "profileValue":"", - "scope":"" - }, - "lastConnectTime":"", - "lastDisconnectTime":"", - "latitude":"", - "longitude":"", - "macAddress":"", - "manufactureId":"", - "manufactureName":"", - "nodeType":"", - "lastReportTime":"", - "status":"", - "thingModelId":"", - "thingModelVersion":"", - "thingTypeCode":"", - "thingTypeName":"", - "uniqueId":"", - "updateTime":"" - }, - "regionId":"", - "instanceId":"" - }, - "download-certificate":{ - "deviceId":"", - "regionId":"", - "instanceId":"" - }, - "delete-device":{ - "deviceId":"", - "regionId":"", - "instanceId":"" - }, - "device-property-set":{ - "devicePropertyVO":{ - "cmd":"", - "deviceId":"", - "thingTypeName":"", - "deviceName":"", - "version":"" - }, - "regionId":"", - "instanceId":"" - }, - "invoke-function":{ - "deviceFunctionVO":{ - "deviceId":"", - "inParams":"", - "functionName":"" - }, - "regionId":"", - "instanceId":"" + "instanceId":"", + "productKey":"" }, - "event-list":{ - "eventReportPageBo":{ - "deviceId":"", - "order":"", - "orders":"", - "pageNo":"", - "pageSize":"" - }, + "import-thing-model":{ + "thingModel":"", "regionId":"", - "instanceId":"" + "instanceId":"", + "productKey":"" }, - "function-list":{ - "functionCallPageBo":{ - "deviceId":"", - "order":"", - "orders":"", - "pageNo":"", - "pageSize":"" - }, + "export-thing-model":{ "regionId":"", - "instanceId":"" + "instanceId":"", + "productKey":"" }, "invoke-thing-topic":{ "topicShortName":"", @@ -140,7 +47,6 @@ "invoke-thing-service":{ "name":"", "input":"", - "callbackBeanName":"", "instanceId":"", "regionId":"", "identifier":"", @@ -198,30 +104,41 @@ "regionId":"", "productKey":"" }, - "elevator-operating-status":{ - "identifier":"", - "instanceId":"", - "regionId":"" + "list-products":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"", + "instanceId":"" }, - "collector-read-message":{ - "identifier":"", - "protocol":"", + "create-product":{ + "productName":"", + "productType":"", + "productDescription":"", + "regionId":"", + "instanceId":"" + }, + "describe-product":{ + "regionId":"", "instanceId":"", - "regionId":"" + "productKey":"" }, - "read-holding-registers":{ - "identifier":"", - "addressOfFirstRegister":"", - "numberOfRegisters":"", + "update-product":{ + "productName":"", + "productDescription":"", + "dynamicRegister":"", + "regionId":"", "instanceId":"", - "regionId":"" + "productKey":"" }, - "collector-write-message":{ - "identifier":"", - "protocol":"", - "data":"", + "delete-product":{ + "regionId":"", "instanceId":"", - "regionId":"" + "productKey":"" }, "update-loo-device":{ "model":"", @@ -230,7 +147,6 @@ "status":"", "identifier":"", "deviceName":"", - "deviceType":"", "instanceId":"", "regionId":"", "deviceId":"" @@ -243,13 +159,14 @@ "manufacturer":"", "identifier":"", "description":"", - "deviceType":"", "instanceId":"", "regionId":"", "preOrderId":"" }, "loongray-query-page":{ "deviceName":"", + "manufacturer":"", + "model":"", "status":"", "productKey":"", "deviceType":"", @@ -260,6 +177,15 @@ "parentId":"", "orderId":"", "deviceCollectorType":"", + "queryUserPin":"", + "instanceId":"", + "regionId":"" + }, + "query-admin-statistics":{ + "productKey":"", + "parentId":"", + "deviceCollectorType":"", + "queryUserPin":"", "instanceId":"", "regionId":"" }, @@ -269,70 +195,178 @@ "regionId":"", "productKey":"" }, - "describe-product-with-admin":{ + "register-device":{ + "deviceInfoVO":{ + "activateTime":"", + "connectAgentDeviceId":"", + "createTime":"", + "customProfiles":[""], + "deviceId":"", + "deviceName":"", + "deviceTagList":[""], + "globalProfiles":[""], + "lastConnectTime":"", + "lastDisconnectTime":"", + "latitude":"", + "longitude":"", + "macAddress":"", + "manufactureId":"", + "manufactureName":"", + "nodeType":"", + "lastReportTime":"", + "status":"", + "thingModelId":"", + "thingModelVersion":"", + "thingTypeCode":"", + "thingTypeName":"", + "uniqueId":"", + "updateTime":"" + }, "regionId":"", - "instanceId":"", - "productKey":"" + "instanceId":"" }, - "update-product-with-admin":{ - "productName":"", - "productDescription":"", - "dynamicRegister":"", + "download-device-certificate":{ + "deviceId":"", "regionId":"", - "instanceId":"", - "productKey":"" + "instanceId":"" }, - "delete-product-with-admin":{ + "delete-device":{ + "deviceId":"", "regionId":"", - "instanceId":"", - "productKey":"" + "instanceId":"" }, - "list-products-with-admin":{ - "pageNumber":"", + "describe-device":{ + "deviceId":"", + "regionId":"", + "instanceId":"" + }, + "describe-thing-type-list":{ + "deviceMetaId":"", + "deviceMetaName":"", + "nodeType":"", + "pageNo":"", "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], "regionId":"", "instanceId":"" }, - "create-admin-product":{ - "productName":"", - "productType":"", - "productDescription":"", - "templateId":"", - "internalTags":"", + "describe-thing-type":{ + "deviceMetaId":"", "regionId":"", "instanceId":"" }, - "list-products":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], + "describe-thing-model":{ + "thingTypeCode":"", + "thingModelVersion":"", "regionId":"", "instanceId":"" }, - "create-product":{ - "productName":"", - "productType":"", - "productDescription":"", - "templateId":"", - "internalTags":"", + "set-device-property":{ + "devicePropertyVO":{ + "cmd":"", + "deviceId":"", + "thingTypeName":"", + "deviceName":"", + "version":"" + }, "regionId":"", "instanceId":"" }, - "describe-product":{ + "invoke-function":{ + "deviceFunctionVO":{ + "deviceId":"", + "functionKey":"", + "inParams":"", + "outParams":"" + }, + "regionId":"", + "instanceId":"" + }, + "describe-event-list":{ + "eventReportPageBo":{ + "deviceId":"", + "order":"", + "orders":"", + "pageNo":"", + "pageSize":"" + }, + "regionId":"", + "instanceId":"" + }, + "describe-function-list":{ + "functionCallPageBo":{ + "deviceId":"", + "order":"", + "orders":"", + "pageNo":"", + "pageSize":"" + }, + "regionId":"", + "instanceId":"" + }, + "describe-property":{ + "deviceId":"", + "regionId":"", + "instanceId":"" + }, + "describe-property-snapshot":{ + "deviceSnapshotRequestVO":{ + "deviceId":"", + "params":"", + "deviceName":"", + "thingTypeName":"" + }, + "regionId":"", + "instanceId":"" + }, + "create-device-topo":{ + "deviceTopoInfoVO":{ + "deviceId":"", + "deviceName":"", + "thingTypeName":"", + "subDevices":[""] + }, + "regionId":"", + "instanceId":"" + }, + "describe-device-topo":{ + "deviceTopoPageBO":{ + "deviceId":"", + "subDeviceId":"", + "subDeviceName":"", + "order":"", + "orders":"", + "pageNo":"", + "pageSize":"" + }, + "regionId":"", + "instanceId":"" + }, + "update-device-topo":{ + "deviceTopoInfoVO":{ + "deviceId":"", + "deviceName":"", + "thingTypeName":"", + "subDevices":[""] + }, + "regionId":"", + "instanceId":"" + }, + "delete-device-topo":{ + "deviceTopoInfoVO":{ + "deviceId":"", + "deviceName":"", + "thingTypeName":"", + "subDevices":[""] + }, + "regionId":"", + "instanceId":"" + }, + "describe-product-with-admin":{ "regionId":"", "instanceId":"", "productKey":"" }, - "update-product":{ + "update-product-with-admin":{ "productName":"", "productDescription":"", "dynamicRegister":"", @@ -340,12 +374,12 @@ "instanceId":"", "productKey":"" }, - "delete-product":{ + "delete-product-with-admin":{ "regionId":"", "instanceId":"", "productKey":"" }, - "list-product-abilities":{ + "list-products-with-admin":{ "pageNumber":"", "pageSize":"", "filters":[{ @@ -354,19 +388,15 @@ "values":"" }], "regionId":"", - "instanceId":"", - "productKey":"" - }, - "import-thing-model":{ - "thingModel":"", - "regionId":"", - "instanceId":"", - "productKey":"" + "instanceId":"" }, - "export-thing-model":{ + "create-admin-product":{ + "productName":"", + "productType":"", + "productDescription":"", + "collDeviceType":"", "regionId":"", - "instanceId":"", - "productKey":"" + "instanceId":"" }, "describe-product-topics":{ "pageNumber":"", @@ -394,4 +424,62 @@ "productKey":"", "topicId":"" }, + "get-device-group":{ + "groupName":"", + "queryUserPin":"", + "tag":"", + "pageNumber":"", + "pageSize":"", + "instanceId":"", + "regionId":"" + }, + "get-device-group-list":{ + "queryUserPin":"", + "instanceId":"", + "regionId":"" + }, + "find-device-group-link-page":{ + "productKey":"", + "deviceName":"", + "deviceCollectorType":"", + "groupName":"", + "userPin":"", + "tag":"", + "groupId":"", + "manufacturer":"", + "model":"", + "orderId":"", + "status":"", + "pageNumber":"", + "pageSize":"", + "order":"", + "direction":"", + "instanceId":"", + "regionId":"" + }, + "elevator-operating-status":{ + "identifier":"", + "instanceId":"", + "regionId":"" + }, + "collector-read-message":{ + "identifier":"", + "protocol":"", + "instanceId":"", + "regionId":"" + }, + "read-holding-registers":{ + "identifier":"", + "addressOfFirstRegister":"", + "numberOfRegisters":"", + "instanceId":"", + "regionId":"" + }, + "collector-write-message":{ + "identifier":"", + "protocol":"", + "data":"", + "instanceId":"", + "regionId":"" + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/iothub.json b/jdcloud_cli/resources/skeletons/iothub.json index 3eb167b..77e5920 100644 --- a/jdcloud_cli/resources/skeletons/iothub.json +++ b/jdcloud_cli/resources/skeletons/iothub.json @@ -1,4 +1,24 @@ { + "list-product-abilities":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"", + "productKey":"" + }, + "import-thing-model":{ + "thingModel":"", + "regionId":"", + "productKey":"" + }, + "export-thing-model":{ + "regionId":"", + "productKey":"" + }, "describe-thing-shadow":{ "regionId":"", "identifier":"", @@ -74,7 +94,6 @@ "productName":"", "productType":"", "productDescription":"", - "templateId":"", "regionId":"" }, "describe-product":{ @@ -92,24 +111,4 @@ "regionId":"", "productKey":"" }, - "list-product-abilities":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"", - "productKey":"" - }, - "import-thing-model":{ - "thingModel":"", - "regionId":"", - "productKey":"" - }, - "export-thing-model":{ - "regionId":"", - "productKey":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/iotlink.json b/jdcloud_cli/resources/skeletons/iotlink.json index 248cd26..e579f59 100644 --- a/jdcloud_cli/resources/skeletons/iotlink.json +++ b/jdcloud_cli/resources/skeletons/iotlink.json @@ -1,4 +1,28 @@ { + "card-info":{ + "iccid":"", + "regionId":"" + }, + "real-name-query-iot":{ + "iccid":"", + "regionId":"" + }, + "gprs-status-by-imsi":{ + "imsi":"", + "regionId":"" + }, + "on-off-status-by-imsi":{ + "imsi":"", + "regionId":"" + }, + "life-status-by-imsi":{ + "imsi":"", + "regionId":"" + }, + "gprs-realtime-info-by-imsi":{ + "imsi":"", + "regionId":"" + }, "gprs-status":{ "iccid":"", "regionId":"" diff --git a/jdcloud_cli/resources/skeletons/ipanti.json b/jdcloud_cli/resources/skeletons/ipanti.json index 91f2f73..8b295e5 100644 --- a/jdcloud_cli/resources/skeletons/ipanti.json +++ b/jdcloud_cli/resources/skeletons/ipanti.json @@ -1,67 +1,13 @@ { - "describe-ddo-sattack-logs":{ - "pageNumber":"", - "pageSize":"", - "startTime":"", - "endTime":"", - "instanceId":[""], - "regionId":"" - }, - "describe-ccattack-logs":{ - "pageNumber":"", - "pageSize":"", - "startTime":"", - "endTime":"", - "instanceId":[""], - "regionId":"" - }, - "describe-ccattack-log-details":{ - "pageNumber":"", - "pageSize":"", - "startTime":"", - "endTime":"", - "instanceId":"", - "subDomain":[""], - "attackId":"", - "regionId":"" - }, - "describe-attack-statistics":{ - "startTime":"", - "endTime":"", - "instanceId":[""], - "type":"", - "regionId":"" - }, - "describe-attack-type-count":{ - "startTime":"", - "endTime":"", - "instanceId":[""], - "regionId":"" - }, - "describe-ddo-sgraph":{ - "startTime":"", - "endTime":"", - "instanceId":[""], - "regionId":"" - }, - "describe-fwd-graph":{ - "startTime":"", - "endTime":"", - "instanceId":[""], - "regionId":"" - }, - "describe-ccgraph":{ - "startTime":"", - "endTime":"", - "instanceId":[""], - "subDomain":[""], - "regionId":"" - }, "describe-forward-rules":{ "pageNumber":"", "pageSize":"", "searchType":"", "searchValue":"", + "sorts":[{ + "name":"", + "direction":"" + }], "regionId":"", "instanceId":"" }, @@ -69,6 +15,7 @@ "forwardRuleSpec":{ "protocol":"", "serviceIp":"", + "serviceIps":"", "port":"", "algorithm":"", "originType":"", @@ -80,6 +27,22 @@ "regionId":"", "instanceId":"" }, + "create-forward-rules":{ + "forwardRuleSpecList":[{ + "protocol":"", + "serviceIp":"", + "serviceIps":"", + "port":"", + "algorithm":"", + "originType":"", + "originAddr":[""], + "onlineAddr":"", + "originDomain":"", + "originPort":"" + }], + "regionId":"", + "instanceId":"" + }, "describe-forward-rule":{ "regionId":"", "instanceId":"", @@ -89,6 +52,7 @@ "forwardRuleSpec":{ "protocol":"", "serviceIp":"", + "serviceIps":"", "port":"", "algorithm":"", "originType":"", @@ -189,6 +153,216 @@ "instanceId":"", "forwardRuleId":"" }, + "describe-ddo-sgraph":{ + "startTime":"", + "endTime":"", + "instanceId":[""], + "serviceIp":[""], + "regionId":"" + }, + "describe-fwd-graph":{ + "startTime":"", + "endTime":"", + "instanceId":[""], + "regionId":"" + }, + "describe-business-graph":{ + "startTime":"", + "endTime":"", + "instanceId":[""], + "serviceIp":[""], + "regionId":"" + }, + "describe-ccgraph":{ + "startTime":"", + "endTime":"", + "instanceId":[""], + "subDomain":[""], + "regionId":"" + }, + "describe-status-graph":{ + "startTime":"", + "endTime":"", + "instanceId":[""], + "subDomain":[""], + "regionId":"" + }, + "describe-conn-stat-graph":{ + "startTime":"", + "endTime":"", + "instanceId":[""], + "serviceIp":[""], + "regionId":"" + }, + "describe-ddo-sattack-logs":{ + "pageNumber":"", + "pageSize":"", + "startTime":"", + "endTime":"", + "instanceId":[""], + "regionId":"" + }, + "describe-ddo-sip-attack-logs":{ + "pageNumber":"", + "pageSize":"", + "startTime":"", + "endTime":"", + "instanceId":[""], + "serviceIp":[""], + "regionId":"" + }, + "describe-ccattack-logs":{ + "pageNumber":"", + "pageSize":"", + "startTime":"", + "endTime":"", + "instanceId":[""], + "regionId":"" + }, + "describe-ccattack-log-details":{ + "pageNumber":"", + "pageSize":"", + "startTime":"", + "endTime":"", + "instanceId":"", + "subDomain":[""], + "attackId":"", + "regionId":"" + }, + "describe-attack-statistics":{ + "startTime":"", + "endTime":"", + "instanceId":[""], + "serviceIp":[""], + "type":"", + "regionId":"" + }, + "describe-attack-type-count":{ + "startTime":"", + "endTime":"", + "instanceId":[""], + "serviceIp":[""], + "regionId":"" + }, + "describe-dispatch-rules":{ + "pageNumber":"", + "pageSize":"", + "name":"", + "innerIp":"", + "serviceIp":"", + "regionId":"", + "instanceId":"" + }, + "create-dispatch-rule":{ + "createDispatchRuleSpec":{ + "name":"", + "serviceIp":"", + "innerIps":"", + "dispatchThresholdMbps":"", + "dispatchThresholdPps":"" + }, + "regionId":"", + "instanceId":"" + }, + "create-dispatch-rules":{ + "dispatchRuleSpecList":[{ + "name":"", + "serviceIp":"", + "innerIps":"", + "dispatchThresholdMbps":"", + "dispatchThresholdPps":"" + }], + "regionId":"", + "instanceId":"" + }, + "modify-dispatch-rule":{ + "modifyDispatchRuleSpec":{ + "name":"", + "serviceIp":"", + "innerIps":"", + "dispatchThresholdMbps":"", + "dispatchThresholdPps":"" + }, + "regionId":"", + "instanceId":"", + "dispatchRuleId":"" + }, + "delete-dispatch-rule":{ + "regionId":"", + "instanceId":"", + "dispatchRuleId":"" + }, + "switch-dispatch-rule-protect":{ + "regionId":"", + "instanceId":"", + "dispatchRuleId":"" + }, + "switch-dispatch-rule-origin":{ + "regionId":"", + "instanceId":"", + "dispatchRuleId":"" + }, + "describe-instance-acl":{ + "regionId":"", + "instanceId":"" + }, + "modify-instance-acl":{ + "instanceAclSpec":{ + "blackListIds":"", + "whiteListIds":"", + "geoBlack":"" + }, + "regionId":"", + "instanceId":"" + }, + "recover-instance-acl":{ + "regionId":"", + "instanceId":"" + }, + "describe-custom-pages":{ + "status":"", + "regionId":"", + "instanceId":"" + }, + "create-custom-page":{ + "customPageSpec":{ + "name":"", + "content":"" + }, + "regionId":"", + "instanceId":"" + }, + "modify-custom-page":{ + "customPageSpec":{ + "name":"", + "content":"" + }, + "regionId":"", + "instanceId":"", + "pageId":"" + }, + "delete-custom-page":{ + "regionId":"", + "instanceId":"", + "pageId":"" + }, + "modify-instance-custom-page":{ + "regionId":"", + "instanceId":"", + "pageId":"" + }, + "modify-instance-custom-page-default":{ + "regionId":"", + "instanceId":"" + }, + "enable-instance-custom-page":{ + "regionId":"", + "instanceId":"" + }, + "disable-instance-custom-page":{ + "regionId":"", + "instanceId":"" + }, "describe-instances":{ "pageNumber":"", "pageSize":"", @@ -212,6 +386,12 @@ "timeUnit":"", "returnUrl":"" }, + "autoRenewalSpec":{ + "autoRenewalEnable":"", + "timeSpan":"", + "timeUnit":"" + }, + "autoPay":"", "regionId":"" }, "describe-instance":{ @@ -245,11 +425,28 @@ "ddosAlarmSmsStatus":"", "ddosAlarmStatus":"", "errorCodeAlarmStatus":"", - "errorCodeDomain":"" + "errorCodeDomain":"", + "errorCode":"", + "errorCodePercent":"", + "errorCodeCount":"" }, "regionId":"", "instanceId":"" }, + "describe-origin-white-ip-list":{ + "regionId":"", + "instanceId":"" + }, + "describe-service-ip-list":{ + "pageNumber":"", + "pageSize":"", + "regionId":"", + "instanceId":"" + }, + "describe-instance-id-by-resource-id":{ + "resourceId":"", + "regionId":"" + }, "describe-name-list":{ "id":"", "name":"", @@ -260,6 +457,9 @@ "describe-protection-statistics":{ "regionId":"" }, + "describe-protection-outline":{ + "regionId":"" + }, "check-name":{ "name":"", "regionId":"" @@ -274,6 +474,11 @@ "pageSize":"", "regionId":"" }, + "describe-ccs-ip-list":{ + "pageNumber":"", + "pageSize":"", + "regionId":"" + }, "describe-ip-sets":{ "pageNumber":"", "pageSize":"", @@ -313,6 +518,7 @@ "create-web-rule":{ "webRuleSpec":{ "serviceIp":"", + "serviceIps":"", "domain":"", "protocol":{ "http":"", @@ -329,11 +535,52 @@ "customPortStatus":"", "httpOrigin":"", "webSocketStatus":"", - "geoRsRoute":[""] + "geoRsRoute":[""], + "enableKeepalive":"", + "httpVersion":"", + "sslProtocols":"", + "suiteLevel":"", + "userSuiteLevel":"", + "enableHealthCheck":"", + "proxyConnectTimeout":"", + "enableUnderscores":"" }, "regionId":"", "instanceId":"" }, + "create-web-rules":{ + "webRuleSpecList":[{ + "serviceIp":"", + "serviceIps":"", + "domain":"", + "protocol":{ + "http":"", + "https":"" + }, + "port":"", + "httpsPort":"", + "originType":"", + "originAddr":[""], + "onlineAddr":"", + "originDomain":"", + "algorithm":"", + "forceJump":"", + "customPortStatus":"", + "httpOrigin":"", + "webSocketStatus":"", + "geoRsRoute":[""], + "enableKeepalive":"", + "httpVersion":"", + "sslProtocols":"", + "suiteLevel":"", + "userSuiteLevel":"", + "enableHealthCheck":"", + "proxyConnectTimeout":"", + "enableUnderscores":"" + }], + "regionId":"", + "instanceId":"" + }, "describe-web-rule":{ "regionId":"", "instanceId":"", @@ -342,6 +589,7 @@ "modify-web-rule":{ "webRuleSpec":{ "serviceIp":"", + "serviceIps":"", "domain":"", "protocol":{ "http":"", @@ -358,7 +606,15 @@ "customPortStatus":"", "httpOrigin":"", "webSocketStatus":"", - "geoRsRoute":[""] + "geoRsRoute":[""], + "enableKeepalive":"", + "httpVersion":"", + "sslProtocols":"", + "suiteLevel":"", + "userSuiteLevel":"", + "enableHealthCheck":"", + "proxyConnectTimeout":"", + "enableUnderscores":"" }, "regionId":"", "instanceId":"", @@ -405,6 +661,64 @@ "instanceId":"", "webRuleId":"" }, + "describe-js-pages-of-web-rule":{ + "pageNumber":"", + "pageSize":"", + "regionId":"", + "instanceId":"", + "webRuleId":"" + }, + "create-js-page-of-web-rule":{ + "jsPageSpec":{ + "uri":"" + }, + "regionId":"", + "instanceId":"", + "webRuleId":"" + }, + "create-js-pages-of-web-rule":{ + "jsPagesSpec":{ + "uris":"" + }, + "regionId":"", + "instanceId":"", + "webRuleId":"" + }, + "modify-js-page-of-web-rule":{ + "jsPageSpec":{ + "uri":"" + }, + "regionId":"", + "instanceId":"", + "webRuleId":"", + "jsPageId":"" + }, + "delete-js-page-of-web-rule":{ + "regionId":"", + "instanceId":"", + "webRuleId":"", + "jsPageId":"" + }, + "disable-web-rule-js-page":{ + "regionId":"", + "instanceId":"", + "webRuleId":"" + }, + "enable-web-rule-js-page":{ + "regionId":"", + "instanceId":"", + "webRuleId":"" + }, + "modify-web-rule-js-page-to-all":{ + "regionId":"", + "instanceId":"", + "webRuleId":"" + }, + "modify-web-rule-js-page-to-custom":{ + "regionId":"", + "instanceId":"", + "webRuleId":"" + }, "describe-ccprotection-rules-of-web-rule":{ "regionId":"", "instanceId":"", @@ -418,7 +732,9 @@ "detectPeriod":"", "singleIpLimit":"", "blockType":"", - "blockTime":"" + "blockTime":"", + "pageId":"", + "pageName":"" }, "regionId":"", "instanceId":"", @@ -438,7 +754,9 @@ "detectPeriod":"", "singleIpLimit":"", "blockType":"", - "blockTime":"" + "blockTime":"", + "pageId":"", + "pageName":"" }, "regionId":"", "instanceId":"", @@ -463,6 +781,16 @@ "webRuleId":"", "ccProtectionRuleId":"" }, + "enable-web-rule-ccprotection-rule":{ + "regionId":"", + "instanceId":"", + "webRuleId":"" + }, + "disable-web-rule-ccprotection-rule":{ + "regionId":"", + "instanceId":"", + "webRuleId":"" + }, "describe-ccprotection-config-of-web-rule":{ "regionId":"", "instanceId":"", @@ -517,7 +845,8 @@ "pattern":"", "action":"", "actionValue":"", - "status":"" + "status":"", + "pageId":"" }, "regionId":"", "instanceId":"", @@ -538,7 +867,8 @@ "pattern":"", "action":"", "actionValue":"", - "status":"" + "status":"", + "pageId":"" }, "regionId":"", "instanceId":"", diff --git a/jdcloud_cli/resources/skeletons/jcq.json b/jdcloud_cli/resources/skeletons/jcq.json index da08ade..d1ac388 100644 --- a/jdcloud_cli/resources/skeletons/jcq.json +++ b/jdcloud_cli/resources/skeletons/jcq.json @@ -3,9 +3,30 @@ "regionId":"", "topicName":"" }, - "describe-consumer-group-ids":{ + "describe-topics":{ + "pageSize":"", + "pageNumber":"", + "topicFilter":"", + "tagFilters":[{ + "key":"", + "values":"" + }], "regionId":"" }, + "create-topic":{ + "topicName":"", + "type":"", + "description":"", + "regionId":"" + }, + "describe-topic":{ + "regionId":"", + "topicName":"" + }, + "delete-topic":{ + "regionId":"", + "topicName":"" + }, "describe-dead-letter-numbers":{ "consumerGroupId":"", "pageNumber":"", @@ -40,29 +61,6 @@ "topicName":"", "consumerGroupId":"" }, - "describe-messages":{ - "startTime":"", - "endTime":"", - "pageSize":"", - "pageNumber":"", - "regionId":"", - "topicName":"" - }, - "describe-message":{ - "regionId":"", - "topicName":"", - "messageId":"" - }, - "describe-message-trace":{ - "regionId":"", - "topicName":"", - "messageId":"" - }, - "describe-messages-by-business-id":{ - "businessId":"", - "regionId":"", - "topicName":"" - }, "describe-permission":{ "regionId":"", "topicName":"" @@ -79,6 +77,9 @@ "regionId":"", "topicName":"" }, + "describe-consumer-group-ids":{ + "regionId":"" + }, "describe-subscriptions":{ "consumerGroupFilter":"", "pageSize":"", @@ -123,27 +124,26 @@ "topicName":"", "consumerGroupId":"" }, - "describe-topics":{ + "describe-messages":{ + "startTime":"", + "endTime":"", "pageSize":"", "pageNumber":"", - "topicFilter":"", - "tagFilters":[{ - "key":"", - "values":"" - }], - "regionId":"" + "regionId":"", + "topicName":"" }, - "create-topic":{ + "describe-message":{ + "regionId":"", "topicName":"", - "type":"", - "description":"", - "regionId":"" + "messageId":"" }, - "describe-topic":{ + "describe-message-trace":{ "regionId":"", - "topicName":"" + "topicName":"", + "messageId":"" }, - "delete-topic":{ + "describe-messages-by-business-id":{ + "businessId":"", "regionId":"", "topicName":"" }, diff --git a/jdcloud_cli/resources/skeletons/jdccs.json b/jdcloud_cli/resources/skeletons/jdccs.json index 99b67b9..fea4f20 100644 --- a/jdcloud_cli/resources/skeletons/jdccs.json +++ b/jdcloud_cli/resources/skeletons/jdccs.json @@ -1,20 +1,4 @@ { - "describe-alarms":{ - "pageNumber":"", - "pageSize":"", - "resourceType":"", - "resourceId":"" - }, - "describe-alarm":{ - "alarmId":"" - }, - "describe-alarm-history":{ - "pageNumber":"", - "pageSize":"", - "alarmId":"", - "startTime":"", - "endTime":"" - }, "describe-metrics":{ }, "describe-metric-data":{ @@ -35,6 +19,7 @@ "describe-bandwidth-traffics":{ "pageNumber":"", "pageSize":"", + "bandwidthName":"", "idc":"" }, "describe-bandwidth-traffic":{ @@ -46,13 +31,136 @@ "startTime":"", "endTime":"" }, + "describe-open-devices":{ + }, + "describe-open-devices-data":{ + "deviceCodes":"", + "deviceType":"" + }, + "describe-rangetime-cabinet-current":{ + "resourceId":"", + "startTime":"", + "endTime":"", + "timeInterval":"", + "idc":"" + }, + "describe-realtime-cabinet-current":{ + "resourceId":"", + "idc":"" + }, + "describe-alarms":{ + "pageNumber":"", + "pageSize":"", + "resourceType":"", + "resourceId":"", + "idc":"", + "status":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }] + }, + "create-alarm":{ + "idc":"", + "resourceType":"", + "resourceId":"", + "name":"", + "metric":"", + "period":"", + "statisticMethod":"", + "operator":"", + "threshold":"", + "times":"", + "noticePeriod":"", + "status":"", + "noticeMethod":"", + "noticeObj":"", + "userId":"", + "groupId":"" + }, + "describe-alarm":{ + "alarmId":"" + }, + "update-alarm":{ + "name":"", + "metric":"", + "period":"", + "statisticMethod":"", + "operator":"", + "threshold":"", + "times":"", + "noticePeriod":"", + "status":"", + "noticeMethod":"", + "userId":"", + "groupId":"", + "alarmId":"" + }, + "delete-alarm":{ + "alarmId":"" + }, + "describe-alarm-history":{ + "pageNumber":"", + "pageSize":"", + "alarmId":"", + "idc":"", + "startTime":"", + "endTime":"" + }, + "switch-alarm":{ + "status":"", + "alarmId":"" + }, + "describe-tickets":{ + "pageNumber":"", + "pageSize":"", + "type":"", + "ticketTypeName":"", + "status":"", + "ticketNo":"", + "ticketTemplateName":"", + "description":"", + "startTime":"", + "endTime":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "sorts":[{ + "name":"", + "direction":"" + }] + }, + "describe-ticket":{ + "ticketNo":"" + }, + "create-general-services-ticket":{ + "phone":"", + "email":"", + "idc":"", + "isExternalIdc":"", + "count":"", + "externalIdcAddress":"", + "externalIdcContactPerson":"", + "externalIdcContactPhone":"", + "remarks":"", + "attach":[{ + "attachName":"", + "attachPath":"" + }] + }, "describe-idcs":{ "pageNumber":"", - "pageSize":"" + "pageSize":"", + "all":"", + "includeExternalIdc":"" }, "describe-rooms":{ "pageNumber":"", "pageSize":"", + "all":"", "filters":[{ "name":"", "operator":"", @@ -63,11 +171,18 @@ "describe-cabinets":{ "pageNumber":"", "pageSize":"", + "cabinetType":"", + "cabinetOpenStatus":"", + "cabinetNo":"", "filters":[{ "name":"", "operator":"", "values":"" }], + "sorts":[{ + "name":"", + "direction":"" + }], "idc":"" }, "describe-cabinet":{ @@ -78,11 +193,20 @@ "pageNumber":"", "pageSize":"", "cabinetId":"", + "deviceType":"", + "assetStatus":"", + "assetBelong":"", + "deviceNo":"", + "snNo":"", "filters":[{ "name":"", "operator":"", "values":"" }], + "sorts":[{ + "name":"", + "direction":"" + }], "idc":"" }, "describe-device":{ @@ -92,33 +216,43 @@ "describe-ips":{ "pageNumber":"", "pageSize":"", + "lineType":"", + "status":"", + "cidrAddr":"", "filters":[{ "name":"", "operator":"", "values":"" }], + "sorts":[{ + "name":"", + "direction":"" + }], "idc":"" }, "describe-bandwidths":{ "pageNumber":"", "pageSize":"", + "lineType":"", + "chargeType":"", + "bandwidthName":"", + "relatedIp":"", "filters":[{ "name":"", "operator":"", "values":"" }], + "sorts":[{ + "name":"", + "direction":"" + }], "idc":"" }, "describe-bandwidth":{ "idc":"", "bandwidthId":"" }, - "describe-tickets":{ - "pageNumber":"", - "pageSize":"", - "type":"" - }, - "describe-ticket":{ - "ticketNo":"" + "describe-idc-overview":{ + "idc":"" }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/jdfusion.json b/jdcloud_cli/resources/skeletons/jdfusion.json index 77f88c5..1a9e3a0 100644 --- a/jdcloud_cli/resources/skeletons/jdfusion.json +++ b/jdcloud_cli/resources/skeletons/jdfusion.json @@ -1,4 +1,118 @@ { + "get-vpc-by-id":{ + "regionId":"", + "id":"" + }, + "delete-vpc-by-id":{ + "regionId":"", + "id":"" + }, + "get-vpcs":{ + "regionId":"" + }, + "create-vpc":{ + "vpc":{ + "id":"", + "name":"", + "cidrBlock":"", + "description":"", + "createdTime":"", + "cloudID":"" + }, + "regionId":"" + }, + "get-vm-instances-by-id":{ + "regionId":"", + "id":"" + }, + "delete-vm-instance-by-id":{ + "regionId":"", + "id":"" + }, + "get-vm-instances":{ + "regionId":"" + }, + "create-vm-instance":{ + "vm":{ + "id":"", + "region":"", + "az":"", + "name":"", + "hostName":"", + "imageType":{ + "id":"", + "desc":"", + "imageSource":"", + "name":"", + "osType":"", + "osVersion":"", + "platform":"", + "region":"", + "cloudID":"" + }, + "instanceType":{ + "name":"", + "cpu":"", + "memory":"" + }, + "description":"", + "subnetId":"", + "tags":[""], + "cloudID":"", + "keyNames":"", + "elasticIpAddress":"", + "privateIpAddress":"", + "status":"", + "createdTime":"", + "imageId":"", + "instanceFlavorType":"", + "securityGroupId":"", + "internetMaxBandwidthIn":"", + "internetMaxBandwidthOut":"", + "password":"", + "passwordInherit":"", + "userData":"", + "keyPairName":"", + "systemDisk":{ + "category":"", + "diskSize":"", + "description":"" + } + }, + "regionId":"" + }, + "stop-vm-instance-by-id":{ + "regionId":"", + "id":"" + }, + "start-vm-instance-by-id":{ + "regionId":"", + "id":"" + }, + "reboot-vm-instance-by-id":{ + "regionId":"", + "id":"" + }, + "get-vpc-vserver-groups":{ + "slbid":"", + "regionId":"" + }, + "create-vpc-vserver-group":{ + "vserverGroup":{ + "loadBalancerId":"", + "vserverGroupName":"", + "backendServers":[""] + }, + "regionId":"" + }, + "get-vserver-groups-by-id":{ + "regionId":"", + "id":"" + }, + "delete-vserver-group":{ + "regionId":"", + "id":"" + }, "get-cloud-infos":{ "driver":"", "regionId":"" @@ -25,164 +139,156 @@ "regionId":"", "cloudId":"" }, - "get-deployments":{ - "regionId":"" + "get-rds-databases-by-inst-id":{ + "regionId":"", + "instId":"" }, - "create-deployment":{ - "deployment":{ - "info":{ - "cloudId":"", - "version":"", - "readOnly":"", - "id":"", - "name":"", - "description":"", - "userId":"", - "createdTime":"", - "updatedTime":"", - "lastOperation":"" - }, - "content":{ - "vms":"", - "eips":"", - "subnets":"", - "networkInterfaces":"", - "slbs":"", - "securityGroups":"", - "securityGroupRules":"", - "keypairs":"", - "disks":"", - "vpcs":"", - "vserverGroups":"", - "httpListeners":"", - "diskAttachment":"", - "netInterfaceAttachment":"", - "eipAssociate":"", - "rds":"", - "rdsDatabase":"", - "rdsAccount":"", - "rdsAccountGrant":"", - "bucket":"", - "variables":"" - } + "create-rds-database":{ + "database":{ + "name":"", + "characterSetName":"" }, + "regionId":"", + "instId":"" + }, + "get-rds-database-by-inst-id-and-db-name":{ + "regionId":"", + "instId":"", + "dbName":"" + }, + "delete-rds-database":{ + "regionId":"", + "instId":"", + "dbName":"" + }, + "get-buckets":{ "regionId":"" }, - "reverse-deployment":{ - "reverse":{ + "create-bucket":{ + "bucket":{ "name":"", - "description":"", - "version":"", - "readOnly":"", - "resources":{ - "vmIds":"", - "eipIds":"", - "subnetIds":"", - "networkInterfaceIds":"", - "slbIds":"", - "securityGroupIds":"", - "keypairIds":"", - "diskIds":"", - "vpcIds":"", - "vserverGroupIds":"", - "httpListenerIds":"", - "diskAttachmentIds":"", - "netInterfaceAttachmentIds":"", - "eipAssociateIds":"" - } + "creationDate":"", + "cloudID":"", + "acl":"" }, "regionId":"" }, - "get-deployments-by-id":{ + "get-bucket-by-name":{ + "regionId":"", + "name":"" + }, + "delete-bucket":{ + "regionId":"", + "name":"" + }, + "get-bucket-files":{ + "marker":"", + "regionId":"", + "name":"" + }, + "get-vpc-slb-by-id":{ "regionId":"", "id":"" }, - "edit-deployment":{ - "deployment":{ - "info":{ - "cloudId":"", - "version":"", - "readOnly":"", - "id":"", - "name":"", - "description":"", - "userId":"", - "createdTime":"", - "updatedTime":"", - "lastOperation":"" - }, - "content":{ - "vms":"", - "eips":"", - "subnets":"", - "networkInterfaces":"", - "slbs":"", - "securityGroups":"", - "securityGroupRules":"", - "keypairs":"", - "disks":"", - "vpcs":"", - "vserverGroups":"", - "httpListeners":"", - "diskAttachment":"", - "netInterfaceAttachment":"", - "eipAssociate":"", - "rds":"", - "rdsDatabase":"", - "rdsAccount":"", - "rdsAccountGrant":"", - "bucket":"", - "variables":"" - } + "delete-vpc-slb-by-id":{ + "regionId":"", + "id":"" + }, + "get-vpc-slbs":{ + "regionId":"" + }, + "create-vpc-slb":{ + "slb":{ + "cloudID":"", + "id":"", + "name":"", + "status":"", + "ipAddress":"", + "addressType":"", + "subnetId":"", + "vpc":"", + "networkType":"", + "azs":"", + "createdTime":"" }, + "regionId":"" + }, + "start-slb":{ "regionId":"", "id":"" }, - "delete-deployment":{ + "stop-slb":{ "regionId":"", "id":"" }, - "clone-deployment":{ - "deployment":{ - "name":"" - }, + "delete-slbs-listener":{ + "listenerPort":"", "regionId":"", "id":"" }, - "dryrun-deployment":{ + "start-slb-listener":{ + "listenerPort":"", "regionId":"", "id":"" }, - "apply-deployment":{ - "apply":{ - "comment":"" - }, + "stop-slb-listener":{ + "listenerPort":"", "regionId":"", "id":"" }, - "get-deployment-result":{ + "get-rds-specification":{ + "regionId":"", + "engine":"" + }, + "get-vm-instance-types":{ + "az":"", + "regionId":"" + }, + "get-vpc-network-interface-by-id":{ + "regionId":"", + "id":"" + }, + "delete-vpc-network-interface-by-id":{ + "regionId":"", + "id":"" + }, + "get-vpc-network-interfaces":{ + "vmId":"", + "regionId":"" + }, + "create-vpc-network-interface":{ + "netInterface":{ + "id":"", + "name":"", + "description":"", + "vpcId":"", + "type":"", + "subnetId":"", + "az":"", + "associatedPublicIp":"", + "privateIpAddress":"", + "macAddress":"", + "instanceId":"", + "createdTime":"", + "cloudID":"", + "securityGroupId":"" + }, + "regionId":"" + }, + "attach-vpc-network-interface-by-id":{ + "attach":{ + "instanceId":"" + }, "regionId":"", "id":"" }, - "get-deployment-versions":{ + "detach-vpc-network-interface-by-id":{ + "detach":{ + "instanceId":"" + }, "regionId":"", "id":"" }, - "get-deployments-version":{ - "regionId":"", - "id":"", - "version_id":"" - }, - "rollback-deployments-version":{ - "regionId":"", - "id":"", - "version_id":"" - }, - "get-deployments-results-by-id-record":{ - "regionId":"", - "id":"", - "record":"" - }, "get-disks":{ "vmId":"", "regionId":"" @@ -227,99 +333,6 @@ "regionId":"", "id":"" }, - "get-buckets":{ - "regionId":"" - }, - "create-bucket":{ - "bucket":{ - "name":"", - "creationDate":"", - "cloudID":"", - "acl":"" - }, - "regionId":"" - }, - "get-bucket-by-name":{ - "regionId":"", - "name":"" - }, - "delete-bucket":{ - "regionId":"", - "name":"" - }, - "get-bucket-files":{ - "marker":"", - "regionId":"", - "name":"" - }, - "get-transfer-tasks":{ - "regionId":"" - }, - "create-transfer-task":{ - "task":{ - "name":"", - "srcAddress":{ - "cloudID":"", - "bucket":"", - "prefix":"" - }, - "dstAddress":{ - "cloudID":"", - "bucket":"", - "prefix":"" - } - }, - "regionId":"" - }, - "get-transfer-task-by-id":{ - "regionId":"", - "id":"" - }, - "edit-transfer-task":{ - "task":{ - "name":"", - "srcAddress":{ - "storageType":"", - "accessKey":"", - "secretKey":"", - "endpoint":"", - "bucket":"", - "prefix":"", - "cloudID":"" - }, - "dstAddress":{ - "storageType":"", - "accessKey":"", - "secretKey":"", - "endpoint":"", - "bucket":"", - "prefix":"", - "cloudID":"" - } - }, - "regionId":"", - "id":"" - }, - "delete-transfer-task":{ - "regionId":"", - "id":"" - }, - "start-transfer-task":{ - "regionId":"", - "id":"" - }, - "stop-transfer-task":{ - "regionId":"", - "id":"" - }, - "get-transfer-task-progress":{ - "regionId":"", - "id":"" - }, - "get-transfer-task-failed-files":{ - "regionId":"", - "id":"" - }, "get-rds-accounts-by-inst-id":{ "regionId":"", "instId":"" @@ -366,146 +379,41 @@ "instId":"", "accountName":"" }, - "get-rds-databases-by-inst-id":{ - "regionId":"", - "instId":"" - }, - "create-rds-database":{ - "database":{ - "name":"", - "characterSetName":"" - }, - "regionId":"", - "instId":"" - }, - "get-rds-database-by-inst-id-and-db-name":{ - "regionId":"", - "instId":"", - "dbName":"" - }, - "delete-rds-database":{ - "regionId":"", - "instId":"", - "dbName":"" - }, - "get-rds-instances":{ + "get-vpc-eips":{ "regionId":"" }, - "create-rds-instance":{ - "instance":{ - "id":"", + "create-vpc-eip":{ + "allocate":{ "name":"", - "payType":"", - "azs":"", - "engine":"", - "status":"", - "instanceType":"", - "cloudID":"", - "engineVersion":"", - "instanceClass":"", - "storageGB":"", - "vpcId":"", - "subnetId":"", - "createTime":"" - }, - "regionId":"" - }, - "get-rds-by-inst-id":{ - "regionId":"", - "instId":"" - }, - "delete-rds-by-inst-id":{ - "regionId":"", - "instId":"" - }, - "get-channels":{ - "regionId":"" - }, - "create-channel":{ - "channel":{ - "info":{ - "id":"", - "name":"", - "description":"", - "status":"" - }, - "source":{ - "cloud":{ - "cloudId":"", - "rdsId":"", - "username":"", - "password":"" - }, - "datasource":{ - "id":"", - "address":"", - "port":"", - "username":"", - "password":"" - }, - "schema":"", - "tables":"" - }, - "target":{ - "cloud":{ - "cloudId":"", - "rdsId":"", - "username":"", - "password":"" - }, - "datasource":{ - "id":"", - "address":"", - "port":"", - "username":"", - "password":"" - }, - "schema":"", - "tables":"" - } + "bandwidth":"", + "provider":"" }, "regionId":"" }, - "delete-channel":{ + "get-vpc-eip-by-id":{ "regionId":"", "id":"" }, - "start-channel":{ + "delete-vpc-eip-by-id":{ "regionId":"", "id":"" }, - "stop-channel":{ + "associate-vpc-eip-by-id":{ + "associate":{ + "instanceId":"", + "instanceType":"" + }, "regionId":"", "id":"" }, - "get-datasources":{ - "regionId":"" - }, - "create-datasource":{ - "datasource":{ - "id":"", - "address":"", - "port":"", - "username":"", - "password":"" + "disassociate-vpc-eip-by-id":{ + "unassociate":{ + "instanceId":"", + "instanceType":"" }, - "regionId":"" - }, - "delete-datasource":{ "regionId":"", "id":"" }, - "get-rds-specification":{ - "regionId":"", - "engine":"" - }, - "get-regions":{ - "regionId":"" - }, - "get-regions-available-zones":{ - "regionId":"", - "region":"" - }, "get-task-info-history-by-id":{ "regionId":"", "task":"" @@ -515,85 +423,73 @@ "regionId":"", "task":"" }, - "get-vm-images":{ - "imageSource":"", + "get-transfer-tasks":{ + "regionId":"" + }, + "create-transfer-task":{ + "task":{ + "name":"", + "srcAddress":{ + "cloudID":"", + "bucket":"", + "prefix":"" + }, + "dstAddress":{ + "cloudID":"", + "bucket":"", + "prefix":"" + } + }, "regionId":"" }, - "get-vm-instances-by-id":{ - "regionId":"", - "id":"" - }, - "delete-vm-instance-by-id":{ + "get-transfer-task-by-id":{ "regionId":"", "id":"" }, - "get-vm-instances":{ - "regionId":"" - }, - "create-vm-instance":{ - "vm":{ - "id":"", - "region":"", - "az":"", + "edit-transfer-task":{ + "task":{ "name":"", - "hostName":"", - "imageType":{ - "id":"", - "desc":"", - "imageSource":"", - "name":"", - "osType":"", - "osVersion":"", - "platform":"", - "region":"", + "srcAddress":{ + "storageType":"", + "accessKey":"", + "secretKey":"", + "endpoint":"", + "bucket":"", + "prefix":"", "cloudID":"" }, - "instanceType":{ - "name":"", - "cpu":"", - "memory":"" - }, - "description":"", - "subnetId":"", - "tags":[""], - "cloudID":"", - "keyNames":"", - "elasticIpAddress":"", - "privateIpAddress":"", - "status":"", - "createdTime":"", - "imageId":"", - "instanceFlavorType":"", - "securityGroupId":"", - "internetMaxBandwidthIn":"", - "internetMaxBandwidthOut":"", - "password":"", - "passwordInherit":"", - "userData":"", - "keyPairName":"", - "systemDisk":{ - "category":"", - "diskSize":"", - "description":"" + "dstAddress":{ + "storageType":"", + "accessKey":"", + "secretKey":"", + "endpoint":"", + "bucket":"", + "prefix":"", + "cloudID":"" } }, - "regionId":"" + "regionId":"", + "id":"" }, - "stop-vm-instance-by-id":{ + "delete-transfer-task":{ "regionId":"", "id":"" }, - "start-vm-instance-by-id":{ + "start-transfer-task":{ "regionId":"", "id":"" }, - "reboot-vm-instance-by-id":{ + "stop-transfer-task":{ "regionId":"", "id":"" }, - "get-vm-instance-types":{ - "az":"", - "regionId":"" + "get-transfer-task-progress":{ + "regionId":"", + "id":"" + }, + "get-transfer-task-failed-files":{ + "regionId":"", + "id":"" }, "get-vm-keypairs-by-name":{ "regionId":"", @@ -615,38 +511,52 @@ }, "regionId":"" }, - "get-vpc-eips":{ - "regionId":"" - }, - "create-vpc-eip":{ - "allocate":{ - "name":"", - "bandwidth":"", - "provider":"" - }, - "regionId":"" - }, - "get-vpc-eip-by-id":{ + "get-vpc-security-group-by-id":{ "regionId":"", "id":"" }, - "delete-vpc-eip-by-id":{ + "delete-vpc-security-group-by-id":{ "regionId":"", "id":"" }, - "associate-vpc-eip-by-id":{ - "associate":{ - "instanceId":"", - "instanceType":"" + "get-vpc-security-groups":{ + "regionId":"" + }, + "create-vpc-security-group":{ + "securityGroup":{ + "cloudID":"", + "id":"", + "name":"", + "description":"", + "vpcId":"", + "createdTime":"" + }, + "regionId":"" + }, + "create-security-groups-rule":{ + "sgRule":{ + "ruleType":"", + "protocol":"", + "fromPort":"", + "toPort":"", + "securityGroupId":"", + "nicType":"", + "policy":"", + "priority":"", + "cidrIp":"" }, "regionId":"", "id":"" }, - "disassociate-vpc-eip-by-id":{ - "unassociate":{ - "instanceId":"", - "instanceType":"" - }, + "delete-security-groups-rule":{ + "ruleType":"", + "protocol":"", + "fromPort":"", + "toPort":"", + "nicType":"", + "policy":"", + "priority":"", + "cidrIp":"", "regionId":"", "id":"" }, @@ -670,213 +580,303 @@ }, "regionId":"" }, - "get-vpc-network-interface-by-id":{ + "get-vm-images":{ + "imageSource":"", + "regionId":"" + }, + "get-vpc-subnet-by-id":{ "regionId":"", "id":"" }, - "delete-vpc-network-interface-by-id":{ + "delete-vpc-subnet-by-id":{ "regionId":"", "id":"" }, - "get-vpc-network-interfaces":{ - "vmId":"", + "get-vpc-subnets":{ "regionId":"" }, - "create-vpc-network-interface":{ - "netInterface":{ + "create-vpc-subnet":{ + "subnet":{ "id":"", "name":"", - "description":"", "vpcId":"", - "type":"", - "subnetId":"", + "cidrBlock":"", + "description":"", "az":"", - "associatedPublicIp":"", - "privateIpAddress":"", - "macAddress":"", - "instanceId":"", "createdTime":"", - "cloudID":"", - "securityGroupId":"" + "cloudID":"" }, "regionId":"" }, - "attach-vpc-network-interface-by-id":{ - "attach":{ - "instanceId":"" + "get-rds-instances":{ + "regionId":"" + }, + "create-rds-instance":{ + "instance":{ + "id":"", + "name":"", + "payType":"", + "azs":"", + "engine":"", + "status":"", + "instanceType":"", + "cloudID":"", + "engineVersion":"", + "instanceClass":"", + "storageGB":"", + "vpcId":"", + "subnetId":"", + "createTime":"" }, + "regionId":"" + }, + "get-rds-by-inst-id":{ "regionId":"", - "id":"" + "instId":"" }, - "detach-vpc-network-interface-by-id":{ - "detach":{ - "instanceId":"" + "delete-rds-by-inst-id":{ + "regionId":"", + "instId":"" + }, + "get-deployments":{ + "regionId":"" + }, + "create-deployment":{ + "deployment":{ + "info":{ + "cloudId":"", + "version":"", + "readOnly":"", + "id":"", + "name":"", + "description":"", + "userId":"", + "createdTime":"", + "updatedTime":"", + "lastOperation":"" + }, + "content":{ + "vms":"", + "eips":"", + "subnets":"", + "networkInterfaces":"", + "slbs":"", + "securityGroups":"", + "securityGroupRules":"", + "keypairs":"", + "disks":"", + "vpcs":"", + "vserverGroups":"", + "httpListeners":"", + "diskAttachment":"", + "netInterfaceAttachment":"", + "eipAssociate":"", + "rds":"", + "rdsDatabase":"", + "rdsAccount":"", + "rdsAccountGrant":"", + "bucket":"", + "variables":"" + } }, - "regionId":"", - "id":"" - }, - "get-vpc-security-group-by-id":{ - "regionId":"", - "id":"" - }, - "delete-vpc-security-group-by-id":{ - "regionId":"", - "id":"" - }, - "get-vpc-security-groups":{ "regionId":"" }, - "create-vpc-security-group":{ - "securityGroup":{ - "cloudID":"", - "id":"", + "reverse-deployment":{ + "reverse":{ "name":"", "description":"", - "vpcId":"", - "createdTime":"" + "version":"", + "readOnly":"", + "resources":{ + "vmIds":"", + "eipIds":"", + "subnetIds":"", + "networkInterfaceIds":"", + "slbIds":"", + "securityGroupIds":"", + "keypairIds":"", + "diskIds":"", + "vpcIds":"", + "vserverGroupIds":"", + "httpListenerIds":"", + "diskAttachmentIds":"", + "netInterfaceAttachmentIds":"", + "eipAssociateIds":"" + } }, "regionId":"" }, - "create-security-groups-rule":{ - "sgRule":{ - "ruleType":"", - "protocol":"", - "fromPort":"", - "toPort":"", - "securityGroupId":"", - "nicType":"", - "policy":"", - "priority":"", - "cidrIp":"" - }, + "get-deployments-by-id":{ "regionId":"", "id":"" }, - "delete-security-groups-rule":{ - "ruleType":"", - "protocol":"", - "fromPort":"", - "toPort":"", - "nicType":"", - "policy":"", - "priority":"", - "cidrIp":"", + "edit-deployment":{ + "deployment":{ + "info":{ + "cloudId":"", + "version":"", + "readOnly":"", + "id":"", + "name":"", + "description":"", + "userId":"", + "createdTime":"", + "updatedTime":"", + "lastOperation":"" + }, + "content":{ + "vms":"", + "eips":"", + "subnets":"", + "networkInterfaces":"", + "slbs":"", + "securityGroups":"", + "securityGroupRules":"", + "keypairs":"", + "disks":"", + "vpcs":"", + "vserverGroups":"", + "httpListeners":"", + "diskAttachment":"", + "netInterfaceAttachment":"", + "eipAssociate":"", + "rds":"", + "rdsDatabase":"", + "rdsAccount":"", + "rdsAccountGrant":"", + "bucket":"", + "variables":"" + } + }, "regionId":"", "id":"" }, - "get-vpc-slb-by-id":{ + "delete-deployment":{ "regionId":"", "id":"" }, - "delete-vpc-slb-by-id":{ + "clone-deployment":{ + "deployment":{ + "name":"" + }, "regionId":"", "id":"" }, - "get-vpc-slbs":{ - "regionId":"" + "dryrun-deployment":{ + "regionId":"", + "id":"" }, - "create-vpc-slb":{ - "slb":{ - "cloudID":"", - "id":"", - "name":"", - "status":"", - "ipAddress":"", - "addressType":"", - "subnetId":"", - "vpc":"", - "networkType":"", - "azs":"", - "createdTime":"" + "apply-deployment":{ + "apply":{ + "comment":"" }, - "regionId":"" - }, - "start-slb":{ "regionId":"", "id":"" }, - "stop-slb":{ + "get-deployment-result":{ "regionId":"", "id":"" }, - "delete-slbs-listener":{ - "listenerPort":"", + "get-deployment-versions":{ "regionId":"", "id":"" }, - "start-slb-listener":{ - "listenerPort":"", + "get-deployments-version":{ "regionId":"", - "id":"" + "id":"", + "version_id":"" }, - "stop-slb-listener":{ - "listenerPort":"", + "rollback-deployments-version":{ "regionId":"", - "id":"" + "id":"", + "version_id":"" }, - "get-vpc-subnet-by-id":{ + "get-deployments-results-by-id-record":{ "regionId":"", - "id":"" + "id":"", + "record":"" }, - "delete-vpc-subnet-by-id":{ + "get-regions":{ + "regionId":"" + }, + "get-regions-available-zones":{ "regionId":"", - "id":"" + "region":"" }, - "get-vpc-subnets":{ + "get-channels":{ "regionId":"" }, - "create-vpc-subnet":{ - "subnet":{ - "id":"", - "name":"", - "vpcId":"", - "cidrBlock":"", - "description":"", - "az":"", - "createdTime":"", - "cloudID":"" + "create-channel":{ + "channel":{ + "info":{ + "id":"", + "name":"", + "description":"", + "status":"" + }, + "source":{ + "cloud":{ + "cloudId":"", + "rdsId":"", + "username":"", + "password":"" + }, + "datasource":{ + "id":"", + "address":"", + "port":"", + "username":"", + "password":"" + }, + "schema":"", + "tables":"" + }, + "target":{ + "cloud":{ + "cloudId":"", + "rdsId":"", + "username":"", + "password":"" + }, + "datasource":{ + "id":"", + "address":"", + "port":"", + "username":"", + "password":"" + }, + "schema":"", + "tables":"" + } }, "regionId":"" }, - "get-vpc-by-id":{ + "delete-channel":{ "regionId":"", "id":"" }, - "delete-vpc-by-id":{ + "start-channel":{ "regionId":"", "id":"" }, - "get-vpcs":{ - "regionId":"" - }, - "create-vpc":{ - "vpc":{ - "id":"", - "name":"", - "cidrBlock":"", - "description":"", - "createdTime":"", - "cloudID":"" - }, - "regionId":"" + "stop-channel":{ + "regionId":"", + "id":"" }, - "get-vpc-vserver-groups":{ - "slbid":"", + "get-datasources":{ "regionId":"" }, - "create-vpc-vserver-group":{ - "vserverGroup":{ - "loadBalancerId":"", - "vserverGroupName":"", - "backendServers":[""] + "create-datasource":{ + "datasource":{ + "id":"", + "address":"", + "port":"", + "username":"", + "password":"" }, "regionId":"" }, - "get-vserver-groups-by-id":{ - "regionId":"", - "id":"" - }, - "delete-vserver-group":{ + "delete-datasource":{ "regionId":"", "id":"" }, diff --git a/jdcloud_cli/resources/skeletons/jke.json b/jdcloud_cli/resources/skeletons/jke.json deleted file mode 100644 index 17043ea..0000000 --- a/jdcloud_cli/resources/skeletons/jke.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "describe-quotas":{ - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, -} \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/jmr.json b/jdcloud_cli/resources/skeletons/jmr.json index 375157d..6e7b815 100644 --- a/jdcloud_cli/resources/skeletons/jmr.json +++ b/jdcloud_cli/resources/skeletons/jmr.json @@ -1,38 +1,86 @@ { - "describe-cluster":{ + "idata-cluster":{ + "regionId":"", + "dataCenter":"" + }, + "get-software-info":{ + "version":"", + "regionId":"" + }, + "get-jmr-version-list":{ + "regionId":"" + }, + "monitor-label-list":{ "regionId":"", "clusterId":"" }, - "delete-cluster":{ + "describe-cluster":{ "regionId":"", "clusterId":"" }, "describe-clusters":{ - "pageNumber":"", + "dataCenter":"", + "status":"", + "clusterName":"", + "orderBy":"", + "pageNum":"", "pageSize":"", "regionId":"" }, + "release-cluster":{ + "regionId":"", + "clusterId":"" + }, + "cluster-expansion":{ + "clusterExpansion":{ + "clusterId":"", + "expansionNum":"", + "nodeType":"" + }, + "clientToken":"", + "regionId":"" + }, + "cluster-reduction":{ + "clusterReduction":{ + "clusterId":"", + "reserveNum":"", + "nodeType":"" + }, + "clientToken":"", + "regionId":"" + }, "create-cluster":{ "clusterSpec":{ - "clusterName":"", - "osUserPassword":"", - "clusterVersion":"", - "clusterPaymentType":"", - "clusterService":"", - "clusterOss":"", - "clusterHa":"", - "clusterVpc":"", - "clusterVpcSubnet":"", - "clusterBandwidth":"", - "clusterMasterNodeModel":"", - "clusterMasterNodeDiskType":"", - "clusterMasterNodeDiskSize":"", - "clusterMasterNodeDiskCount":"", - "clusterCoreNodeModel":"", - "clusterCoreNodeDiskType":"", - "clusterCoreNodeDiskSize":"", - "clusterCoreNodeDiskCount":"", - "clusterCoreNodeCount":"" + "name":"", + "password":"", + "version":"", + "payType":"", + "masterNodeCount":"", + "masterSystemDiskType":"", + "masterSystemDiskVolume":"", + "masterSystemDiskIops":"", + "masterDiskType":"", + "masterDiskVolume":"", + "masterDiskIops":"", + "masterInstanceType":"", + "slaveNodeCount":"", + "slaveSystemDiskType":"", + "slaveSystemDiskVolume":"", + "slaveSystemDiskIops":"", + "slaveDiskType":"", + "slaveDiskVolume":"", + "slaveDiskIops":"", + "coreInstanceType":"", + "jssFlag":"", + "dataCenter":"", + "softwareList":"", + "haFlag":"", + "vpcId":"", + "vpcSubnetId":"", + "az":"", + "createOuterIpFlag":"", + "createSecurityGroupFlag":"", + "securityGroupId":"" }, "clientToken":"", "regionId":"" diff --git a/jdcloud_cli/resources/skeletons/kms.json b/jdcloud_cli/resources/skeletons/kms.json index e8a2da5..930b1e2 100644 --- a/jdcloud_cli/resources/skeletons/kms.json +++ b/jdcloud_cli/resources/skeletons/kms.json @@ -111,9 +111,6 @@ "secretData":"" } }, - "import-secret":{ - "secretPackage":"" - }, "describe-secret-version-list":{ "pageNumber":"", "pageSize":"", @@ -145,9 +142,6 @@ }, "secretId":"" }, - "export-secret":{ - "secretId":"" - }, "describe-secret-version-info":{ "secretId":"", "version":"" diff --git a/jdcloud_cli/resources/skeletons/kubernetes.json b/jdcloud_cli/resources/skeletons/kubernetes.json index cb43326..d399f6f 100644 --- a/jdcloud_cli/resources/skeletons/kubernetes.json +++ b/jdcloud_cli/resources/skeletons/kubernetes.json @@ -1,113 +1,4 @@ { - "describe-clusters":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, - "create-cluster":{ - "name":"", - "description":"", - "basicAuth":"", - "clientCertificate":"", - "version":"", - "azs":[""], - "nodeGroup":{ - "name":"", - "description":"", - "nodeConfig":{ - "instanceType":"", - "version":"", - "password":"", - "keyNames":"", - "systemDisk":{ - "systemDiskCategory":"", - "systemDiskSize":"", - "systemDiskType":"", - "systemDiskIops":"" - }, - "labels":[""] - }, - "azs":"", - "initialNodeCount":"", - "vpcId":"", - "nodeCidr":"", - "autoRepair":"", - "caConfig":{ - "enable":"", - "maxNode":"", - "minNode":"" - } - }, - "masterCidr":"", - "accessKey":"", - "secretKey":"", - "userMetrics":"", - "addonsConfig":[{ - "name":"", - "enabled":"" - }], - "regionId":"" - }, - "describe-cluster":{ - "regionId":"", - "clusterId":"" - }, - "modify-cluster":{ - "name":"", - "description":"", - "regionId":"", - "clusterId":"" - }, - "delete-cluster":{ - "regionId":"", - "clusterId":"" - }, - "set-user-metrics":{ - "enabled":"", - "regionId":"", - "clusterId":"" - }, - "abort-upgrade":{ - "regionId":"", - "clusterId":"" - }, - "describe-progress":{ - "nodeGroupIds":[""], - "regionId":"", - "clusterId":"" - }, - "set-auto-upgrade":{ - "autoUpgrade":"", - "maintenanceWindow":{ - "periodType":"", - "startDay":"", - "startTime":"", - "timeZone":"", - "duration":"" - }, - "regionId":"", - "clusterId":"" - }, - "upgrade-cluster":{ - "scope":"", - "nodeGroupIds":[""], - "version":"", - "regionId":"", - "clusterId":"" - }, - "set-addons":{ - "addonsConfig":[{ - "name":"", - "enabled":"" - }], - "regionId":"", - "clusterId":"" - }, "describe-node-groups":{ "pageNumber":"", "pageSize":"", @@ -196,6 +87,26 @@ "regionId":"", "nodeGroupId":"" }, + "describe-server-config":{ + "regionId":"" + }, + "describe-versions":{ + "masterVersion":"", + "regionId":"" + }, + "describe-node-version":{ + "regionId":"", + "nodeVersion":"" + }, + "describe-upgradable-master-versions":{ + "regionId":"", + "clusterId":"" + }, + "describe-upgradable-node-versions":{ + "nodeGroupIds":[""], + "regionId":"", + "clusterId":"" + }, "describe-quotas":{ "filters":[{ "name":"", @@ -204,24 +115,113 @@ }], "regionId":"" }, - "describe-server-config":{ + "describe-clusters":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], "regionId":"" }, - "describe-versions":{ - "masterVersion":"", + "create-cluster":{ + "name":"", + "description":"", + "basicAuth":"", + "clientCertificate":"", + "version":"", + "azs":[""], + "nodeGroup":{ + "name":"", + "description":"", + "nodeConfig":{ + "instanceType":"", + "version":"", + "password":"", + "keyNames":"", + "systemDisk":{ + "systemDiskCategory":"", + "systemDiskSize":"", + "systemDiskType":"", + "systemDiskIops":"" + }, + "labels":[""] + }, + "azs":"", + "initialNodeCount":"", + "vpcId":"", + "nodeCidr":"", + "autoRepair":"", + "caConfig":{ + "enable":"", + "maxNode":"", + "minNode":"" + } + }, + "masterCidr":"", + "accessKey":"", + "secretKey":"", + "userMetrics":"", + "addonsConfig":[{ + "name":"", + "enabled":"" + }], "regionId":"" }, - "describe-node-version":{ + "describe-cluster":{ "regionId":"", - "nodeVersion":"" + "clusterId":"" }, - "describe-upgradable-master-versions":{ + "modify-cluster":{ + "name":"", + "description":"", "regionId":"", "clusterId":"" }, - "describe-upgradable-node-versions":{ + "delete-cluster":{ + "regionId":"", + "clusterId":"" + }, + "set-user-metrics":{ + "enabled":"", + "regionId":"", + "clusterId":"" + }, + "abort-upgrade":{ + "regionId":"", + "clusterId":"" + }, + "describe-progress":{ "nodeGroupIds":[""], "regionId":"", "clusterId":"" }, + "set-auto-upgrade":{ + "autoUpgrade":"", + "maintenanceWindow":{ + "periodType":"", + "startDay":"", + "startTime":"", + "timeZone":"", + "duration":"" + }, + "regionId":"", + "clusterId":"" + }, + "upgrade-cluster":{ + "scope":"", + "nodeGroupIds":[""], + "version":"", + "regionId":"", + "clusterId":"" + }, + "set-addons":{ + "addonsConfig":[{ + "name":"", + "enabled":"" + }], + "regionId":"", + "clusterId":"" + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/lb.json b/jdcloud_cli/resources/skeletons/lb.json index 3c398d2..75fffec 100644 --- a/jdcloud_cli/resources/skeletons/lb.json +++ b/jdcloud_cli/resources/skeletons/lb.json @@ -1,4 +1,143 @@ { + "describe-url-maps":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-url-map":{ + "urlMapName":"", + "loadBalancerId":"", + "description":"", + "regionId":"" + }, + "describe-url-map":{ + "regionId":"", + "urlMapId":"" + }, + "update-url-map":{ + "description":"", + "urlMapName":"", + "regionId":"", + "urlMapId":"" + }, + "delete-url-map":{ + "regionId":"", + "urlMapId":"" + }, + "add-rules":{ + "ruleSpecs":[{ + "host":"", + "path":"", + "action":"", + "backendId":"", + "redirectActionSpec":{ + "protocol":"", + "port":"", + "host":"", + "path":"", + "query":"", + "statusCode":"" + } + }], + "regionId":"", + "urlMapId":"" + }, + "update-rules":{ + "ruleUpdateSpecs":[{ + "ruleId":"", + "host":"", + "path":"", + "action":"", + "backendId":"", + "redirectActionSpec":{ + "protocol":"", + "port":"", + "host":"", + "path":"", + "query":"", + "statusCode":"" + } + }], + "regionId":"", + "urlMapId":"" + }, + "delete-rules":{ + "ruleIds":[""], + "regionId":"", + "urlMapId":"" + }, + "describe-target-groups":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-target-group":{ + "targetGroupName":"", + "loadBalancerId":"", + "description":"", + "type":"", + "regionId":"" + }, + "describe-target-group":{ + "regionId":"", + "targetGroupId":"" + }, + "update-target-group":{ + "description":"", + "targetGroupName":"", + "regionId":"", + "targetGroupId":"" + }, + "delete-target-group":{ + "regionId":"", + "targetGroupId":"" + }, + "register-targets":{ + "targetSpecs":[{ + "instanceId":"", + "type":"", + "port":"", + "weight":"", + "ipAddress":"" + }], + "regionId":"", + "targetGroupId":"" + }, + "de-register-targets":{ + "targetIds":[""], + "regionId":"", + "targetGroupId":"" + }, + "update-targets":{ + "targetUpdateSpecs":[{ + "targetId":"", + "port":"", + "weight":"" + }], + "regionId":"", + "targetGroupId":"" + }, + "describe-targets":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"", + "targetGroupId":"" + }, "describe-backends":{ "pageNumber":"", "pageSize":"", @@ -38,6 +177,7 @@ "httpForwardedPort":"", "httpForwardedHost":"", "httpForwardedVip":"", + "httpForwardedClientPort":"", "regionId":"" }, "describe-backend":{ @@ -70,6 +210,7 @@ "httpForwardedPort":"", "httpForwardedHost":"", "httpForwardedVip":"", + "httpForwardedClientPort":"", "closeHealthCheck":"", "regionId":"", "backendId":"" @@ -82,7 +223,7 @@ "regionId":"", "backendId":"" }, - "describe-listeners":{ + "describe-load-balancers":{ "pageNumber":"", "pageSize":"", "filters":[{ @@ -90,52 +231,8 @@ "operator":"", "values":"" }], - "regionId":"" - }, - "create-listener":{ - "listenerName":"", - "protocol":"", - "port":"", - "backendId":"", - "loadBalancerId":"", - "urlMapId":"", - "action":"", - "certificateSpecs":[{ - "certificateId":"", - "isDefault":"" - }], - "connectionIdleTimeSeconds":"", - "description":"", - "regionId":"" - }, - "describe-listener":{ - "regionId":"", - "listenerId":"" - }, - "update-listener":{ - "listenerName":"", - "status":"", - "certificateSpecs":[{ - "certificateId":"", - "isDefault":"" - }], - "connectionIdleTimeSeconds":"", - "backendId":"", - "urlMapId":"", - "description":"", - "regionId":"", - "listenerId":"" - }, - "delete-listener":{ - "regionId":"", - "listenerId":"" - }, - "describe-load-balancers":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", + "tags":[{ + "key":"", "values":"" }], "regionId":"" @@ -163,9 +260,14 @@ "buyScenario":"" } }, + "privateIpAddress":"", "securityGroupIds":[""], "description":"", "deleteProtection":"", + "userTags":[{ + "key":"", + "value":"" + }], "regionId":"" }, "describe-load-balancer":{ @@ -176,7 +278,9 @@ "loadBalancerName":"", "action":"", "description":"", + "domainEnable":"", "deleteProtection":"", + "privateIpAddress":"", "regionId":"", "loadBalancerId":"" }, @@ -204,7 +308,7 @@ "regionId":"", "loadBalancerId":"" }, - "describe-target-groups":{ + "describe-listeners":{ "pageNumber":"", "pageSize":"", "filters":[{ @@ -214,115 +318,68 @@ }], "regionId":"" }, - "create-target-group":{ - "targetGroupName":"", + "create-listener":{ + "listenerName":"", + "protocol":"", + "hstsEnable":"", + "hstsMaxAge":"", + "port":"", + "backendId":"", "loadBalancerId":"", - "description":"", - "regionId":"" - }, - "describe-target-group":{ - "regionId":"", - "targetGroupId":"" - }, - "update-target-group":{ - "description":"", - "targetGroupName":"", - "regionId":"", - "targetGroupId":"" - }, - "delete-target-group":{ - "regionId":"", - "targetGroupId":"" - }, - "register-targets":{ - "targetSpecs":[{ - "instanceId":"", - "type":"", - "port":"", - "weight":"" - }], - "regionId":"", - "targetGroupId":"" - }, - "de-register-targets":{ - "targetIds":[""], - "regionId":"", - "targetGroupId":"" - }, - "update-targets":{ - "targetUpdateSpecs":[{ - "targetId":"", - "port":"", - "weight":"" - }], - "regionId":"", - "targetGroupId":"" - }, - "describe-targets":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"", - "targetGroupId":"" - }, - "describe-url-maps":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" + "urlMapId":"", + "action":"", + "certificateSpecs":[{ + "certificateId":"", + "isDefault":"" }], - "regionId":"" - }, - "create-url-map":{ - "urlMapName":"", - "loadBalancerId":"", + "connectionIdleTimeSeconds":"", "description":"", "regionId":"" }, - "describe-url-map":{ + "describe-listener":{ "regionId":"", - "urlMapId":"" + "listenerId":"" }, - "update-url-map":{ + "update-listener":{ + "listenerName":"", + "status":"", + "hstsEnable":"", + "hstsMaxAge":"", + "certificateSpecs":[{ + "certificateId":"", + "isDefault":"" + }], + "connectionIdleTimeSeconds":"", + "backendId":"", + "urlMapId":"", "description":"", - "urlMapName":"", "regionId":"", - "urlMapId":"" + "listenerId":"" }, - "delete-url-map":{ + "delete-listener":{ "regionId":"", - "urlMapId":"" + "listenerId":"" }, - "add-rules":{ - "ruleSpecs":[{ - "host":"", - "path":"", - "action":"", - "backendId":"" + "add-listener-certificates":{ + "certificates":[{ + "certificateId":"", + "domain":"" }], "regionId":"", - "urlMapId":"" + "listenerId":"" }, - "update-rules":{ - "ruleUpdateSpecs":[{ - "ruleId":"", - "host":"", - "path":"", - "action":"", - "backendId":"" + "update-listener-certificates":{ + "certificates":[{ + "certificateBindId":"", + "certificateId":"", + "domain":"" }], "regionId":"", - "urlMapId":"" + "listenerId":"" }, - "delete-rules":{ - "ruleIds":[""], + "delete-listener-certificates":{ + "certificateBindIds":[""], "regionId":"", - "urlMapId":"" + "listenerId":"" }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/live.json b/jdcloud_cli/resources/skeletons/live.json index 32eba27..00d8133 100644 --- a/jdcloud_cli/resources/skeletons/live.json +++ b/jdcloud_cli/resources/skeletons/live.json @@ -1,43 +1,106 @@ { - "describe-live-app":{ - "pageNum":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }] + "describe-publish-stream-info-data":{ + "domainName":"", + "appName":"", + "streamName":"", + "startTime":"", + "endTime":"" }, - "add-live-app":{ - "publishDomain":"", - "appName":"" + "describe-live-stream-history-user-num":{ + "domainName":"", + "appName":"", + "streamName":"", + "ispName":"", + "locationName":"", + "protocolType":"", + "period":"", + "startTime":"", + "endTime":"" }, - "stop-live-app":{ - "publishDomain":"", - "appName":"" + "describe-live-publish-stream-num":{ + "domainName":"", + "appName":"", + "protocolType":"", + "ispName":"", + "locationName":"", + "period":"", + "startTime":"", + "endTime":"" }, - "describe-live-play-auth-key":{ - "playDomain":"" + "describe-live-stream-player-ranking-data":{ + "domainName":"", + "appName":"", + "protocolType":"", + "startTime":"", + "endTime":"" }, - "set-live-play-auth-key":{ - "playDomain":"", - "authStatus":"", - "authKey":"" + "describe-live-transcode-stream-list":{ + "domainName":"", + "appName":"", + "streamName":"" }, - "describe-live-restart-auth-key":{ - "restartDomain":"" + "describe-live-transcode-stream-num":{ + "domainName":"" }, - "set-live-restart-auth-key":{ - "restartDomain":"", - "authStatus":"", - "authKey":"" + "describe-live-transcode-stream-player-user-num":{ + "domainName":"", + "appName":"", + "ispName":"", + "locationName":"", + "protocolType":"", + "period":"", + "startTime":"", + "endTime":"" }, - "describe-live-bill-data":{ - "filters":[{ - "name":"", - "operator":"", - "values":"" - }] + "describe-live-transcode-stream-bandwidth":{ + "domainName":"", + "appName":"", + "ispName":"", + "locationName":"", + "protocolType":"", + "period":"", + "startTime":"", + "endTime":"" + }, + "describe-domain-online-stream":{ + "domainName":"", + "appName":"", + "streamName":"", + "pageNum":"", + "pageSize":"", + "startTime":"", + "endTime":"" + }, + "describe-domains-log":{ + "domains":"", + "interval":"", + "startTime":"", + "endTime":"" + }, + "describe-url-ranking":{ + "domainName":"", + "size":"", + "rankfield":"", + "startTime":"", + "endTime":"" + }, + "describe-live-stream-publish-info-by-page":{ + "domainName":"", + "appName":"", + "streamName":"", + "startTime":"", + "endTime":"", + "pageNumber":"", + "pageSize":"" + }, + "describe-live-stream-play-info-by-page":{ + "domainName":"", + "appName":"", + "streamName":"", + "startTime":"", + "endTime":"", + "pageNumber":"", + "pageSize":"" }, "describe-live-domain-certificate":{ "playDomain":"" @@ -59,30 +122,75 @@ "key":"", "title":"" }, - "describe-live-domains":{ + "add-live-stream-domain-transcode":{ + "publishDomain":"", + "template":"" + }, + "add-live-stream-app-transcode":{ + "publishDomain":"", + "appName":"", + "template":"" + }, + "add-custom-live-stream-transcode-template":{ + "templateName":"", + "videoCodec":"", + "videoCodeRate":"", + "videoFrameRate":"", + "width":"", + "height":"", + "template":"", + "audioCodec":"", + "audioFormat":"", + "audioSampleRate":"", + "audioChannel":"", + "audioCodeRate":"", + "jdchd":"", + "audioComfort":"" + }, + "describe-custom-live-stream-transcode-templates":{ "pageNum":"", "pageSize":"", - "publishDomain":"" + "filters":[{ + "name":"", + "operator":"", + "values":"" + }] }, - "add-live-domain":{ - "publishDomain":"", - "playDomain":"" + "describe-system-live-stream-transcode-templates":{ + "pageNum":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }] }, - "start-live-domain":{ - "publishDomain":"" + "describe-live-stream-transcode-config":{ + "pageNum":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }] }, - "stop-live-domain":{ - "publishDomain":"" + "delete-live-stream-domain-transcode":{ + "publishDomain":"", + "template":"" }, - "describe-live-domain-detail":{ - "publishDomain":"" + "delete-live-stream-app-transcode":{ + "publishDomain":"", + "appName":"", + "template":"" }, - "delete-live-domain":{ - "publishDomain":"" + "describe-custom-live-stream-transcode-template":{ + "template":"" }, - "add-live-restart-domain":{ - "playDomain":"", - "restartDomain":"" + "delete-custom-live-stream-transcode-template":{ + "template":"" + }, + "describe-transcode-binding":{ + "template":"" }, "add-custom-live-stream-quality-detection-template":{ "template":"", @@ -131,18 +239,35 @@ "describe-quality-detection-binding":{ "template":"" }, - "open-live-p2p":{ + "describe-live-play-auth-key":{ "playDomain":"" }, - "close-live-p2p":{ - "playDomain":"" + "set-live-play-auth-key":{ + "playDomain":"", + "authStatus":"", + "authKey":"" }, - "describe-live-p2p-configs":{ - "pageNumber":"", - "pageSize":"", - "playDomain":"" + "describe-live-restart-auth-key":{ + "restartDomain":"" }, - "describe-custom-live-stream-record-templates":{ + "set-live-restart-auth-key":{ + "restartDomain":"", + "authStatus":"", + "authKey":"" + }, + "add-custom-live-stream-watermark-template":{ + "position":"", + "offsetUnit":"", + "offsetX":"", + "offsetY":"", + "sizeUnit":"", + "width":"", + "height":"", + "template":"", + "uploadId":"", + "url":"" + }, + "describe-custom-live-stream-watermark-templates":{ "pageNum":"", "pageSize":"", "filters":[{ @@ -151,23 +276,16 @@ "values":"" }] }, - "add-custom-live-stream-record-template":{ - "recordPeriod":"", - "saveBucket":"", - "saveEndpoint":"", - "recordFileType":"", - "template":"" - }, - "add-live-stream-app-record":{ + "add-live-stream-app-watermark":{ "publishDomain":"", "appName":"", "template":"" }, - "add-live-stream-domain-record":{ + "add-live-stream-domain-watermark":{ "publishDomain":"", "template":"" }, - "describe-custom-live-stream-record-config":{ + "describe-custom-live-stream-watermark-config":{ "pageNum":"", "pageSize":"", "filters":[{ @@ -176,242 +294,79 @@ "values":"" }] }, - "set-live-stream-record-notify-config":{ - "publishDomain":"", - "notifyUrl":"" - }, - "delete-custom-live-stream-record-template":{ + "delete-custom-live-stream-watermark-template":{ "template":"" }, - "delete-live-stream-app-record":{ + "delete-live-stream-app-watermark":{ "publishDomain":"", "appName":"", "template":"" }, - "delete-live-stream-domain-record":{ + "delete-live-stream-domain-watermark":{ "publishDomain":"", "template":"" }, - "describe-live-stream-record-notify-config":{ - "publishDomain":"" - }, - "delete-live-stream-record-notify-config":{ - "publishDomain":"" - }, - "add-live-record-task":{ - "recordTimes":[{ - "startTime":"", - "endTime":"" - }], - "saveBucket":"", - "saveEndpoint":"", - "recordFileType":"", - "saveObject":"", - "taskExternalId":"", - "publishDomain":"", - "appName":"", - "streamName":"" - }, - "describe-record-binding":{ + "describe-watermark-binding":{ "template":"" }, - "describe-live-statistic-group-by-stream":{ - "domainName":"", - "appName":"", - "streamName":"", - "ispName":"", - "locationName":"", - "period":"", - "startTime":"", - "endTime":"" - }, - "describe-live-statistic-group-by-area":{ - "domainName":"", - "appName":"", - "streamName":"", - "ispName":"", - "locationName":"", - "period":"", - "startTime":"", - "endTime":"" - }, - "describe-live-statistic-group-by-area-isp":{ - "domainName":"", - "appName":"", - "streamName":"", - "ispName":"", - "locationName":"", - "protocolType":"", - "period":"", - "startTime":"", - "endTime":"" - }, - "describe-publish-stream-info-data":{ - "domainName":"", - "appName":"", - "streamName":"", - "startTime":"", - "endTime":"" - }, - "describe-live-stream-history-user-num":{ - "domainName":"", - "appName":"", - "streamName":"", - "ispName":"", - "locationName":"", - "protocolType":"", - "period":"", - "startTime":"", - "endTime":"" - }, - "describe-live-publish-stream-num":{ - "domainName":"", - "appName":"", - "protocolType":"", - "ispName":"", - "locationName":"", - "period":"", - "startTime":"", - "endTime":"" - }, - "describe-live-stream-player-ranking-data":{ - "domainName":"", - "appName":"", - "protocolType":"", - "startTime":"", - "endTime":"" - }, - "describe-live-transcode-stream-list":{ - "domainName":"", - "appName":"", - "streamName":"" - }, - "describe-live-transcode-stream-num":{ - "domainName":"" - }, - "describe-live-transcode-stream-player-user-num":{ - "domainName":"", - "appName":"", - "ispName":"", - "locationName":"", - "protocolType":"", - "period":"", + "create-live-forward-task":{ + "sourceUrl":"", + "pushUrl":"", + "startMode":"", "startTime":"", - "endTime":"" - }, - "describe-live-transcode-stream-bandwidth":{ - "domainName":"", - "appName":"", - "ispName":"", - "locationName":"", - "protocolType":"", - "period":"", + "endTime":"", + "callbackEvents":[""], + "callbackUrl":"", + "name":"" + }, + "update-live-forward-task":{ + "taskId":"", + "sourceUrl":"", + "pushUrl":"", "startTime":"", - "endTime":"" + "endTime":"", + "callbackEvents":[""], + "callbackUrl":"", + "name":"" }, - "describe-domain-online-stream":{ - "domainName":"", - "appName":"", - "streamName":"", + "query-live-forward-task":{ "pageNum":"", "pageSize":"", - "startTime":"", - "endTime":"" - }, - "describe-domains-log":{ - "domains":"", - "interval":"", - "startTime":"", - "endTime":"" - }, - "describe-url-ranking":{ - "domainName":"", - "size":"", - "rankfield":"", - "startTime":"", - "endTime":"" - }, - "describe-live-transcoding-duration-data":{ - "grade":"", - "period":"", - "startTime":"", - "endTime":"" + "filters":[{ + "name":"", + "operator":"", + "values":"" + }] }, - "describe-live-file-storage-data":{ - "period":"", - "startTime":"", - "endTime":"" + "start-live-forward-task":{ + "taskIds":"" }, - "describe-live-stream-bandwidth-data":{ - "domainName":"", - "appName":"", - "streamName":"", - "ispName":"", - "locationName":"", - "protocolType":"", - "period":"", - "startTime":"", - "endTime":"" + "stop-live-forward-task":{ + "taskIds":"" }, - "describe-live-stream-publish-bandwidth-data":{ - "domainName":"", - "appName":"", - "streamName":"", - "ispName":"", - "locationName":"", - "protocolType":"", - "period":"", - "startTime":"", - "endTime":"" + "delete-live-forward-task":{ + "taskIds":"" }, - "describe-live-stream-traffic-data":{ - "domainName":"", - "appName":"", - "streamName":"", - "ispName":"", - "locationName":"", - "protocolType":"", - "period":"", - "startTime":"", - "endTime":"" + "delete-live-recordings":{ + "fileUrl":"", + "completely":"" }, - "describe-live-stream-publish-traffic-data":{ - "domainName":"", - "appName":"", - "streamName":"", - "ispName":"", - "locationName":"", - "protocolType":"", - "period":"", - "startTime":"", - "endTime":"" + "add-live-stream-domain-translate":{ + "publishDomain":"", + "template":"" }, - "describe-live-snapshot-data":{ + "add-live-stream-app-translate":{ "publishDomain":"", "appName":"", - "streamName":"", - "startTime":"", - "endTime":"" + "template":"" }, - "describe-live-porn-data":{ + "add-live-stream-translate":{ "publishDomain":"", "appName":"", "streamName":"", - "startTime":"", - "endTime":"" - }, - "add-custom-live-stream-snapshot-template":{ - "format":"", - "width":"", - "height":"", - "fillType":"", - "snapshotInterval":"", - "saveMode":"", - "saveBucket":"", - "saveEndpoint":"", "template":"" }, - "describe-custom-live-stream-snapshot-config":{ + "describe-system-live-stream-translate-templates":{ "pageNum":"", "pageSize":"", "filters":[{ @@ -420,7 +375,7 @@ "values":"" }] }, - "describe-custom-live-stream-snapshot-templates":{ + "describe-live-stream-translate-config":{ "pageNum":"", "pageSize":"", "filters":[{ @@ -429,39 +384,40 @@ "values":"" }] }, - "add-live-stream-app-snapshot":{ - "publishDomain":"", - "appName":"", - "template":"" + "describe-live-domain-translate-config":{ + "filters":[{ + "name":"", + "operator":"", + "values":"" + }] }, - "add-live-stream-domain-snapshot":{ + "delete-live-stream-domain-translate":{ "publishDomain":"", "template":"" }, - "set-live-stream-snapshot-notify-config":{ + "delete-live-stream-app-translate":{ "publishDomain":"", - "notifyUrl":"" - }, - "delete-custom-live-stream-snapshot-template":{ + "appName":"", "template":"" }, - "delete-live-stream-app-snapshot":{ + "delete-live-stream-translate":{ "publishDomain":"", "appName":"", + "streamName":"", "template":"" }, - "delete-live-stream-domain-snapshot":{ - "publishDomain":"", + "describe-translate-binding":{ "template":"" }, - "describe-live-stream-snapshot-notify-config":{ - "publishDomain":"" - }, - "delete-live-stream-snapshot-notify-config":{ - "publishDomain":"" + "pause-live-stream-translate":{ + "publishDomain":"", + "appName":"", + "streamName":"" }, - "describe-snapshot-binding":{ - "template":"" + "resume-live-stream-translate":{ + "publishDomain":"", + "appName":"", + "streamName":"" }, "forbid-live-stream":{ "publishDomain":"", @@ -509,6 +465,13 @@ "endTime":"", "publishDomain":"" }, + "describe-live-bill-data":{ + "filters":[{ + "name":"", + "operator":"", + "values":"" + }] + }, "open-live-restart":{ "restartDomain":"" }, @@ -520,43 +483,29 @@ "pageSize":"", "restartDomain":"" }, - "open-live-timeshift":{ + "open-live-p2p":{ "playDomain":"" }, - "close-live-timeshift":{ + "close-live-p2p":{ "playDomain":"" }, - "describe-live-timeshift-configs":{ + "describe-live-p2p-configs":{ "pageNumber":"", "pageSize":"", "playDomain":"" }, - "add-live-stream-domain-transcode":{ - "publishDomain":"", - "template":"" - }, - "add-live-stream-app-transcode":{ - "publishDomain":"", - "appName":"", - "template":"" - }, - "add-custom-live-stream-transcode-template":{ - "templateName":"", - "videoCodec":"", - "videoCodeRate":"", - "videoFrameRate":"", + "add-custom-live-stream-snapshot-template":{ + "format":"", "width":"", "height":"", - "template":"", - "audioCodec":"", - "audioFormat":"", - "audioSampleRate":"", - "audioChannel":"", - "audioCodeRate":"", - "jdchd":"", - "audioComfort":"" + "fillType":"", + "snapshotInterval":"", + "saveMode":"", + "saveBucket":"", + "saveEndpoint":"", + "template":"" }, - "describe-custom-live-stream-transcode-templates":{ + "describe-custom-live-stream-snapshot-config":{ "pageNum":"", "pageSize":"", "filters":[{ @@ -565,7 +514,7 @@ "values":"" }] }, - "describe-system-live-stream-transcode-templates":{ + "describe-custom-live-stream-snapshot-templates":{ "pageNum":"", "pageSize":"", "filters":[{ @@ -574,46 +523,66 @@ "values":"" }] }, - "describe-live-stream-transcode-config":{ - "pageNum":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }] + "add-live-stream-app-snapshot":{ + "publishDomain":"", + "appName":"", + "template":"" }, - "delete-live-stream-domain-transcode":{ + "add-live-stream-domain-snapshot":{ "publishDomain":"", "template":"" }, - "delete-live-stream-app-transcode":{ + "set-live-stream-snapshot-notify-config":{ "publishDomain":"", - "appName":"", + "notifyUrl":"" + }, + "delete-custom-live-stream-snapshot-template":{ "template":"" }, - "describe-custom-live-stream-transcode-template":{ + "delete-live-stream-app-snapshot":{ + "publishDomain":"", + "appName":"", "template":"" }, - "delete-custom-live-stream-transcode-template":{ + "delete-live-stream-domain-snapshot":{ + "publishDomain":"", "template":"" }, - "describe-transcode-binding":{ + "describe-live-stream-snapshot-notify-config":{ + "publishDomain":"" + }, + "delete-live-stream-snapshot-notify-config":{ + "publishDomain":"" + }, + "describe-snapshot-binding":{ "template":"" }, - "add-custom-live-stream-watermark-template":{ - "position":"", - "offsetUnit":"", - "offsetX":"", - "offsetY":"", - "sizeUnit":"", - "width":"", - "height":"", - "template":"", - "uploadId":"", - "url":"" + "describe-live-domains":{ + "pageNum":"", + "pageSize":"", + "publishDomain":"" }, - "describe-custom-live-stream-watermark-templates":{ + "add-live-domain":{ + "publishDomain":"", + "playDomain":"" + }, + "start-live-domain":{ + "publishDomain":"" + }, + "stop-live-domain":{ + "publishDomain":"" + }, + "describe-live-domain-detail":{ + "publishDomain":"" + }, + "delete-live-domain":{ + "publishDomain":"" + }, + "add-live-restart-domain":{ + "playDomain":"", + "restartDomain":"" + }, + "describe-custom-live-stream-record-templates":{ "pageNum":"", "pageSize":"", "filters":[{ @@ -622,16 +591,23 @@ "values":"" }] }, - "add-live-stream-app-watermark":{ + "add-custom-live-stream-record-template":{ + "recordPeriod":"", + "saveBucket":"", + "saveEndpoint":"", + "recordFileType":"", + "template":"" + }, + "add-live-stream-app-record":{ "publishDomain":"", "appName":"", "template":"" }, - "add-live-stream-domain-watermark":{ + "add-live-stream-domain-record":{ "publishDomain":"", "template":"" }, - "describe-custom-live-stream-watermark-config":{ + "describe-custom-live-stream-record-config":{ "pageNum":"", "pageSize":"", "filters":[{ @@ -640,19 +616,183 @@ "values":"" }] }, - "delete-custom-live-stream-watermark-template":{ + "set-live-stream-record-notify-config":{ + "publishDomain":"", + "notifyUrl":"" + }, + "delete-custom-live-stream-record-template":{ "template":"" }, - "delete-live-stream-app-watermark":{ + "delete-live-stream-app-record":{ "publishDomain":"", "appName":"", "template":"" }, - "delete-live-stream-domain-watermark":{ + "delete-live-stream-domain-record":{ "publishDomain":"", "template":"" }, - "describe-watermark-binding":{ + "describe-live-stream-record-notify-config":{ + "publishDomain":"" + }, + "delete-live-stream-record-notify-config":{ + "publishDomain":"" + }, + "add-live-record-task":{ + "recordTimes":[{ + "startTime":"", + "endTime":"" + }], + "saveBucket":"", + "saveEndpoint":"", + "recordFileType":"", + "saveObject":"", + "taskExternalId":"", + "publishDomain":"", + "appName":"", + "streamName":"" + }, + "describe-record-binding":{ "template":"" }, + "describe-live-app":{ + "pageNum":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }] + }, + "add-live-app":{ + "publishDomain":"", + "appName":"" + }, + "stop-live-app":{ + "publishDomain":"", + "appName":"" + }, + "describe-live-transcoding-duration-data":{ + "domainName":"", + "grade":"", + "period":"", + "startTime":"", + "endTime":"" + }, + "describe-live-file-storage-data":{ + "period":"", + "startTime":"", + "endTime":"" + }, + "describe-live-stream-bandwidth-data":{ + "domainName":"", + "appName":"", + "streamName":"", + "ispName":"", + "locationName":"", + "protocolType":"", + "period":"", + "startTime":"", + "endTime":"" + }, + "describe-live-stream-publish-bandwidth-data":{ + "domainName":"", + "appName":"", + "streamName":"", + "ispName":"", + "locationName":"", + "protocolType":"", + "period":"", + "startTime":"", + "endTime":"" + }, + "describe-live-stream-traffic-data":{ + "domainName":"", + "appName":"", + "streamName":"", + "ispName":"", + "locationName":"", + "protocolType":"", + "period":"", + "startTime":"", + "endTime":"" + }, + "describe-live-stream-publish-traffic-data":{ + "domainName":"", + "appName":"", + "streamName":"", + "ispName":"", + "locationName":"", + "protocolType":"", + "period":"", + "startTime":"", + "endTime":"" + }, + "describe-live-snapshot-data":{ + "publishDomain":"", + "appName":"", + "streamName":"", + "shotMode":"", + "startTime":"", + "endTime":"" + }, + "describe-live-porn-data":{ + "publishDomain":"", + "appName":"", + "streamName":"", + "startTime":"", + "endTime":"" + }, + "describe-live-statistic-group-by-stream":{ + "domainName":"", + "appName":"", + "streamName":"", + "ispName":"", + "locationName":"", + "period":"", + "startTime":"", + "endTime":"" + }, + "describe-live-statistic-group-by-area":{ + "domainName":"", + "appName":"", + "streamName":"", + "ispName":"", + "locationName":"", + "period":"", + "startTime":"", + "endTime":"" + }, + "describe-live-statistic-group-by-area-isp":{ + "domainName":"", + "appName":"", + "streamName":"", + "ispName":"", + "locationName":"", + "protocolType":"", + "period":"", + "startTime":"", + "endTime":"" + }, + "describe-live-publish-statistic-group-by-stream":{ + "domainName":"", + "appName":"", + "streamName":"", + "ispName":"", + "locationName":"", + "period":"", + "startTime":"", + "endTime":"" + }, + "open-live-timeshift":{ + "playDomain":"" + }, + "close-live-timeshift":{ + "playDomain":"" + }, + "describe-live-timeshift-configs":{ + "pageNumber":"", + "pageSize":"", + "playDomain":"" + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/logs.json b/jdcloud_cli/resources/skeletons/logs.json index f04a0b4..c9d07e8 100644 --- a/jdcloud_cli/resources/skeletons/logs.json +++ b/jdcloud_cli/resources/skeletons/logs.json @@ -4,16 +4,31 @@ "collectInfoUID":"" }, "update-collect-info":{ + "agResource":[{ + "agId":"", + "agName":"", + "region":"" + }], "enabled":"", + "filterEnabled":"", + "logCustomTarget":"", + "logCustomTargetConf":"", + "logFile":"", + "logFilters":[""], + "logPath":"", + "logtopicEnabled":"", + "regexpStr":"", + "resourceMode":"", "resourceType":"", "resources":[{ "region":"", "resourceId":"" }], - "logPath":"", - "logFile":"", - "logFilters":[""], - "filterEnabled":"", + "tagResource":{ + "region":"", + "tagKey":"", + "tagValue":"" + }, "regionId":"", "collectInfoUID":"" }, @@ -33,60 +48,143 @@ "collectInfoUID":"" }, "create-collect-info":{ - "enabled":"", + "agResource":[{ + "agId":"", + "agName":"", + "region":"" + }], "appCode":"", - "serviceCode":"", + "enabled":"", + "filterEnabled":"", + "logCustomTarget":"", + "logCustomTargetConf":"", + "logFile":"", + "logFilters":[""], + "logPath":"", + "logtopicEnabled":"", + "regexpStr":"", + "resourceMode":"", "resourceType":"", "resources":[{ "region":"", "resourceId":"" }], + "serviceCode":"", + "tagResource":{ + "region":"", + "tagKey":"", + "tagValue":"" + }, "templateUID":"", - "logPath":"", - "logFile":"", - "logFilters":[""], - "filterEnabled":"", "regionId":"", "logtopicUID":"" }, - "describe-logd-ca":{ + "create-parser":{ + "parserFields":[{ + "fieldFormat":"", + "fieldType":"", + "fieldValue":"", + "index":"", + "name":"" + }], + "parserMode":"", + "parserPattern":"", + "parserSample":"", + "pipelines":[{ + "field":"", + "fieldType":"", + "parserMode":"", + "parserPattern":"", + "parserSample":"" + }], "regionId":"", - "instanceId":"" + "logtopicUID":"" }, - "describe-instance-collect-confs":{ + "describe-parser":{ "regionId":"", - "instanceId":"" + "logtopicUID":"" }, - "describe-logsets":{ - "pageNumber":"", - "pageSize":"", - "name":"", - "regionId":"" + "update-parser":{ + "parserFields":[{ + "fieldFormat":"", + "fieldType":"", + "fieldValue":"", + "index":"", + "name":"" + }], + "parserMode":"", + "parserPattern":"", + "parserSample":"", + "pipelines":[{ + "field":"", + "fieldType":"", + "parserMode":"", + "parserPattern":"", + "parserSample":"" + }], + "regionId":"", + "logtopicUID":"" }, - "create-logset":{ - "name":"", - "description":"", - "lifeCycle":"", - "regionId":"" + "validate-parser":{ + "parserMode":"", + "parserPattern":"", + "parserSample":"", + "pipelines":[{ + "field":"", + "fieldType":"", + "parserMode":"", + "parserPattern":"", + "parserSample":"" + }] }, - "describe-logset":{ + "histograms":{ + "action":"", + "expr":"", + "caseSensitive":"", + "startTime":"", + "endTime":"", "regionId":"", - "logsetUID":"" + "logsetUID":"", + "logtopicUID":"" }, - "update-logset":{ - "description":"", - "lifeCycle":"", + "get-logs":{ + "taskID":"", + "expr":"", + "startTime":"", + "endTime":"", + "sort":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], "regionId":"", - "logsetUID":"" + "logsetUID":"", + "logtopicUID":"" }, - "delete-logset":{ + "search":{ + "action":"", + "expr":"", + "caseSensitive":"", + "startTime":"", + "endTime":"", + "pageNumber":"", + "pageSize":"", + "sort":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], "regionId":"", - "logsetUIDs":"" + "logsetUID":"", + "logtopicUID":"" }, "describe-logtopics":{ "pageNumber":"", "pageSize":"", "name":"", + "appName":"", "regionId":"", "logsetUID":"" }, @@ -110,49 +208,140 @@ "regionId":"", "logtopicUID":"" }, - "put":{ - "stream":"", - "timestamp":"", - "tags":"", - "entries":[{ - "content":"", - "stream":"", - "tags":"", - "timestamp":"" - }], - "logtopicUID":"" - }, - "search-log-context":{ - "anchor":[""], - "direction":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "id":"", - "lineSize":"", - "time":"", + "test-metric-task":{ + "aggregate":"", + "content":[""], + "dataField":"", + "filterContent":"", + "filterOpen":"", + "filterType":"", + "metric":"", + "settingType":"", + "sqlSpec":{ + "expr":"" + }, "regionId":"", "logsetUID":"", "logtopicUID":"" }, - "search":{ - "action":"", - "expr":"", - "caseSensitive":"", - "startTime":"", - "endTime":"", + "describe-metric-tasks":{ "pageNumber":"", "pageSize":"", - "sort":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" + "regionId":"", + "logsetUID":"", + "logtopicUID":"" + }, + "create-metric-task":{ + "aggregate":"", + "customUnit":"", + "dataField":"", + "filterContent":"", + "filterOpen":"", + "filterType":"", + "interval":"", + "metric":"", + "name":"", + "settingType":"", + "sqlSpec":{ + "expr":"" + }, + "unit":"", + "regionId":"", + "logsetUID":"", + "logtopicUID":"" + }, + "describe-metric-task":{ + "regionId":"", + "logsetUID":"", + "logtopicUID":"", + "logmetrictaskUID":"" + }, + "update-metric-task":{ + "aggregate":"", + "customUnit":"", + "dataField":"", + "filterContent":"", + "filterOpen":"", + "filterType":"", + "metric":"", + "name":"", + "settingType":"", + "sqlSpec":{ + "expr":"" + }, + "unit":"", + "regionId":"", + "logsetUID":"", + "logtopicUID":"", + "logmetrictaskUID":"" + }, + "delete-metric-task":{ + "regionId":"", + "logsetUID":"", + "logtopicUID":"", + "logmetrictaskUID":"" + }, + "create-parser":{ + "parserFields":[{ + "fieldFormat":"", + "fieldType":"", + "fieldValue":"", + "index":"", + "name":"" + }], + "parserMode":"", + "parserPattern":"", + "parserSample":"", + "pipelines":[{ + "field":"", + "fieldType":"", + "parserMode":"", + "parserPattern":"", + "parserSample":"" }], + "regionId":"", + "logtopicUID":"" + }, + "describe-subscribe":{ + "regionId":"", + "logsetUID":"", + "logtopicUID":"" + }, + "create-subscribe":{ "regionId":"", "logsetUID":"", "logtopicUID":"" }, + "update-subscribe":{ + "status":"", + "regionId":"", + "logsetUID":"", + "logtopicUID":"" + }, + "describe-logsets":{ + "pageNumber":"", + "pageSize":"", + "name":"", + "regionId":"" + }, + "create-logset":{ + "name":"", + "description":"", + "lifeCycle":"", + "regionId":"" + }, + "describe-logset":{ + "regionId":"", + "logsetUID":"" + }, + "update-logset":{ + "description":"", + "lifeCycle":"", + "regionId":"", + "logsetUID":"" + }, + "delete-logset":{ + "regionId":"", + "logsetUIDs":"" + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/mongodb.json b/jdcloud_cli/resources/skeletons/mongodb.json index bb5966f..aee38e5 100644 --- a/jdcloud_cli/resources/skeletons/mongodb.json +++ b/jdcloud_cli/resources/skeletons/mongodb.json @@ -1,4 +1,38 @@ { + "describe-security-ips":{ + "regionId":"", + "instanceId":"" + }, + "modify-security-ips":{ + "modifyMode":"", + "securityIps":"", + "regionId":"", + "instanceId":"" + }, + "describe-backups":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-backup":{ + "instanceId":"", + "backupName":"", + "backupMethod":"", + "regionId":"" + }, + "delete-backup":{ + "regionId":"", + "backupId":"" + }, + "backup-download-url":{ + "regionId":"", + "backupId":"" + }, "describe-instances":{ "pageNumber":"", "pageSize":"", @@ -132,30 +166,6 @@ "instanceId":"", "nodeId":"" }, - "describe-backups":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, - "create-backup":{ - "instanceId":"", - "backupName":"", - "backupMethod":"", - "regionId":"" - }, - "delete-backup":{ - "regionId":"", - "backupId":"" - }, - "backup-download-url":{ - "regionId":"", - "backupId":"" - }, "describe-backup-synchronicities":{ "pageNumber":"", "pageSize":"", @@ -176,14 +186,4 @@ "regionId":"", "serviceId":"" }, - "describe-security-ips":{ - "regionId":"", - "instanceId":"" - }, - "modify-security-ips":{ - "modifyMode":"", - "securityIps":"", - "regionId":"", - "instanceId":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/monitor.json b/jdcloud_cli/resources/skeletons/monitor.json index 5f18693..7cd0e08 100644 --- a/jdcloud_cli/resources/skeletons/monitor.json +++ b/jdcloud_cli/resources/skeletons/monitor.json @@ -2,6 +2,7 @@ "describe-alarms":{ "pageNumber":"", "pageSize":"", + "dataOwner":"", "serviceCode":"", "product":"", "dimension":"", @@ -21,8 +22,15 @@ "referenceType":"" }], "clientToken":"", + "dataOwner":"", "dimension":"", "enabled":"", + "multiWebHook":[{ + "webHookContent":"", + "webHookProtocol":"", + "webHookSecret":"", + "webHookUrl":"" + }], "noticeOption":[{ "effectiveIntervalEnd":"", "effectiveIntervalStart":"", @@ -36,7 +44,9 @@ "tagsOption":{ "operator":"", "tags":[""] - } + }, + "resourceGroups":"", + "resourceFilterType":"" }, "ruleName":"", "ruleOption":{ @@ -64,8 +74,15 @@ "referenceId":"", "referenceType":"" }], + "dataOwner":"", "dimension":"", "enabled":"", + "multiWebHook":[{ + "webHookContent":"", + "webHookProtocol":"", + "webHookSecret":"", + "webHookUrl":"" + }], "noticeOption":[{ "effectiveIntervalEnd":"", "effectiveIntervalStart":"", @@ -79,7 +96,9 @@ "tagsOption":{ "operator":"", "tags":[""] - } + }, + "resourceGroups":"", + "resourceFilterType":"" }, "ruleName":"", "ruleOption":{ @@ -125,6 +144,7 @@ "describe-alarm-history":{ "pageNumber":"", "pageSize":"", + "dataOwner":"", "serviceCode":"", "product":"", "dimension":"", @@ -145,7 +165,7 @@ "dimension":"", "type":"" }, - "describe-one-data-point":{ + "last-downsample":{ "serviceCode":"", "dimension":"", "resourceId":"", @@ -158,6 +178,7 @@ "timeInterval":"", "aggrType":"", "downAggrType":"", + "timeOffset":"", "regionId":"", "metric":"" }, @@ -179,6 +200,20 @@ "regionId":"", "metric":"" }, + "describe-tag-values":{ + "serviceCode":"", + "resourceId":"", + "metric":"", + "startTime":"", + "endTime":"", + "timeInterval":"", + "tags":[{ + "key":"", + "values":"" + }], + "regionId":"", + "tagKey":"" + }, "describe-services":{ "filters":[{ "Name":"", @@ -186,6 +221,30 @@ }], "productType":"" }, + "put-product-metric-data":{ + "appCode":"", + "serviceCode":"", + "region":"", + "resourceId":"", + "dataPoints":[{ + "metric":"", + "tags":"", + "timestamp":"", + "value":"" + }] + }, + "put-product-metric-data":{ + "appCode":"", + "serviceCode":"", + "region":"", + "resourceId":"", + "dataPoints":[{ + "metric":"", + "tags":"", + "timestamp":"", + "value":"" + }] + }, "put-custom-metric-data":{ "metricDataList":[{ "namespace":"", @@ -208,4 +267,17 @@ "unit":"" }] }, + "describe-custom-metric-data":{ + "endTime":"", + "query":{ + "aggrType":"", + "dimensions":[""], + "downSampleType":"", + "metric":"" + }, + "startTime":"", + "timeInterval":"", + "regionId":"", + "namespaceUID":"" + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/nativecontainer.json b/jdcloud_cli/resources/skeletons/nativecontainer.json index 6f3d58c..bb80209 100644 --- a/jdcloud_cli/resources/skeletons/nativecontainer.json +++ b/jdcloud_cli/resources/skeletons/nativecontainer.json @@ -1,4 +1,37 @@ { + "describe-secrets":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-secret":{ + "name":"", + "secretType":"", + "data":{ + "server":"", + "username":"", + "password":"", + "email":"" + }, + "regionId":"" + }, + "describe-secret":{ + "regionId":"", + "name":"" + }, + "delete-secret":{ + "regionId":"", + "name":"" + }, + "describe-quota":{ + "resourceType":"", + "regionId":"" + }, "describe-containers":{ "pageNumber":"", "pageSize":"", @@ -40,6 +73,7 @@ "diskSizeGB":"", "iops":"", "snapshotId":"", + "policyId":"", "charge":{ "chargeMode":"", "chargeUnit":"", @@ -90,7 +124,8 @@ "chargeDuration":"", "autoRenew":"", "buyScenario":"" - } + }, + "userTags":[""] }, "maxCount":"", "clientToken":"", @@ -180,37 +215,4 @@ }], "regionId":"" }, - "describe-quota":{ - "resourceType":"", - "regionId":"" - }, - "describe-secrets":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, - "create-secret":{ - "name":"", - "secretType":"", - "data":{ - "server":"", - "username":"", - "password":"", - "email":"" - }, - "regionId":"" - }, - "describe-secret":{ - "regionId":"", - "name":"" - }, - "delete-secret":{ - "regionId":"", - "name":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/nc.json b/jdcloud_cli/resources/skeletons/nc.json index f1e6438..61c4330 100644 --- a/jdcloud_cli/resources/skeletons/nc.json +++ b/jdcloud_cli/resources/skeletons/nc.json @@ -1,4 +1,37 @@ { + "describe-secrets":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-secret":{ + "name":"", + "secretType":"", + "data":{ + "server":"", + "username":"", + "password":"", + "email":"" + }, + "regionId":"" + }, + "describe-secret":{ + "regionId":"", + "name":"" + }, + "delete-secret":{ + "regionId":"", + "name":"" + }, + "describe-quota":{ + "resourceType":"", + "regionId":"" + }, "describe-containers":{ "pageNumber":"", "pageSize":"", @@ -36,6 +69,7 @@ "diskSizeGB":"", "iops":"", "snapshotId":"", + "policyId":"", "charge":{ "chargeMode":"", "chargeUnit":"", @@ -134,37 +168,4 @@ "regionId":"", "containerId":"" }, - "describe-quota":{ - "resourceType":"", - "regionId":"" - }, - "describe-secrets":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, - "create-secret":{ - "name":"", - "secretType":"", - "data":{ - "server":"", - "username":"", - "password":"", - "email":"" - }, - "regionId":"" - }, - "describe-secret":{ - "regionId":"", - "name":"" - }, - "delete-secret":{ - "regionId":"", - "name":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/ossopenapi.json b/jdcloud_cli/resources/skeletons/ossopenapi.json index 6bab712..5eb49dd 100644 --- a/jdcloud_cli/resources/skeletons/ossopenapi.json +++ b/jdcloud_cli/resources/skeletons/ossopenapi.json @@ -42,4 +42,31 @@ "regionId":"", "bucketName":"" }, + "get-historical-replicat-task":{ + "regionId":"", + "bucketName":"", + "taskId":"" + }, + "abort-historical-replicat-task":{ + "regionId":"", + "bucketName":"", + "taskId":"" + }, + "list-historical-replicat-tasks":{ + "marker":"", + "limit":"", + "regionId":"", + "bucketName":"" + }, + "create-historical-replicat-task":{ + "action":"", + "bucketName":"", + "bucketRegion":"", + "targetBucketName":"", + "targetBucketRegion":"", + "storageClass":"", + "prefixSet":[""], + "regionId":"", + "bucketName":"" + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/pod.json b/jdcloud_cli/resources/skeletons/pod.json index 7dee070..64a0a07 100644 --- a/jdcloud_cli/resources/skeletons/pod.json +++ b/jdcloud_cli/resources/skeletons/pod.json @@ -1,4 +1,62 @@ { + "describe-secrets":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-secret":{ + "name":"", + "secretType":"", + "data":{ + "server":"", + "username":"", + "password":"", + "email":"" + }, + "regionId":"" + }, + "describe-secret":{ + "regionId":"", + "name":"" + }, + "delete-secret":{ + "regionId":"", + "name":"" + }, + "create-config-file":{ + "name":"", + "data":[{ + "key":"", + "value":"" + }], + "regionId":"" + }, + "describe-config-file":{ + "regionId":"", + "name":"" + }, + "delete-config-file":{ + "regionId":"", + "name":"" + }, + "update-config-file":{ + "name":"", + "data":[{ + "key":"", + "value":"" + }], + "regionId":"", + "name":"" + }, + "describe-quota":{ + "resourceType":"", + "regionId":"" + }, "describe-container":{ "regionId":"", "podId":"", @@ -25,14 +83,6 @@ "podId":"", "containerName":"" }, - "describe-instance-types":{ - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, "describe-pods":{ "pageNumber":"", "pageSize":"", @@ -56,6 +106,7 @@ "terminationGracePeriodSeconds":"", "instanceType":"", "az":"", + "agId":"", "dnsConfig":{ "nameservers":"", "searches":"", @@ -97,9 +148,11 @@ "secondaryIpCount":"", "securityGroups":"", "sanityCheck":"", - "description":"" + "description":"", + "ipv6AddressCount":"" } - } + }, + "userTags":[""] }, "maxCount":"", "clientToken":"", @@ -224,13 +277,7 @@ "regionId":"", "podId":"" }, - "describe-quota":{ - "resourceType":"", - "regionId":"" - }, - "describe-secrets":{ - "pageNumber":"", - "pageSize":"", + "describe-instance-types":{ "filters":[{ "name":"", "operator":"", @@ -238,23 +285,4 @@ }], "regionId":"" }, - "create-secret":{ - "name":"", - "secretType":"", - "data":{ - "server":"", - "username":"", - "password":"", - "email":"" - }, - "regionId":"" - }, - "describe-secret":{ - "regionId":"", - "name":"" - }, - "delete-secret":{ - "regionId":"", - "name":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/rds.json b/jdcloud_cli/resources/skeletons/rds.json index aa263f1..99d9b93 100644 --- a/jdcloud_cli/resources/skeletons/rds.json +++ b/jdcloud_cli/resources/skeletons/rds.json @@ -1,4 +1,22 @@ { + "describe-binlogs":{ + "pageNumber":"", + "pageSize":"", + "startTime":"", + "endTime":"", + "regionId":"", + "instanceId":"" + }, + "describe-binlog-download-url":{ + "seconds":"", + "regionId":"", + "instanceId":"", + "binlogBackupId":"" + }, + "clear-binlogs":{ + "regionId":"", + "instanceId":"" + }, "describe-accounts":{ "pageNumber":"", "pageSize":"", @@ -56,225 +74,21 @@ "instanceId":"", "accountName":"" }, - "describe-audit":{ - "regionId":"", - "instanceId":"" - }, - "create-audit":{ - "enabled":"", - "regionId":"", - "instanceId":"" - }, - "delete-audit":{ - "regionId":"", - "instanceId":"" - }, - "describe-audit-options":{ - "name":"", - "regionId":"", - "instanceId":"" - }, - "modify-audit":{ - "add":"", - "drop":"", - "regionId":"", - "instanceId":"" - }, - "describe-audit-files":{ - "regionId":"", - "instanceId":"" - }, - "describe-audit-download-url":{ - "fileName":"", - "regionId":"", - "instanceId":"" - }, - "enable-audit":{ - "regionId":"", - "instanceId":"" - }, - "disable-audit":{ - "regionId":"", - "instanceId":"" - }, - "describe-audit-result":{ - "startTime":"", - "endTime":"", - "dbName":"", - "accountName":"", - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"", - "instanceId":"" - }, - "describe-azs":{ - "engine":"", - "regionId":"" - }, - "describe-backups":{ - "instanceId":"", - "auto":"", - "backupTypeFilter":"", - "dbNameFilter":"", - "backupTimeRangeStartFilter":"", - "backupTimeRangeEndFilter":"", - "pageNumber":"", - "pageSize":"", - "regionId":"" - }, - "create-backup":{ - "instanceId":"", - "backupSpec":{ - "backupName":"", - "dbNames":"" - }, - "regionId":"" - }, - "delete-backup":{ - "regionId":"", - "backupId":"" - }, - "describe-backup-download-url":{ - "fileName":"", - "urlExpirationSecond":"", - "regionId":"", - "backupId":"" - }, - "describe-backup-synchronicities":{ - "pageNumber":"", - "pageSize":"", - "regionId":"" - }, - "create-backup-synchronicity":{ - "instanceId":"", - "destRegion":"", - "regionId":"" - }, - "delete-backup-synchronicity":{ - "regionId":"", - "serviceId":"" - }, - "create-instance-by-time-in-cross-region":{ - "restoreTime":"", - "serviceId":"", - "instanceSpec":{ - "instanceName":"", - "instanceClass":"", - "instanceStorageGB":"", - "azId":"", - "vpcId":"", - "subnetId":"", - "parameterGroup":"", - "chargeSpec":{ - "chargeMode":"", - "chargeUnit":"", - "chargeDuration":"", - "autoRenew":"", - "buyScenario":"" - }, - "instanceStorageType":"", - "instancePort":"", - "storageEncrypted":"", - "instanceType":"" - }, - "regionId":"" - }, - "describe-binlogs":{ - "pageNumber":"", - "pageSize":"", - "startTime":"", - "endTime":"", - "regionId":"", - "instanceId":"" - }, - "describe-binlog-download-url":{ - "seconds":"", - "regionId":"", - "instanceId":"", - "binlogBackupId":"" - }, - "clear-binlogs":{ - "regionId":"", - "instanceId":"" - }, - "alter-table-with-online-ddl":{ - "database":"", - "table":"", - "command":"", - "regionId":"", - "instanceId":"" - }, - "describe-privilege":{ - "engine":"", - "regionId":"" - }, - "describe-databases":{ - "dbName":"", - "pageNumber":"", - "pageSize":"", - "regionId":"", - "instanceId":"" - }, - "create-database":{ - "dbName":"", - "characterSetName":"", - "regionId":"", - "instanceId":"" - }, - "delete-database":{ - "regionId":"", - "instanceId":"", - "dbName":"" - }, - "restore-database-from-backup":{ - "backupId":"", - "backupFileName":"", - "regionId":"", - "instanceId":"", - "dbName":"" - }, - "restore-database-from-file":{ - "sharedFileGid":"", - "fileName":"", - "regionId":"", - "instanceId":"", - "dbName":"" - }, - "restore-database-from-oss":{ - "ossURL":"", - "regionId":"", - "instanceId":"", - "dbName":"" - }, - "describe-error-logs":{ + "describe-accounts-for-ops":{ "regionId":"", "instanceId":"" }, - "describe-import-files":{ + "create-account-for-ops":{ + "expiredTime":"", "regionId":"", "instanceId":"" }, - "get-upload-key":{ + "modify-account-for-ops":{ + "expiredTime":"", + "globalPrivileges":"", "regionId":"", "instanceId":"" }, - "set-import-file-shared":{ - "shared":"", - "regionId":"", - "instanceId":"", - "fileName":"" - }, - "delete-import-file":{ - "sharedFileGid":"", - "regionId":"", - "instanceId":"", - "fileName":"" - }, "describe-instances":{ "pageNumber":"", "pageSize":"", @@ -310,7 +124,8 @@ "instanceStorageType":"", "instancePort":"", "storageEncrypted":"", - "instanceType":"" + "instanceType":"", + "tagSpec":[""] }, "regionId":"" }, @@ -328,9 +143,26 @@ }, "modify-backup-policy":{ "startWindow":"", + "binlogRetentionPeriod":"", + "binlogUsageLimit":"", + "binlogSpaceProtection":"", + "retentionPeriod":"", + "cycleMode":"", + "regionId":"", + "instanceId":"" + }, + "enable-enhanced-backup":{ + "regionId":"", + "instanceId":"" + }, + "describe-backup-space":{ "regionId":"", "instanceId":"" }, + "describe-backup-charge":{ + "engine":"", + "regionId":"" + }, "modify-instance-name":{ "instanceName":"", "regionId":"", @@ -343,6 +175,7 @@ "reboot-instance":{ "rebootMaster":"", "rebootSlave":"", + "force":"", "regionId":"", "instanceId":"" }, @@ -380,7 +213,8 @@ "instanceStorageType":"", "instancePort":"", "storageEncrypted":"", - "instanceType":"" + "instanceType":"", + "tagSpec":[""] }, "regionId":"" }, @@ -389,6 +223,9 @@ "newInstanceStorageGB":"", "newInstanceStorageType":"", "storageEncrypted":"", + "subnetId":"", + "effectiveTime":"", + "postponeTime":"", "regionId":"", "instanceId":"" }, @@ -412,7 +249,8 @@ "instanceStorageType":"", "instancePort":"", "storageEncrypted":"", - "instanceType":"" + "instanceType":"", + "tagSpec":[""] }, "regionId":"", "instanceId":"" @@ -428,6 +266,11 @@ "parameterGroup":"", "storageEncrypted":"", "count":"", + "roInstanceProxy":"", + "tagSpec":[{ + "key":"", + "value":"" + }], "regionId":"", "instanceId":"" }, @@ -463,36 +306,76 @@ "regionId":"", "instanceId":"" }, + "disable-ssl":{ + "regionId":"", + "instanceId":"" + }, "restore-instance-by-time":{ "restoreTime":"", "restoreSchema":[""], "regionId":"", "instanceId":"" }, - "enable-intercept":{ + "modify-active-directory":{ + "adResourceId":"", + "forceRestart":"", "regionId":"", "instanceId":"" }, - "disable-intercept":{ + "modify-instance-maintain-time":{ + "maintainTime":"", + "maintainPeriod":"", "regionId":"", "instanceId":"" }, - "describe-intercept-result":{ - "pageNumber":"", - "pageSize":"", + "describe-instance-maintain-time":{ "regionId":"", "instanceId":"" }, - "describe-intercept":{ + "switch-for-modifying-instance-spec":{ "regionId":"", "instanceId":"" }, - "describe-logs":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", + "describe-upgrade-versions":{ + "regionId":"", + "instanceId":"" + }, + "describe-upgrade-plan":{ + "regionId":"", + "instanceId":"" + }, + "upgrade-engine-version":{ + "upgradeSchedule":"", + "newVersion":"", + "regionId":"", + "instanceId":"" + }, + "describe-import-files":{ + "regionId":"", + "instanceId":"" + }, + "get-upload-key":{ + "regionId":"", + "instanceId":"" + }, + "set-import-file-shared":{ + "shared":"", + "regionId":"", + "instanceId":"", + "fileName":"" + }, + "delete-import-file":{ + "sharedFileGid":"", + "regionId":"", + "instanceId":"", + "fileName":"" + }, + "describe-logs":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", "values":"" }], "regionId":"", @@ -510,18 +393,115 @@ "instanceId":"", "logId":"" }, - "describe-parameters":{ + "describe-databases":{ + "dbName":"", + "pageNumber":"", + "pageSize":"", "regionId":"", "instanceId":"" }, - "modify-parameters":{ - "parameters":[{ + "create-database":{ + "dbName":"", + "characterSetName":"", + "regionId":"", + "instanceId":"" + }, + "delete-database":{ + "regionId":"", + "instanceId":"", + "dbName":"" + }, + "restore-database-from-backup":{ + "backupId":"", + "backupFileName":"", + "regionId":"", + "instanceId":"", + "dbName":"" + }, + "restore-database-from-file":{ + "sharedFileGid":"", + "fileName":"", + "regionId":"", + "instanceId":"", + "dbName":"" + }, + "restore-database-from-oss":{ + "ossURL":"", + "regionId":"", + "instanceId":"", + "dbName":"" + }, + "modify-database-comment":{ + "comment":"", + "regionId":"", + "instanceId":"", + "dbName":"" + }, + "enable-intercept":{ + "regionId":"", + "instanceId":"" + }, + "disable-intercept":{ + "regionId":"", + "instanceId":"" + }, + "describe-intercept-result":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ "name":"", - "value":"" + "operator":"", + "values":"" }], "regionId":"", "instanceId":"" }, + "describe-intercept":{ + "regionId":"", + "instanceId":"" + }, + "describe-read-write-proxies":{ + "instanceId":"", + "regionId":"" + }, + "create-read-write-proxy":{ + "instanceId":"", + "delayThreshold":"", + "loadBalancerPolicy":"", + "healthCheckSpec":{ + "monitorInterval":"", + "backendConnectTimeout":"", + "backendConnectAttempts":"" + }, + "regionId":"" + }, + "describe-read-write-proxy-attribute":{ + "regionId":"", + "readWriteProxyId":"" + }, + "delete-read-write-proxy":{ + "regionId":"", + "readWriteProxyId":"" + }, + "enable-read-write-proxy-internet-access":{ + "regionId":"", + "readWriteProxyId":"" + }, + "disable-read-write-proxy-internet-access":{ + "regionId":"", + "readWriteProxyId":"" + }, + "modify-read-write-proxy":{ + "delayThreshold":"", + "loadBalancerPolicy":"", + "healthCheckSpec":{ + "monitorInterval":"", + "backendConnectTimeout":"", + "backendConnectAttempts":"" + }, + "regionId":"", + "readWriteProxyId":"" + }, "delete-parameter-group":{ "regionId":"", "parameterGroupId":"" @@ -573,6 +553,188 @@ "regionId":"", "parameterGroupId":"" }, + "describe-backups":{ + "instanceId":"", + "auto":"", + "backupTypeFilter":"", + "dbNameFilter":"", + "backupTimeRangeStartFilter":"", + "backupTimeRangeEndFilter":"", + "pageNumber":"", + "pageSize":"", + "regionId":"" + }, + "create-backup":{ + "instanceId":"", + "backupSpec":{ + "backupName":"", + "dbNames":"" + }, + "regionId":"" + }, + "delete-backup":{ + "regionId":"", + "backupId":"" + }, + "describe-backup-download-url":{ + "fileName":"", + "urlExpirationSecond":"", + "regionId":"", + "backupId":"" + }, + "describe-tables":{ + "pageNumber":"", + "pageSize":"", + "regionId":"", + "instanceId":"", + "dbName":"" + }, + "describe-tde":{ + "regionId":"", + "instanceId":"" + }, + "enable-tde":{ + "regionId":"", + "instanceId":"" + }, + "describe-white-list":{ + "regionId":"", + "instanceId":"" + }, + "modify-white-list":{ + "ips":"", + "regionId":"", + "instanceId":"" + }, + "describe-audit":{ + "regionId":"", + "instanceId":"" + }, + "create-audit":{ + "enabled":"", + "regionId":"", + "instanceId":"" + }, + "delete-audit":{ + "regionId":"", + "instanceId":"" + }, + "describe-audit-options":{ + "name":"", + "regionId":"", + "instanceId":"" + }, + "modify-audit":{ + "add":"", + "drop":"", + "regionId":"", + "instanceId":"" + }, + "describe-audit-files":{ + "regionId":"", + "instanceId":"" + }, + "describe-audit-download-url":{ + "fileName":"", + "regionId":"", + "instanceId":"" + }, + "enable-audit":{ + "regionId":"", + "instanceId":"" + }, + "disable-audit":{ + "regionId":"", + "instanceId":"" + }, + "describe-audit-result":{ + "startTime":"", + "endTime":"", + "dbName":"", + "accountName":"", + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"", + "instanceId":"" + }, + "describe-azs":{ + "engine":"", + "regionId":"" + }, + "alter-table-with-online-ddl":{ + "database":"", + "table":"", + "command":"", + "regionId":"", + "instanceId":"" + }, + "describe-parameters":{ + "regionId":"", + "instanceId":"" + }, + "modify-parameters":{ + "parameters":[{ + "name":"", + "value":"" + }], + "regionId":"", + "instanceId":"" + }, + "describe-backup-synchronicities":{ + "pageNumber":"", + "pageSize":"", + "regionId":"" + }, + "create-backup-synchronicity":{ + "instanceId":"", + "destRegion":"", + "regionId":"" + }, + "delete-backup-synchronicity":{ + "regionId":"", + "serviceId":"" + }, + "create-instance-by-time-in-cross-region":{ + "restoreTime":"", + "serviceId":"", + "instanceSpec":{ + "instanceName":"", + "instanceClass":"", + "instanceStorageGB":"", + "azId":"", + "vpcId":"", + "subnetId":"", + "parameterGroup":"", + "chargeSpec":{ + "chargeMode":"", + "chargeUnit":"", + "chargeDuration":"", + "autoRenew":"", + "buyScenario":"" + }, + "instanceStorageType":"", + "instancePort":"", + "storageEncrypted":"", + "instanceType":"", + "tagSpec":[""] + }, + "regionId":"" + }, + "describe-error-logs":{ + "regionId":"", + "instanceId":"" + }, + "describe-privilege":{ + "engine":"", + "instanceId":"", + "allAdminPrivileges":"", + "regionId":"" + }, "describe-index-performance":{ "queryType":"", "db":"", @@ -595,6 +757,15 @@ "dbName":"", "pageNumber":"", "pageSize":"", + "sorts":[{ + "name":"", + "direction":"" + }], + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], "regionId":"", "instanceId":"" }, @@ -604,6 +775,15 @@ "dbName":"", "pageNumber":"", "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "sorts":[{ + "name":"", + "direction":"" + }], "regionId":"", "instanceId":"" }, @@ -624,28 +804,4 @@ "regionId":"", "instanceId":"" }, - "describe-tables":{ - "pageNumber":"", - "pageSize":"", - "regionId":"", - "instanceId":"", - "dbName":"" - }, - "describe-tde":{ - "regionId":"", - "instanceId":"" - }, - "enable-tde":{ - "regionId":"", - "instanceId":"" - }, - "describe-white-list":{ - "regionId":"", - "instanceId":"" - }, - "modify-white-list":{ - "ips":"", - "regionId":"", - "instanceId":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/redis.json b/jdcloud_cli/resources/skeletons/redis.json index d031374..07770cc 100644 --- a/jdcloud_cli/resources/skeletons/redis.json +++ b/jdcloud_cli/resources/skeletons/redis.json @@ -1,4 +1,13 @@ { + "describe-spec-config":{ + "regionId":"" + }, + "describe-available-resource":{ + "regionId":"" + }, + "describe-available-resource2":{ + "regionId":"" + }, "describe-cache-instances":{ "pageNumber":"", "pageSize":"", @@ -15,6 +24,7 @@ "key":"", "values":"" }], + "resourceGroupIds":[""], "regionId":"" }, "create-cache-instance":{ @@ -25,13 +35,28 @@ "cacheInstanceClass":"", "password":"", "azId":{ + "azSpecifyType":"", + "azsForCluster":"", "master":"", "slave":"" }, "cacheInstanceDescription":"", "redisVersion":"", "ipv6On":"", - "shardNumber":"" + "shardNumber":"", + "userTags":[""], + "resourceGroupId":"", + "dbNum":"", + "slaveAppendonly":"", + "maxmemoryPolicy":"", + "cacheInstanceType":"", + "replicaNumber":"", + "enableSmartProxy":"", + "port":"", + "extension":{ + "exposeType":"" + }, + "cpuArchType":"" }, "charge":{ "chargeMode":"", @@ -74,7 +99,13 @@ "modify-instance-config":{ "instanceConfig":[{ "configName":"", - "configValue":"" + "configValue":"", + "configDefaultValue":"", + "configValueType":"", + "configValueMin":"", + "configValueMax":"", + "configValueOptional":"", + "configValueOutputBuffer":"" }], "regionId":"", "cacheInstanceId":"" @@ -102,6 +133,15 @@ "cacheInstanceId":"", "taskId":"" }, + "describe-client-list":{ + "regionId":"", + "cacheInstanceId":"" + }, + "describe-client-ip-detail":{ + "ip":"", + "regionId":"", + "cacheInstanceId":"" + }, "describe-backups":{ "pageNumber":"", "pageSize":"", @@ -122,6 +162,7 @@ "cacheInstanceId":"" }, "modify-backup-policy":{ + "autoBackup":"", "backupTime":"", "backupPeriod":"", "regionId":"", @@ -156,6 +197,179 @@ "startTime":"", "endTime":"", "shardId":"", + "shardAddr":"", + "regionId":"", + "cacheInstanceId":"" + }, + "describe-task-progress-list":{ + "taskType":"", + "regionId":"", + "cacheInstanceId":"" + }, + "get-disable-commands":{ + "regionId":"", + "cacheInstanceId":"" + }, + "set-disable-commands":{ + "disableCommands":[{ + "isDisable":"", + "commandName":"" + }], + "regionId":"", + "cacheInstanceId":"" + }, + "describe-accounts":{ + "regionId":"", + "cacheInstanceId":"" + }, + "create-account":{ + "accountName":"", + "accountPassword":"", + "accountPrivilege":"", + "accountDescription":"", + "regionId":"", + "cacheInstanceId":"" + }, + "modify-account":{ + "accountName":"", + "accountPassword":"", + "accountPrivilege":"", + "accountDescription":"", + "regionId":"", + "cacheInstanceId":"" + }, + "delete-account":{ + "accountName":"", + "regionId":"", + "cacheInstanceId":"" + }, + "modify-accounts":{ + "accounts":[{ + "accountName":"", + "accountPassword":"", + "accountPrivilege":"", + "accountDescription":"" + }], + "regionId":"", + "cacheInstanceId":"" + }, + "start-clear-data":{ + "clearType":"", + "keyPattern":"", + "keyFilter":[{ + "filterType":"", + "operator":"", + "value":"" + }], + "qpsLimit":"", + "regionId":"", + "cacheInstanceId":"" + }, + "stop-clear-data":{ + "regionId":"", + "cacheInstanceId":"" + }, + "describe-clear-data":{ + "regionId":"", + "cacheInstanceId":"" + }, + "describe-big-key-list":{ + "date":"", + "regionId":"", + "cacheInstanceId":"" + }, + "create-big-key-analysis":{ + "stringSize":"", + "listSize":"", + "hashSize":"", + "setSize":"", + "zsetSize":"", + "top":"", + "regionId":"", + "cacheInstanceId":"" + }, + "describe-big-key-detail":{ + "taskId":"", + "regionId":"", + "cacheInstanceId":"" + }, + "describe-big-key-analysis-time":{ + "regionId":"", + "cacheInstanceId":"" + }, + "modify-big-key-analysis-time":{ + "analysisTime":"", + "regionId":"", + "cacheInstanceId":"" + }, + "stop-cache-analysis":{ + "regionId":"", + "cacheInstanceId":"" + }, + "describe-analysis-threshold":{ + "regionId":"", + "cacheInstanceId":"" + }, + "modify-analysis-threshold":{ + "stringSize":"", + "listSize":"", + "hashSize":"", + "setSize":"", + "zsetSize":"", + "top":"", + "regionId":"", + "cacheInstanceId":"" + }, + "create-big-key-analysis2":{ + "stringSize":"", + "listSize":"", + "hashSize":"", + "setSize":"", + "zsetSize":"", + "regionId":"", + "cacheInstanceId":"" + }, + "describe-big-key-list2":{ + "pageNumber":"", + "pageSize":"", + "regionId":"", + "cacheInstanceId":"" + }, + "describe-big-key-detail2":{ + "taskId":"", + "regionId":"", + "cacheInstanceId":"" + }, + "describe-big-key-analysis-time2":{ + "regionId":"", + "cacheInstanceId":"" + }, + "modify-big-key-analysis-time2":{ + "analysisTime":"", + "regionId":"", + "cacheInstanceId":"" + }, + "describe-analysis-threshold2":{ + "regionId":"", + "cacheInstanceId":"" + }, + "modify-analysis-threshold2":{ + "stringSize":"", + "listSize":"", + "hashSize":"", + "setSize":"", + "zsetSize":"", + "regionId":"", + "cacheInstanceId":"" + }, + "describe-hot-key-result2":{ + "regionId":"", + "cacheInstanceId":"" + }, + "describe-hot-key-detail2":{ + "nodeId":"", + "pageNumber":"", + "pageSize":"", "regionId":"", "cacheInstanceId":"" }, @@ -163,10 +377,10 @@ "redisVersion":"", "regionId":"" }, - "describe-user-quota":{ + "describe-available-region":{ "regionId":"" }, - "describe-spec-config":{ + "describe-user-quota":{ "regionId":"" }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/resourcetag.json b/jdcloud_cli/resources/skeletons/resourcetag.json index 5b6f89d..58c6a12 100644 --- a/jdcloud_cli/resources/skeletons/resourcetag.json +++ b/jdcloud_cli/resources/skeletons/resourcetag.json @@ -4,6 +4,7 @@ "serviceCodes":"", "resourceIds":"", "tagFilters":[""], + "showTagStatus":"", "orderCondition":"", "descOrAsc":"", "pageSize":"", @@ -15,6 +16,21 @@ "tagKeysVo":{ "serviceCodes":"", "kind":"", + "tagFilters":[""], + "showTagStatus":"" + }, + "regionId":"" + }, + "describe-keys":{ + "tagKeysVo":{ + "serviceCodes":"", + "tagFilters":[""], + "showTagStatus":"" + }, + "regionId":"" + }, + "describe-values":{ + "tagValuesVo":{ "tagFilters":[""] }, "regionId":"" diff --git a/jdcloud_cli/resources/skeletons/sop.json b/jdcloud_cli/resources/skeletons/sop.json index 04e41ae..fd53f7e 100644 --- a/jdcloud_cli/resources/skeletons/sop.json +++ b/jdcloud_cli/resources/skeletons/sop.json @@ -1,4 +1,8 @@ { + "get-sensitive-op-setting":{ + "action":"", + "regionId":"" + }, "get-security-token":{ "getSecurityTokenInfo":{ "type":"", @@ -8,8 +12,4 @@ }, "regionId":"" }, - "get-sensitive-op-setting":{ - "action":"", - "regionId":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/streamcomputer.json b/jdcloud_cli/resources/skeletons/streamcomputer.json index 856fce8..a61c81f 100644 --- a/jdcloud_cli/resources/skeletons/streamcomputer.json +++ b/jdcloud_cli/resources/skeletons/streamcomputer.json @@ -1,48 +1,4 @@ { - "describe-job":{ - "jobId":"", - "namespaceId":"", - "regionId":"" - }, - "add-or-update-job":{ - "jobStr":{ - "namespaceId":"", - "name":"", - "description":"", - "resourceConsume":"", - "id":"", - "uid":"", - "status":"", - "duration":"", - "appName":"", - "deleted":"", - "createTime":"", - "updateTime":"", - "userName":"", - "sqlStatement":"", - "jobType":"" - }, - "regionId":"" - }, - "delete-job":{ - "namespaceId":"", - "jobId":"", - "regionId":"" - }, - "get-job-list":{ - "namespaceId":"", - "regionId":"" - }, - "start-job":{ - "namespaceId":"", - "jobId":"", - "regionId":"" - }, - "stop-job":{ - "namespaceId":"", - "jobId":"", - "regionId":"" - }, "query-namespaces":{ "keyword":"", "regionId":"" @@ -120,4 +76,48 @@ "namespaceId":"", "regionId":"" }, + "describe-job":{ + "jobId":"", + "namespaceId":"", + "regionId":"" + }, + "add-or-update-job":{ + "jobStr":{ + "namespaceId":"", + "name":"", + "description":"", + "resourceConsume":"", + "id":"", + "uid":"", + "status":"", + "duration":"", + "appName":"", + "deleted":"", + "createTime":"", + "updateTime":"", + "userName":"", + "sqlStatement":"", + "jobType":"" + }, + "regionId":"" + }, + "delete-job":{ + "namespaceId":"", + "jobId":"", + "regionId":"" + }, + "get-job-list":{ + "namespaceId":"", + "regionId":"" + }, + "start-job":{ + "namespaceId":"", + "jobId":"", + "regionId":"" + }, + "stop-job":{ + "namespaceId":"", + "jobId":"", + "regionId":"" + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/vm.json b/jdcloud_cli/resources/skeletons/vm.json index 69f8aa3..5dd6035 100644 --- a/jdcloud_cli/resources/skeletons/vm.json +++ b/jdcloud_cli/resources/skeletons/vm.json @@ -1,21 +1,191 @@ { + "describe-instance-templates":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-instance-template":{ + "instanceTemplateData":{ + "instanceType":"", + "imageId":"", + "password":"", + "keyNames":"", + "metadata":[""], + "userdata":[""], + "elasticIp":{ + "bandwidthMbps":"", + "provider":"", + "chargeMode":"" + }, + "primaryNetworkInterface":{ + "deviceIndex":"", + "autoDelete":"", + "networkInterface":{ + "subnetId":"", + "securityGroups":"", + "sanityCheck":"", + "ipv6AddressCount":"" + } + }, + "systemDisk":{ + "diskCategory":"", + "autoDelete":"", + "cloudDiskSpec":{ + "diskType":"", + "diskSizeGB":"", + "snapshotId":"", + "policyId":"", + "encrypt":"", + "iops":"" + }, + "deviceName":"", + "noDevice":"" + }, + "dataDisks":[""], + "chargeOnStopped":"", + "autoImagePolicyId":"", + "passWordAuth":"", + "imageInherit":"", + "burstSpec":{ + "burstMode":"" + } + }, + "name":"", + "description":"", + "regionId":"" + }, + "describe-instance-template":{ + "regionId":"", + "instanceTemplateId":"" + }, + "update-instance-template":{ + "name":"", + "description":"", + "instanceTemplateData":{ + "instanceType":"", + "imageId":"", + "password":"", + "keyNames":"", + "metadata":[""], + "userdata":[""], + "elasticIp":{ + "bandwidthMbps":"", + "provider":"", + "chargeMode":"" + }, + "primaryNetworkInterface":{ + "deviceIndex":"", + "autoDelete":"", + "networkInterface":{ + "subnetId":"", + "securityGroups":"", + "sanityCheck":"", + "ipv6AddressCount":"" + } + }, + "systemDisk":{ + "diskCategory":"", + "autoDelete":"", + "cloudDiskSpec":{ + "diskType":"", + "diskSizeGB":"", + "snapshotId":"", + "policyId":"", + "encrypt":"", + "iops":"" + }, + "deviceName":"", + "noDevice":"" + }, + "dataDisks":[""], + "chargeOnStopped":"", + "autoImagePolicyId":"", + "passWordAuth":"", + "imageInherit":"", + "noPassword":"", + "noElasticIp":"", + "burstSpec":{ + "burstMode":"" + } + }, + "regionId":"", + "instanceTemplateId":"" + }, + "delete-instance-template":{ + "regionId":"", + "instanceTemplateId":"" + }, + "verify-instance-template":{ + "regionId":"", + "instanceTemplateId":"" + }, + "describe-instance-templates-customdata":{ + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "describe-keypairs":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-keypair":{ + "keyName":"", + "regionId":"" + }, + "import-keypair":{ + "keyName":"", + "publicKey":"", + "regionId":"" + }, + "delete-keypair":{ + "regionId":"", + "keyName":"" + }, + "attach-keypair":{ + "instanceIds":[""], + "passWordAuth":"", + "regionId":"", + "keyName":"" + }, + "detach-keypair":{ + "instanceIds":[""], + "regionId":"", + "keyName":"" + }, "describe-image":{ "regionId":"", "imageId":"" }, "delete-image":{ + "deleteSnapshot":"", "regionId":"", "imageId":"" }, "describe-images":{ "imageSource":"", - "serviceCode":"", "offline":"", "platform":"", "ids":[""], + "imageName":"", "rootDeviceType":"", "launchPermission":"", "status":"", + "serviceCode":"", + "architecture":"", "pageNumber":"", "pageSize":"", "regionId":"" @@ -93,9 +263,22 @@ "pageSize":"", "regionId":"" }, + "describe-quotas":{ + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "imageId":"", + "regionId":"" + }, "describe-instances":{ "pageNumber":"", "pageSize":"", + "tags":[{ + "key":"", + "values":"" + }], "filters":[{ "name":"", "operator":"", @@ -105,12 +288,18 @@ }, "create-instances":{ "instanceSpec":{ + "dedicatedPoolId":"", + "dedicatedHostId":"", "agId":"", "instanceTemplateId":"", "az":"", "instanceType":"", + "burstSpec":{ + "burstMode":"" + }, "imageId":"", "name":"", + "hostname":"", "password":"", "keyNames":"", "elasticIp":{ @@ -126,6 +315,7 @@ }, "primaryNetworkInterface":{ "deviceIndex":"", + "autoDelete":"", "networkInterface":{ "subnetId":"", "az":"", @@ -135,9 +325,11 @@ "secondaryIpCount":"", "securityGroups":"", "sanityCheck":"", - "description":"" + "description":"", + "ipv6AddressCount":"" } }, + "secondaryNetworkInterfaces":[""], "systemDisk":{ "diskCategory":"", "autoDelete":"", @@ -149,6 +341,7 @@ "diskSizeGB":"", "iops":"", "snapshotId":"", + "policyId":"", "charge":{ "chargeMode":"", "chargeUnit":"", @@ -170,13 +363,19 @@ "autoRenew":"", "buyScenario":"" }, + "metadata":[""], "userdata":[""], "description":"", "noPassword":"", "noKeyNames":"", "noElasticIp":"", "userTags":[""], - "chargeOnStopped":"" + "chargeOnStopped":"", + "autoImagePolicyId":"", + "passwordAuth":"", + "imageInherit":"", + "resourceGroupId":"", + "localDeviceIds":"" }, "maxCount":"", "clientToken":"", @@ -280,6 +479,7 @@ "diskSizeGB":"", "iops":"", "snapshotId":"", + "policyId":"", "charge":{ "chargeMode":"", "chargeUnit":"", @@ -320,6 +520,23 @@ "modify-instance-attribute":{ "name":"", "description":"", + "hostname":"", + "metadata":[{ + "key":"", + "value":"" + }], + "userdata":[{ + "key":"", + "value":"" + }], + "regionId":"", + "instanceId":"" + }, + "modify-instance-vpc-attribute":{ + "subnetId":"", + "assignIpv6":"", + "privateIpAddress":"", + "securityGroups":[""], "regionId":"", "instanceId":"" }, @@ -342,10 +559,21 @@ "password":"", "imageId":"", "keyNames":[""], + "hostname":"", + "metadata":[{ + "key":"", + "value":"" + }], + "userdata":[{ + "key":"", + "value":"" + }], + "passWordAuth":"", + "imageInherit":"", "regionId":"", "instanceId":"" }, - "describe-instance-templates":{ + "describe-instances-custom-data":{ "pageNumber":"", "pageSize":"", "filters":[{ @@ -355,63 +583,12 @@ }], "regionId":"" }, - "create-instance-template":{ - "instanceTemplateData":{ - "instanceType":"", - "imageId":"", - "password":"", - "keyNames":"", - "elasticIp":{ - "bandwidthMbps":"", - "provider":"", - "chargeMode":"" - }, - "primaryNetworkInterface":{ - "deviceIndex":"", - "autoDelete":"", - "networkInterface":{ - "subnetId":"", - "securityGroups":"", - "sanityCheck":"" - } - }, - "systemDisk":{ - "diskCategory":"", - "autoDelete":"", - "cloudDiskSpec":{ - "diskType":"", - "diskSizeGB":"", - "snapshotId":"", - "encrypt":"", - "iops":"" - }, - "deviceName":"", - "noDevice":"" - }, - "dataDisks":[""], - "chargeOnStopped":"" - }, - "name":"", - "description":"", - "regionId":"" - }, - "describe-instance-template":{ + "modify-instance-placement":{ + "agId":"", + "balance":"", + "clearLocalDisk":"", "regionId":"", - "instanceTemplateId":"" - }, - "update-instance-template":{ - "description":"", - "name":"", - "regionId":"", - "instanceTemplateId":"" - }, - "delete-instance-template":{ - "regionId":"", - "instanceTemplateId":"" - }, - "verify-instance-template":{ - "regionId":"", - "instanceTemplateId":"" + "instanceId":"" }, "describe-instance-types":{ "serviceName":"", @@ -422,36 +599,4 @@ }], "regionId":"" }, - "describe-keypairs":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, - "create-keypair":{ - "keyName":"", - "regionId":"" - }, - "import-keypair":{ - "keyName":"", - "publicKey":"", - "regionId":"" - }, - "delete-keypair":{ - "regionId":"", - "keyName":"" - }, - "describe-quotas":{ - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "imageId":"", - "regionId":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/vod.json b/jdcloud_cli/resources/skeletons/vod.json index c38cee3..26eee30 100644 --- a/jdcloud_cli/resources/skeletons/vod.json +++ b/jdcloud_cli/resources/skeletons/vod.json @@ -1,31 +1,257 @@ { - "list-categories":{ + "list-transcode-template-groups":{ "pageNumber":"", "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }] + }, + "create-transcode-template-group":{ + "groupName":"", + "templates":[{ + "templateId":"", + "templateName":"", + "video":{ + "codec":"", + "bitrate":"", + "fps":"", + "width":"", + "height":"" + }, + "audio":{ + "codec":"", + "bitrate":"", + "sampleRate":"", + "channels":"", + "comfortable":"" + }, + "container":{ + "format":"" + }, + "definition":"", + "templateType":"", + "packageType":"", + "createTime":"", + "updateTime":"" + }] + }, + "get-transcode-template-group":{ + "groupId":"" + }, + "update-transcode-template-group":{ + "groupName":"", + "templates":[{ + "templateId":"", + "templateName":"", + "video":{ + "codec":"", + "bitrate":"", + "fps":"", + "width":"", + "height":"" + }, + "audio":{ + "codec":"", + "bitrate":"", + "sampleRate":"", + "channels":"", + "comfortable":"" + }, + "container":{ + "format":"" + }, + "definition":"", + "templateType":"", + "packageType":"", + "createTime":"", + "updateTime":"" + }], + "groupId":"" + }, + "delete-transcode-template-group":{ + "groupId":"" + }, + "delete-grouped-transcode-templates":{ + "groupId":"", + "templateIds":"" + }, + "list-quality-detection-templates":{ + "pageNumber":"", + "pageSize":"" + }, + "create-quality-detection-template":{ + "name":"", + "templateType":"", + "detections":[""] + }, + "get-quality-detection-template":{ + "templateId":"" + }, + "update-quality-detection-template":{ + "name":"", + "detections":[""], + "templateId":"" + }, + "delete-quality-detection-template":{ + "templateId":"" + }, + "create-video-upload-task":{ + "httpMethod":"", + "title":"", + "fileName":"", + "fileSize":"", + "coverUrl":"", + "description":"", + "categoryId":"", + "tags":[""], + "transcodeTemplateGroupId":"", + "transcodeTemplateIds":[""], + "watermarkIds":[""], + "userData":"" + }, + "refresh-video-upload-task":{ + "videoId":"" + }, + "create-image-upload-task":{ + "httpMethod":"", + "fileName":"", + "fileSize":"" + }, + "create-live-to-vod-task":{ + "title":"", + "fileName":"", + "fileSize":"", + "coverUrl":"", + "description":"", + "categoryId":"", + "tags":[""], + "transcodeTemplateGroupId":"", + "transcodeTemplateIds":[""], + "watermarkIds":[""], + "publishDomain":"", + "appName":"", + "streamName":"", + "recordTimes":[{ + "startTime":"", + "endTime":"" + }], + "recordFileType":"", + "taskExternalId":"", + "priority":"" + }, + "list-videos":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], "sorts":[{ "name":"", "direction":"" }] }, - "create-category":{ + "get-video":{ + "videoId":"" + }, + "update-video":{ "name":"", - "parentId":"", - "description":"" + "categoryId":"", + "tags":[""], + "coverUrl":"", + "description":"", + "videoId":"" }, - "get-category-with-children":{ - "categoryId":"" + "delete-video":{ + "videoId":"" }, - "get-category":{ - "categoryId":"" + "batch-delete-videos":{ + "videoIds":[""] }, - "update-category":{ - "name":"", - "parentId":"", + "batch-update-videos":{ + "bulkItems":[{ + "videoId":"", + "name":"", + "categoryId":"", + "tags":"", + "coverUrl":"", + "description":"" + }] + }, + "get-video-play-info":{ + "videoId":"" + }, + "delete-video-streams":{ + "taskIds":[""], + "videoId":"" + }, + "video-audit":{ + "auditResult":"", + "videoId":"" + }, + "get-video-source-info":{ + "videoId":"" + }, + "submit-quality-detection-job":{ + "mediaId":"", + "templateIds":[""] + }, + "batch-submit-quality-detection-jobs":{ + "bulkItems":[{ + "mediaId":"", + "templateIds":"" + }] + }, + "create-vedit-job":{ + "projectName":"", "description":"", - "categoryId":"" + "timeline":{ + "trackList":[""] + }, + "mediaMetadata":{ + "title":"" + }, + "userData":"" }, - "delete-category":{ - "categoryId":"" + "submit-vedit-job":{ + "projectId":"", + "mediaMetadata":{ + "title":"" + }, + "userData":"" + }, + "list-vedit-projects":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }] + }, + "create-vedit-project":{ + "projectName":"", + "description":"", + "timeline":{ + "trackList":[""] + } + }, + "get-vedit-project":{ + "projectId":"" + }, + "update-vedit-project":{ + "projectName":"", + "description":"", + "timeline":{ + "trackList":[""] + }, + "projectId":"" + }, + "delete-vedit-project":{ + "projectId":"" }, "list-domains":{ "pageNumber":"", @@ -112,88 +338,49 @@ "get-http-ssl":{ "domainId":"" }, - "create-live-to-vod-task":{ - "title":"", - "fileName":"", - "fileSize":"", - "coverUrl":"", - "description":"", - "categoryId":"", - "tags":[""], - "transcodeTemplateIds":[""], - "watermarkIds":[""], - "publishDomain":"", - "appName":"", - "streamName":"", - "recordTimes":[{ - "startTime":"", - "endTime":"" - }], - "recordFileType":"", - "taskExternalId":"", - "priority":"" - }, - "create-video-upload-task":{ - "httpMethod":"", - "title":"", - "fileName":"", - "fileSize":"", - "coverUrl":"", - "description":"", - "categoryId":"", - "tags":[""], - "transcodeTemplateIds":[""], - "watermarkIds":[""], - "userData":"" - }, - "refresh-video-upload-task":{ - "videoId":"" - }, - "create-image-upload-task":{ - "httpMethod":"", - "fileName":"", - "fileSize":"" - }, - "submit-quality-detection-job":{ - "mediaId":"", - "templateIds":[""] - }, - "batch-submit-quality-detection-jobs":{ - "bulkItems":[{ - "mediaId":"", - "templateIds":"" - }] - }, - "list-quality-detection-templates":{ + "list-categories":{ "pageNumber":"", - "pageSize":"" + "pageSize":"", + "sorts":[{ + "name":"", + "direction":"" + }] }, - "create-quality-detection-template":{ + "create-category":{ "name":"", - "templateType":"", - "detections":[""] + "parentId":"", + "description":"" }, - "get-quality-detection-template":{ - "templateId":"" + "list-all-categories":{ + "flatMode":"", + "treeMode":"" }, - "update-quality-detection-template":{ + "get-category-with-children":{ + "categoryId":"" + }, + "get-category":{ + "categoryId":"" + }, + "update-category":{ "name":"", - "detections":[""], - "templateId":"" + "parentId":"", + "description":"", + "categoryId":"" }, - "delete-quality-detection-template":{ - "templateId":"" + "delete-category":{ + "categoryId":"" }, - "submit-transcode-job":{ - "videoId":"", - "templateIds":[""], - "watermarkIds":[""] + "submit-snapshot-task":{ + "videoIds":[""], + "templateIds":[""] }, - "batch-submit-transcode-jobs":{ - "bulkItems":[{ - "videoId":"", - "templateIds":"", - "watermarkIds":"" + "list-snapshot-tasks":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" }] }, "list-transcode-templates":{ @@ -224,6 +411,9 @@ "encapsulation":{ "format":"" }, + "outFile":{ + "filePath":"" + }, "definition":"", "templateType":"" }, @@ -249,6 +439,9 @@ "encapsulation":{ "format":"" }, + "outFile":{ + "filePath":"" + }, "definition":"", "templateType":"", "templateId":"" @@ -256,56 +449,94 @@ "delete-transcode-template":{ "templateId":"" }, - "list-videos":{ + "list-snapshot-templates":{ "pageNumber":"", "pageSize":"", "filters":[{ "name":"", "operator":"", "values":"" - }], - "sorts":[{ - "name":"", - "direction":"" }] }, - "get-video":{ - "videoId":"" + "create-snapshot-template":{ + "templateName":"", + "snapshotType":"", + "imageSampleConfig":{ + "startTime":"", + "intervalTime":"", + "frameType":"", + "format":"", + "number":"", + "width":"", + "height":"", + "fillType":"" + }, + "imageSpriteConfig":{ + "startTime":"", + "intervalTime":"", + "frameType":"", + "format":"", + "rows":"", + "columns":"", + "cellWidth":"", + "cellHeight":"", + "doKeepShots":"" + } + }, + "get-snapshot-template":{ + "templateId":"" }, - "update-video":{ - "name":"", - "categoryId":"", - "tags":[""], - "coverUrl":"", - "description":"", - "videoId":"" + "update-snapshot-template":{ + "templateName":"", + "snapshotType":"", + "imageSampleConfig":{ + "startTime":"", + "intervalTime":"", + "frameType":"", + "format":"", + "number":"", + "width":"", + "height":"", + "fillType":"" + }, + "imageSpriteConfig":{ + "startTime":"", + "intervalTime":"", + "frameType":"", + "format":"", + "rows":"", + "columns":"", + "cellWidth":"", + "cellHeight":"", + "doKeepShots":"" + }, + "templateId":"" }, - "delete-video":{ - "videoId":"" + "delete-snapshot-template":{ + "templateId":"" }, - "batch-delete-videos":{ - "videoIds":[""] + "submit-transcode-job":{ + "videoId":"", + "templateGroupId":"", + "templateIds":[""], + "watermarkIds":[""] }, - "batch-update-videos":{ + "batch-submit-transcode-jobs":{ "bulkItems":[{ "videoId":"", - "name":"", - "categoryId":"", - "tags":"", - "coverUrl":"", - "description":"" + "templateGroupId":"", + "templateIds":"", + "watermarkIds":"" }] }, - "get-video-play-info":{ - "videoId":"" + "get-transcode-summaries":{ + "videoIds":[""] }, - "delete-video-streams":{ - "taskIds":[""], - "videoId":"" + "get-transcode-job-summaries":{ + "jobIds":[""] }, - "video-audit":{ - "auditResult":"", - "videoId":"" + "get-transcode-task-summaries":{ + "taskIds":[""] }, "list-watermarks":{ "pageNumber":"", @@ -317,6 +548,8 @@ "width":"", "height":"", "sizeUnit":"", + "widthRef":"", + "heightRef":"", "position":"", "offsetX":"", "offsetY":"", @@ -331,6 +564,8 @@ "width":"", "height":"", "sizeUnit":"", + "widthRef":"", + "heightRef":"", "position":"", "offsetX":"", "offsetY":"", @@ -340,4 +575,16 @@ "delete-watermark":{ "watermarkId":"" }, + "submit-transcode-job":{ + "videoId":"", + "templateIds":[""], + "watermarkIds":[""] + }, + "batch-submit-transcode-jobs":{ + "bulkItems":[{ + "videoId":"", + "templateIds":"", + "watermarkIds":"" + }] + }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/vpc.json b/jdcloud_cli/resources/skeletons/vpc.json index f4344f4..eaeb4fb 100644 --- a/jdcloud_cli/resources/skeletons/vpc.json +++ b/jdcloud_cli/resources/skeletons/vpc.json @@ -1,5 +1,5 @@ { - "describe-elastic-ips":{ + "describe-vpc-peerings":{ "pageNumber":"", "pageSize":"", "filters":[{ @@ -7,45 +7,130 @@ "operator":"", "values":"" }], - "tags":[{ - "key":"", + "regionId":"" + }, + "create-vpc-peering":{ + "vpcPeeringName":"", + "vpcId":"", + "remoteVpcId":"", + "description":"", + "regionId":"" + }, + "describe-vpc-peering":{ + "regionId":"", + "vpcPeeringId":"" + }, + "modify-vpc-peering":{ + "vpcPeeringName":"", + "description":"", + "regionId":"", + "vpcPeeringId":"" + }, + "delete-vpc-peering":{ + "regionId":"", + "vpcPeeringId":"" + }, + "describe-route-tables":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", "values":"" }], "regionId":"" }, - "create-elastic-ips":{ - "maxCount":"", - "elasticIpAddress":"", - "elasticIpSpec":{ - "bandwidthMbps":"", - "provider":"", - "chargeSpec":{ - "chargeMode":"", - "chargeUnit":"", - "chargeDuration":"", - "autoRenew":"", - "buyScenario":"" - } - }, - "userTags":[{ - "key":"", - "value":"" + "create-route-table":{ + "vpcId":"", + "routeTableName":"", + "description":"", + "regionId":"" + }, + "describe-route-table":{ + "regionId":"", + "routeTableId":"" + }, + "modify-route-table":{ + "routeTableName":"", + "description":"", + "regionId":"", + "routeTableId":"" + }, + "delete-route-table":{ + "regionId":"", + "routeTableId":"" + }, + "add-route-table-rules":{ + "routeTableRuleSpecs":[{ + "nextHopType":"", + "nextHopId":"", + "addressPrefix":"", + "priority":"", + "description":"" + }], + "regionId":"", + "routeTableId":"" + }, + "remove-route-table-rules":{ + "ruleIds":[""], + "regionId":"", + "routeTableId":"" + }, + "modify-route-table-rules":{ + "modifyRouteTableRuleSpecs":[{ + "ruleId":"", + "priority":"", + "nextHopType":"", + "nextHopId":"", + "addressPrefix":"", + "description":"" + }], + "regionId":"", + "routeTableId":"" + }, + "associate-route-table":{ + "subnetIds":[""], + "regionId":"", + "routeTableId":"" + }, + "disassociate-route-table":{ + "subnetId":"", + "regionId":"", + "routeTableId":"" + }, + "describe-subnets":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" }], - "ipType":"", "regionId":"" }, - "describe-elastic-ip":{ + "create-subnet":{ + "vpcId":"", + "subnetName":"", + "addressPrefix":"", + "routeTableId":"", + "description":"", + "ipMaskLen":"", + "regionId":"" + }, + "describe-subnet":{ "regionId":"", - "elasticIpId":"" + "subnetId":"" }, - "modify-elastic-ip":{ - "bandwidthMbps":"", + "modify-subnet":{ + "subnetName":"", + "description":"", + "ipMaskLen":"", "regionId":"", - "elasticIpId":"" + "subnetId":"" }, - "delete-elastic-ip":{ + "delete-subnet":{ "regionId":"", - "elasticIpId":"" + "subnetId":"" }, "describe-network-acls":{ "pageNumber":"", @@ -120,6 +205,38 @@ "regionId":"", "networkAclId":"" }, + "describe-vpcs":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-vpc":{ + "vpcName":"", + "addressPrefix":"", + "description":"", + "azType":"", + "az":"", + "regionId":"" + }, + "describe-vpc":{ + "regionId":"", + "vpcId":"" + }, + "modify-vpc":{ + "vpcName":"", + "description":"", + "regionId":"", + "vpcId":"" + }, + "delete-vpc":{ + "regionId":"", + "vpcId":"" + }, "describe-network-interfaces":{ "pageNumber":"", "pageSize":"", @@ -174,14 +291,89 @@ "force":"", "secondaryIps":[""], "secondaryIpCount":"", + "secondaryIpMaskLen":"", + "secondaryIpAddress":"", "regionId":"", "networkInterfaceId":"" }, "unassign-secondary-ips":{ "secondaryIps":[""], + "secondaryCidrs":[""], "regionId":"", "networkInterfaceId":"" }, + "describe-bandwidth-packages":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "tags":[{ + "key":"", + "values":"" + }], + "resourceGroupIds":[""], + "regionId":"" + }, + "create-bandwidth-package":{ + "name":"", + "description":"", + "bandwidthMbps":"", + "provider":"", + "chargeSpec":{ + "chargeMode":"", + "chargeUnit":"", + "chargeDuration":"", + "autoRenew":"", + "buyScenario":"" + }, + "userTags":[{ + "key":"", + "value":"" + }], + "resourceGroupId":"", + "regionId":"" + }, + "describe-bandwidth-package":{ + "regionId":"", + "bandwidthPackageId":"" + }, + "modify-bandwidth-package":{ + "bandwidthMbps":"", + "name":"", + "description":"", + "regionId":"", + "bandwidthPackageId":"" + }, + "delete-bandwidth-package":{ + "regionId":"", + "bandwidthPackageId":"" + }, + "add-bandwidth-package-ip":{ + "bandwidthPackageIPSpecs":[{ + "publicIpId":"", + "bandwidthMbps":"" + }], + "regionId":"", + "bandwidthPackageId":"" + }, + "remove-bandwidth-package-ip":{ + "bandwidthPackageIPSpecs":[{ + "publicIpId":"" + }], + "regionId":"", + "bandwidthPackageId":"" + }, + "modify-bandwidth-package-ip-bandwidth":{ + "bandwidthPackageIPSpecs":[{ + "publicIpId":"", + "bandwidthMbps":"" + }], + "regionId":"", + "bandwidthPackageId":"" + }, "describe-network-security-groups":{ "pageNumber":"", "pageSize":"", @@ -246,75 +438,7 @@ "parentResourceId":"", "regionId":"" }, - "describe-route-tables":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, - "create-route-table":{ - "vpcId":"", - "routeTableName":"", - "description":"", - "regionId":"" - }, - "describe-route-table":{ - "regionId":"", - "routeTableId":"" - }, - "modify-route-table":{ - "routeTableName":"", - "description":"", - "regionId":"", - "routeTableId":"" - }, - "delete-route-table":{ - "regionId":"", - "routeTableId":"" - }, - "add-route-table-rules":{ - "routeTableRuleSpecs":[{ - "nextHopType":"", - "nextHopId":"", - "addressPrefix":"", - "priority":"", - "description":"" - }], - "regionId":"", - "routeTableId":"" - }, - "remove-route-table-rules":{ - "ruleIds":[""], - "regionId":"", - "routeTableId":"" - }, - "modify-route-table-rules":{ - "modifyRouteTableRuleSpecs":[{ - "ruleId":"", - "priority":"", - "nextHopType":"", - "nextHopId":"", - "addressPrefix":"", - "description":"" - }], - "regionId":"", - "routeTableId":"" - }, - "associate-route-table":{ - "subnetIds":[""], - "regionId":"", - "routeTableId":"" - }, - "disassociate-route-table":{ - "subnetId":"", - "regionId":"", - "routeTableId":"" - }, - "describe-edge-ip-providers":{ + "describe-elastic-ips":{ "pageNumber":"", "pageSize":"", "filters":[{ @@ -322,73 +446,50 @@ "operator":"", "values":"" }], - "regionId":"" - }, - "describe-subnets":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", + "tags":[{ + "key":"", "values":"" }], + "resourceGroupIds":[""], "regionId":"" }, - "create-subnet":{ - "vpcId":"", - "subnetName":"", - "addressPrefix":"", - "routeTableId":"", - "description":"", - "subnetType":"", - "az":"", - "regionId":"" - }, - "describe-subnet":{ - "regionId":"", - "subnetId":"" - }, - "modify-subnet":{ - "subnetName":"", - "description":"", - "regionId":"", - "subnetId":"" - }, - "delete-subnet":{ - "regionId":"", - "subnetId":"" - }, - "describe-vpcs":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" + "create-elastic-ips":{ + "maxCount":"", + "elasticIpAddress":"", + "elasticIpSpec":{ + "bandwidthMbps":"", + "provider":"", + "chargeSpec":{ + "chargeMode":"", + "chargeUnit":"", + "chargeDuration":"", + "autoRenew":"", + "buyScenario":"" + } + }, + "userTags":[{ + "key":"", + "value":"" }], + "ipType":"", + "resourceGroupId":"", + "dryRun":"", "regionId":"" }, - "create-vpc":{ - "vpcName":"", - "addressPrefix":"", - "description":"", - "regionId":"" - }, - "describe-vpc":{ + "describe-elastic-ip":{ "regionId":"", - "vpcId":"" + "elasticIpId":"" }, - "modify-vpc":{ - "vpcName":"", - "description":"", + "modify-elastic-ip":{ + "bandwidthMbps":"", "regionId":"", - "vpcId":"" + "elasticIpId":"" }, - "delete-vpc":{ + "delete-elastic-ip":{ "regionId":"", - "vpcId":"" + "elasticIpId":"" }, - "describe-vpc-peerings":{ + "describe-edge-ip-providers":{ "pageNumber":"", "pageSize":"", "filters":[{ @@ -398,25 +499,4 @@ }], "regionId":"" }, - "create-vpc-peering":{ - "vpcPeeringName":"", - "vpcId":"", - "remoteVpcId":"", - "description":"", - "regionId":"" - }, - "describe-vpc-peering":{ - "regionId":"", - "vpcPeeringId":"" - }, - "modify-vpc-peering":{ - "vpcPeeringName":"", - "description":"", - "regionId":"", - "vpcPeeringId":"" - }, - "delete-vpc-peering":{ - "regionId":"", - "vpcPeeringId":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/vqd.json b/jdcloud_cli/resources/skeletons/vqd.json index 56113ca..c35010e 100644 --- a/jdcloud_cli/resources/skeletons/vqd.json +++ b/jdcloud_cli/resources/skeletons/vqd.json @@ -6,6 +6,32 @@ }, "query-callback":{ }, + "list-vqd-templates":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }] + }, + "create-vqd-template":{ + "templateName":"", + "threshold":"", + "detections":[""] + }, + "get-vqd-template":{ + "templateId":"" + }, + "update-vqd-template":{ + "templateName":"", + "threshold":"", + "detections":[""], + "templateId":"" + }, + "delete-vqd-template":{ + "templateId":"" + }, "submit-vqd-task":{ "media":{ "mediaUrl":"", @@ -41,30 +67,4 @@ "batch-delete-vqd-tasks":{ "taskIds":[""] }, - "list-vqd-templates":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }] - }, - "create-vqd-template":{ - "templateName":"", - "threshold":"", - "detections":[""] - }, - "get-vqd-template":{ - "templateId":"" - }, - "update-vqd-template":{ - "templateName":"", - "threshold":"", - "detections":[""], - "templateId":"" - }, - "delete-vqd-template":{ - "templateId":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/xdata.json b/jdcloud_cli/resources/skeletons/xdata.json index f069136..65d86dd 100644 --- a/jdcloud_cli/resources/skeletons/xdata.json +++ b/jdcloud_cli/resources/skeletons/xdata.json @@ -1,26 +1,41 @@ { - "list-database-info":{ + "list-instance-info":{ + "regionId":"" + }, + "list-table-info":{ "instanceName":"", + "databaseName":"", "regionId":"" }, - "get-database-info":{ + "create-table":{ "instanceName":"", - "regionId":"", - "databaseName":"" + "dbModelDBTable":{ + "dbName":"", + "tableName":"", + "hiveFileFormat":"", + "fieldsDelimit":"", + "linesDelimit":"", + "otherSerdeProperties":"", + "createTime":"", + "owner":"", + "comments":"", + "externalLocation":"", + "parameters":"", + "rows":[""] + }, + "regionId":"" }, - "create-database":{ + "get-table-info":{ "instanceName":"", - "description":"", + "databaseName":"", "regionId":"", - "databaseName":"" + "tableName":"" }, - "delete-database":{ + "delete-table":{ "instanceName":"", + "databaseName":"", "regionId":"", - "databaseName":"" - }, - "list-instance-info":{ - "regionId":"" + "tableName":"" }, "execute-ras-query":{ "databaseName":"", @@ -77,39 +92,24 @@ "queryId":"", "regionId":"" }, - "list-table-info":{ + "list-database-info":{ "instanceName":"", - "databaseName":"", "regionId":"" }, - "create-table":{ + "get-database-info":{ "instanceName":"", - "dbModelDBTable":{ - "dbName":"", - "tableName":"", - "hiveFileFormat":"", - "fieldsDelimit":"", - "linesDelimit":"", - "otherSerdeProperties":"", - "createTime":"", - "owner":"", - "comments":"", - "externalLocation":"", - "parameters":"", - "rows":[""] - }, - "regionId":"" + "regionId":"", + "databaseName":"" }, - "get-table-info":{ + "create-database":{ "instanceName":"", - "databaseName":"", + "description":"", "regionId":"", - "tableName":"" + "databaseName":"" }, - "delete-table":{ + "delete-database":{ "instanceName":"", - "databaseName":"", "regionId":"", - "tableName":"" + "databaseName":"" }, } \ No newline at end of file diff --git a/jdcloud_cli/resources/skeletons/yunding.json b/jdcloud_cli/resources/skeletons/yunding.json index c9fd539..bed9728 100644 --- a/jdcloud_cli/resources/skeletons/yunding.json +++ b/jdcloud_cli/resources/skeletons/yunding.json @@ -1,16 +1,106 @@ { + "put-product-metric-data":{ + "appCode":"", + "serviceCode":"", + "region":"", + "resourceId":"", + "dataPoints":[{ + "metric":"", + "tags":"", + "timestamp":"", + "value":"" + }], + "regionId":"" + }, + "put-product-metric-data":{ + "appCode":"", + "serviceCode":"", + "region":"", + "resourceId":"", + "dataPoints":[{ + "metric":"", + "tags":"", + "timestamp":"", + "value":"" + }], + "regionId":"" + }, + "describe-subnets":{ + "pageNumber":"", + "pageSize":"", + "type":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-subnet":{ + "vpcId":"", + "subnetName":"", + "addressPrefix":"", + "routeTableId":"", + "description":"", + "ipMaskLen":"", + "regionId":"" + }, + "describe-subnet":{ + "regionId":"", + "subnetId":"" + }, + "delete-subnet":{ + "regionId":"", + "subnetId":"" + }, "assign-secondary-ips":{ "force":"", "secondaryIps":[""], "secondaryIpCount":"", + "secondaryIpMaskLen":"", + "secondaryIpAddress":"", "regionId":"", "networkInterfaceId":"" }, "unassign-secondary-ips":{ "secondaryIps":[""], + "secondaryCidrs":[""], + "regionId":"", + "networkInterfaceId":"" + }, + "describe-network-interface":{ + "regionId":"", + "networkInterfaceId":"" + }, + "delete-network-interface":{ "regionId":"", "networkInterfaceId":"" }, + "describe-network-interfaces":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-network-interface":{ + "subnetId":"", + "az":"", + "networkInterfaceName":"", + "primaryIpAddress":"", + "secondaryIpAddresses":[""], + "secondaryIpCount":"", + "securityGroups":[""], + "sanityCheck":"", + "description":"", + "regionId":"" + }, + "describe-tasks":{ + "instanceId":"" + }, "describe-rds-instances":{ "pageNumber":"", "pageSize":"", @@ -65,6 +155,12 @@ "instanceId":"", "accountName":"" }, + "revoke-privilege":{ + "dbNames":[""], + "regionId":"", + "instanceId":"", + "accountName":"" + }, "describe-rds-databases":{ "dbName":"", "pageNumber":"", diff --git a/jdcloud_cli/resources/skeletons/zfs.json b/jdcloud_cli/resources/skeletons/zfs.json index a61e4d1..f4b222a 100644 --- a/jdcloud_cli/resources/skeletons/zfs.json +++ b/jdcloud_cli/resources/skeletons/zfs.json @@ -1,4 +1,30 @@ { + "describe-mount-targets":{ + "pageNumber":"", + "pageSize":"", + "filters":[{ + "name":"", + "operator":"", + "values":"" + }], + "regionId":"" + }, + "create-mount-target":{ + "fileSystemId":"", + "subnetId":"", + "vpcId":"", + "securityGroupId":"", + "clientToken":"", + "regionId":"" + }, + "describe-mount-target":{ + "regionId":"", + "mountTargetId":"" + }, + "delete-mount-target":{ + "regionId":"", + "mountTargetId":"" + }, "describe-file-systems":{ "pageNumber":"", "pageSize":"", @@ -18,6 +44,7 @@ "description":"", "clientToken":"", "fileSystemType":"", + "serviceCode":"", "regionId":"" }, "describe-file-system":{ @@ -34,30 +61,4 @@ "regionId":"", "fileSystemId":"" }, - "describe-mount-targets":{ - "pageNumber":"", - "pageSize":"", - "filters":[{ - "name":"", - "operator":"", - "values":"" - }], - "regionId":"" - }, - "create-mount-target":{ - "fileSystemId":"", - "subnetId":"", - "vpcId":"", - "securityGroupId":"", - "clientToken":"", - "regionId":"" - }, - "describe-mount-target":{ - "regionId":"", - "mountTargetId":"" - }, - "delete-mount-target":{ - "regionId":"", - "mountTargetId":"" - }, } \ No newline at end of file diff --git a/jdcloud_cli/skeleton.py b/jdcloud_cli/skeleton.py index 3e9d46f..ebcacfb 100644 --- a/jdcloud_cli/skeleton.py +++ b/jdcloud_cli/skeleton.py @@ -28,7 +28,7 @@ def __init__(self, service, api): def show(self): project_dir = os.path.dirname(os.path.abspath(__file__)) json_file = '%s/resources/skeletons/%s.json' % (project_dir, self.__service) - obj = yaml.load(open(json_file).read()) + obj = yaml.load(open(json_file).read(), Loader=yaml.FullLoader) if self.__api in obj: print(json.dumps(obj[self.__api], indent=4)) diff --git a/jdcloud_cli/version.py b/jdcloud_cli/version.py index a30cccf..66d7859 100644 --- a/jdcloud_cli/version.py +++ b/jdcloud_cli/version.py @@ -14,4 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = '1.2.7' +VERSION = '1.2.11' + + diff --git a/setup.py b/setup.py index a3c1737..ee7c10d 100644 --- a/setup.py +++ b/setup.py @@ -21,8 +21,8 @@ from setuptools import setup, find_packages from jdcloud_cli.version import VERSION -install_requires = ['websocket-client', 'configparser==4.0.2', 'requests', 'more-itertools==5.0.0', - 'argcomplete', 'argparse', 'jdcloud_sdk==1.6.62', 'pyyaml', 'jinja2==2.11.2', 'MarkupSafe==1.1.1', 'zipp==0.6.0'] +install_requires = ['websocket-client<=0.59.0', 'configparser==4.0.2', 'requests', 'more-itertools==5.0.0', + 'argcomplete', 'argparse', 'jdcloud_sdk==1.6.180', 'pyyaml', 'jinja2==2.11.2', 'MarkupSafe==1.1.1', 'zipp==0.6.0'] setup( @@ -41,3 +41,4 @@ ] } ) + diff --git a/testcases/config_test.py b/testcases/config_test.py index 4764401..df402a1 100644 --- a/testcases/config_test.py +++ b/testcases/config_test.py @@ -1,6 +1,8 @@ import unittest import os +import yaml + class ConfigTest(unittest.TestCase): @@ -66,3 +68,11 @@ def test_can_not_delete_current_profile(self): def test_use_not_exist_profile(self): self._use_profile('xxx', 'Profile xxx do not exist') + + def test_yaml_load(self): + json_data='{"az":"cn-north-1","name":"lishijun-test","diskType":"ssd","diskSizeGB":20}' + try: + obj = yaml.load(json_data, Loader=yaml.FullLoader) + return obj + except ValueError: + print ValueError \ No newline at end of file diff --git a/testcases/generated/apigateway_test.py b/testcases/generated/apigateway_test.py index 1e44f22..59959fe 100644 --- a/testcases/generated/apigateway_test.py +++ b/testcases/generated/apigateway_test.py @@ -23,8 +23,8 @@ class ApigatewayTest(unittest.TestCase): - def test_query_access_auths(self): - cmd = """python ../../main.py apigateway query-access-auths """ + def test_query_user_domains(self): + cmd = """python ../../main.py apigateway query-user-domains --api-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_query_access_auths(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_access_auth(self): - cmd = """python ../../main.py apigateway create-access-auth """ + def test_create_user_domain(self): + cmd = """python ../../main.py apigateway create-user-domain --domain 'xxx' --api-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_create_access_auth(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_check_auth_exist(self): - cmd = """python ../../main.py apigateway check-auth-exist --access-key 'xxx' --auth-user-type 'xxx'""" + def test_delete_user_domain(self): + cmd = """python ../../main.py apigateway delete-user-domain --domain-ids 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_check_auth_exist(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_access_auth(self): - cmd = """python ../../main.py apigateway query-access-auth --access-auth-id 'xxx'""" + def test_create_backend_config(self): + cmd = """python ../../main.py apigateway create-backend-config --api-group-id 'xxx' --environment 'xxx' --backend-service-type 'xxx' --sort '5'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_query_access_auth(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_access_auth(self): - cmd = """python ../../main.py apigateway update-access-auth --access-auth-id 'xxx'""" + def test_describe_backend_configs(self): + cmd = """python ../../main.py apigateway describe-backend-configs --api-group-id 'xxx' --environment 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_update_access_auth(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_access_auth(self): - cmd = """python ../../main.py apigateway delete-access-auth --access-auth-id 'xxx'""" + def test_describe_backend_config(self): + cmd = """python ../../main.py apigateway describe-backend-config --api-group-id 'xxx' --backend-config-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_delete_access_auth(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_bind_group_auth(self): - cmd = """python ../../main.py apigateway query-bind-group-auth --access-auth-id 'xxx'""" + def test_update_backend_config(self): + cmd = """python ../../main.py apigateway update-backend-config --api-group-id 'xxx' --backend-config-id 'xxx' --environment 'xxx' --backend-service-type 'xxx' --sort '5'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_query_bind_group_auth(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_bind_group_auth(self): - cmd = """python ../../main.py apigateway bind-group-auth --access-auth-id 'xxx' --deployment-ids 'xxx'""" + def test_delete_backend_config(self): + cmd = """python ../../main.py apigateway delete-backend-config --api-group-id 'xxx' --backend-config-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_bind_group_auth(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_auth_group_list(self): - cmd = """python ../../main.py apigateway query-auth-group-list --auth-user-type 'xxx'""" + def test_query_uc_access_keys(self): + cmd = """python ../../main.py apigateway query-uc-access-keys """ with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_query_auth_group_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_authorized_api_group_list(self): - cmd = """python ../../main.py apigateway authorized-api-group-list """ + def test_query_keys(self): + cmd = """python ../../main.py apigateway query-keys """ with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_authorized_api_group_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_access_keys(self): - cmd = """python ../../main.py apigateway query-access-keys """ + def test_create_key(self): + cmd = """python ../../main.py apigateway create-key """ with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_query_access_keys(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_access_key(self): - cmd = """python ../../main.py apigateway create-access-key """ + def test_reset_key(self): + cmd = """python ../../main.py apigateway reset-key --key-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_create_access_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_check_key_exist(self): - cmd = """python ../../main.py apigateway check-key-exist --access-key 'xxx' --access-key-type 'xxx'""" + def test_update_key(self): + cmd = """python ../../main.py apigateway update-key --key-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_check_key_exist(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_access_key(self): - cmd = """python ../../main.py apigateway query-access-key --access-key-id 'xxx'""" + def test_query_key_info(self): + cmd = """python ../../main.py apigateway query-key-info --key-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_query_access_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_access_key(self): - cmd = """python ../../main.py apigateway update-access-key --access-key-id 'xxx'""" + def test_describe_api_groups(self): + cmd = """python ../../main.py apigateway describe-api-groups """ with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_update_access_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_access_key(self): - cmd = """python ../../main.py apigateway delete-access-key --access-key-id 'xxx'""" + def test_create_api_group(self): + cmd = """python ../../main.py apigateway create-api-group --group-name 'xxx' --auth-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_delete_access_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_bind_group_key(self): - cmd = """python ../../main.py apigateway query-bind-group-key --access-key-id 'xxx'""" + def test_check_group_name_exist(self): + cmd = """python ../../main.py apigateway check-group-name-exist --group-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_query_bind_group_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_bind_group_key(self): - cmd = """python ../../main.py apigateway bind-group-key --access-key-id 'xxx' --deployment-ids 'xxx'""" + def test_describe_api_group(self): + cmd = """python ../../main.py apigateway describe-api-group --api-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_bind_group_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_key_group_list(self): - cmd = """python ../../main.py apigateway query-key-group-list --access-key-id 'xxx'""" + def test_modify_api_group_attribute(self): + cmd = """python ../../main.py apigateway modify-api-group-attribute --api-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +194,8 @@ def test_query_key_group_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_apis(self): - cmd = """python ../../main.py apigateway query-apis --api-group-id 'xxx' --revision 'xxx'""" + def test_delete_api_group(self): + cmd = """python ../../main.py apigateway delete-api-group --api-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +203,8 @@ def test_query_apis(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_apis(self): - cmd = """python ../../main.py apigateway create-apis --api-group-id 'xxx' --revision 'xxx'""" + def test_describe_is_deploy_api_groups(self): + cmd = """python ../../main.py apigateway describe-is-deploy-api-groups """ with os.popen(cmd) as f: content = f.read() @@ -212,8 +212,8 @@ def test_create_apis(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_check_api_name_exist(self): - cmd = """python ../../main.py apigateway check-api-name-exist --api-group-id 'xxx' --revision 'xxx' --api-name 'xxx'""" + def test_query_rate_limit_policies(self): + cmd = """python ../../main.py apigateway query-rate-limit-policies """ with os.popen(cmd) as f: content = f.read() @@ -221,8 +221,8 @@ def test_check_api_name_exist(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_api(self): - cmd = """python ../../main.py apigateway query-api --api-group-id 'xxx' --revision 'xxx' --api-id 'xxx'""" + def test_create_rate_limit_policy(self): + cmd = """python ../../main.py apigateway create-rate-limit-policy """ with os.popen(cmd) as f: content = f.read() @@ -230,8 +230,8 @@ def test_query_api(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_api(self): - cmd = """python ../../main.py apigateway update-api --api-group-id 'xxx' --revision 'xxx' --api-id 'xxx'""" + def test_check_policy_name(self): + cmd = """python ../../main.py apigateway check-policy-name --policy-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -239,8 +239,8 @@ def test_update_api(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_api(self): - cmd = """python ../../main.py apigateway delete-api --api-group-id 'xxx' --revision 'xxx' --api-id 'xxx'""" + def test_query_rate_limit_policy(self): + cmd = """python ../../main.py apigateway query-rate-limit-policy --policy-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -248,8 +248,8 @@ def test_delete_api(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_api_by_name(self): - cmd = """python ../../main.py apigateway update-api-by-name --api-group-id 'xxx' --revision 'xxx' --api-name 'xxx'""" + def test_update_rate_limit_policy(self): + cmd = """python ../../main.py apigateway update-rate-limit-policy --policy-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -257,8 +257,8 @@ def test_update_api_by_name(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_api_by_name(self): - cmd = """python ../../main.py apigateway delete-api-by-name --api-group-id 'xxx' --revision 'xxx' --api-name 'xxx'""" + def test_delete_rate_limit_policy(self): + cmd = """python ../../main.py apigateway delete-rate-limit-policy --policy-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -266,8 +266,8 @@ def test_delete_api_by_name(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_api_groups(self): - cmd = """python ../../main.py apigateway describe-api-groups """ + def test_query_bind_group_policy(self): + cmd = """python ../../main.py apigateway query-bind-group-policy --policy-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -275,8 +275,8 @@ def test_describe_api_groups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_api_group(self): - cmd = """python ../../main.py apigateway create-api-group --group-name 'xxx' --auth-type 'xxx'""" + def test_bind_group_policy(self): + cmd = """python ../../main.py apigateway bind-group-policy --policy-id 'xxx' --deployment-ids 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -284,8 +284,8 @@ def test_create_api_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_check_group_name_exist(self): - cmd = """python ../../main.py apigateway check-group-name-exist --group-name 'xxx'""" + def test_query_policy_group_list(self): + cmd = """python ../../main.py apigateway query-policy-group-list --policy-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -293,8 +293,8 @@ def test_check_group_name_exist(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_api_group(self): - cmd = """python ../../main.py apigateway describe-api-group --api-group-id 'xxx'""" + def test_query_subscription_keys(self): + cmd = """python ../../main.py apigateway query-subscription-keys """ with os.popen(cmd) as f: content = f.read() @@ -302,8 +302,8 @@ def test_describe_api_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_api_group_attribute(self): - cmd = """python ../../main.py apigateway modify-api-group-attribute --api-group-id 'xxx'""" + def test_create_subscription_key(self): + cmd = """python ../../main.py apigateway create-subscription-key """ with os.popen(cmd) as f: content = f.read() @@ -311,8 +311,8 @@ def test_modify_api_group_attribute(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_api_group(self): - cmd = """python ../../main.py apigateway delete-api-group --api-group-id 'xxx'""" + def test_query_subscription_key(self): + cmd = """python ../../main.py apigateway query-subscription-key --subscription-key-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -320,8 +320,8 @@ def test_delete_api_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_is_deploy_api_groups(self): - cmd = """python ../../main.py apigateway describe-is-deploy-api-groups """ + def test_update_subscription_key(self): + cmd = """python ../../main.py apigateway update-subscription-key --subscription-key-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -329,8 +329,8 @@ def test_describe_is_deploy_api_groups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_backend_config(self): - cmd = """python ../../main.py apigateway create-backend-config --api-group-id 'xxx' --environment 'xxx' --backend-service-type 'xxx' --sort '5'""" + def test_delete_subscription_key(self): + cmd = """python ../../main.py apigateway delete-subscription-key --subscription-key-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -338,8 +338,8 @@ def test_create_backend_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_backend_configs(self): - cmd = """python ../../main.py apigateway describe-backend-configs --api-group-id 'xxx' --environment 'xxx'""" + def test_query_access_keys(self): + cmd = """python ../../main.py apigateway query-access-keys """ with os.popen(cmd) as f: content = f.read() @@ -347,8 +347,8 @@ def test_describe_backend_configs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_backend_config(self): - cmd = """python ../../main.py apigateway describe-backend-config --api-group-id 'xxx' --backend-config-id 'xxx'""" + def test_create_access_key(self): + cmd = """python ../../main.py apigateway create-access-key """ with os.popen(cmd) as f: content = f.read() @@ -356,8 +356,8 @@ def test_describe_backend_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_backend_config(self): - cmd = """python ../../main.py apigateway update-backend-config --api-group-id 'xxx' --backend-config-id 'xxx' --environment 'xxx' --backend-service-type 'xxx' --sort '5'""" + def test_check_key_exist(self): + cmd = """python ../../main.py apigateway check-key-exist --access-key 'xxx' --access-key-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -365,8 +365,8 @@ def test_update_backend_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_backend_config(self): - cmd = """python ../../main.py apigateway delete-backend-config --api-group-id 'xxx' --backend-config-id 'xxx'""" + def test_query_access_key(self): + cmd = """python ../../main.py apigateway query-access-key --access-key-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -374,8 +374,8 @@ def test_delete_backend_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_deployments(self): - cmd = """python ../../main.py apigateway describe-deployments --api-group-id 'xxx'""" + def test_update_access_key(self): + cmd = """python ../../main.py apigateway update-access-key --access-key-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -383,8 +383,8 @@ def test_describe_deployments(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_deploy(self): - cmd = """python ../../main.py apigateway deploy --api-group-id 'xxx' --revision 'xxx' --environment 'xxx'""" + def test_delete_access_key(self): + cmd = """python ../../main.py apigateway delete-access-key --access-key-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -392,8 +392,8 @@ def test_deploy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_deployment(self): - cmd = """python ../../main.py apigateway describe-deployment --api-group-id 'xxx' --deployment-id 'xxx'""" + def test_query_bind_group_key(self): + cmd = """python ../../main.py apigateway query-bind-group-key --access-key-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -401,8 +401,8 @@ def test_describe_deployment(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_offline(self): - cmd = """python ../../main.py apigateway offline --api-group-id 'xxx' --deployment-id 'xxx'""" + def test_bind_group_key(self): + cmd = """python ../../main.py apigateway bind-group-key --access-key-id 'xxx' --deployment-ids 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -410,8 +410,8 @@ def test_offline(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_batch_offline(self): - cmd = """python ../../main.py apigateway batch-offline --api-group-id 'xxx'""" + def test_query_key_group_list(self): + cmd = """python ../../main.py apigateway query-key-group-list --access-key-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -419,8 +419,8 @@ def test_batch_offline(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_keys(self): - cmd = """python ../../main.py apigateway query-keys """ + def test_check_pin(self): + cmd = """python ../../main.py apigateway check-pin --pin 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -428,8 +428,8 @@ def test_query_keys(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_key(self): - cmd = """python ../../main.py apigateway create-key """ + def test_query_apis(self): + cmd = """python ../../main.py apigateway query-apis --api-group-id 'xxx' --revision 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -437,8 +437,8 @@ def test_create_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_reset_key(self): - cmd = """python ../../main.py apigateway reset-key --key-id 'xxx'""" + def test_create_apis(self): + cmd = """python ../../main.py apigateway create-apis --api-group-id 'xxx' --revision 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -446,8 +446,8 @@ def test_reset_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_key(self): - cmd = """python ../../main.py apigateway update-key --key-id 'xxx'""" + def test_check_api_name_exist(self): + cmd = """python ../../main.py apigateway check-api-name-exist --api-group-id 'xxx' --revision 'xxx' --api-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -455,8 +455,8 @@ def test_update_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_key_info(self): - cmd = """python ../../main.py apigateway query-key-info --key-id 'xxx'""" + def test_query_api(self): + cmd = """python ../../main.py apigateway query-api --api-group-id 'xxx' --revision 'xxx' --api-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -464,8 +464,8 @@ def test_query_key_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_rate_limit_policies(self): - cmd = """python ../../main.py apigateway query-rate-limit-policies """ + def test_update_api(self): + cmd = """python ../../main.py apigateway update-api --api-group-id 'xxx' --revision 'xxx' --api-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -473,8 +473,8 @@ def test_query_rate_limit_policies(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_rate_limit_policy(self): - cmd = """python ../../main.py apigateway create-rate-limit-policy """ + def test_delete_api(self): + cmd = """python ../../main.py apigateway delete-api --api-group-id 'xxx' --revision 'xxx' --api-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -482,8 +482,8 @@ def test_create_rate_limit_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_check_policy_name(self): - cmd = """python ../../main.py apigateway check-policy-name --policy-name 'xxx'""" + def test_update_api_by_name(self): + cmd = """python ../../main.py apigateway update-api-by-name --api-group-id 'xxx' --revision 'xxx' --api-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -491,8 +491,8 @@ def test_check_policy_name(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_rate_limit_policy(self): - cmd = """python ../../main.py apigateway query-rate-limit-policy --policy-id 'xxx'""" + def test_delete_api_by_name(self): + cmd = """python ../../main.py apigateway delete-api-by-name --api-group-id 'xxx' --revision 'xxx' --api-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -500,8 +500,8 @@ def test_query_rate_limit_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_rate_limit_policy(self): - cmd = """python ../../main.py apigateway update-rate-limit-policy --policy-id 'xxx'""" + def test_describe_deployments(self): + cmd = """python ../../main.py apigateway describe-deployments --api-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -509,8 +509,8 @@ def test_update_rate_limit_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_rate_limit_policy(self): - cmd = """python ../../main.py apigateway delete-rate-limit-policy --policy-id 'xxx'""" + def test_deploy(self): + cmd = """python ../../main.py apigateway deploy --api-group-id 'xxx' --revision 'xxx' --environment 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -518,8 +518,8 @@ def test_delete_rate_limit_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_bind_group_policy(self): - cmd = """python ../../main.py apigateway query-bind-group-policy --policy-id 'xxx'""" + def test_describe_deployment(self): + cmd = """python ../../main.py apigateway describe-deployment --api-group-id 'xxx' --deployment-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -527,8 +527,8 @@ def test_query_bind_group_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_bind_group_policy(self): - cmd = """python ../../main.py apigateway bind-group-policy --policy-id 'xxx' --deployment-ids 'xxx'""" + def test_offline(self): + cmd = """python ../../main.py apigateway offline --api-group-id 'xxx' --deployment-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -536,8 +536,8 @@ def test_bind_group_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_policy_group_list(self): - cmd = """python ../../main.py apigateway query-policy-group-list --policy-id 'xxx'""" + def test_batch_offline(self): + cmd = """python ../../main.py apigateway batch-offline --api-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -608,8 +608,8 @@ def test_delete_revision(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_subscription_keys(self): - cmd = """python ../../main.py apigateway query-subscription-keys """ + def test_query_access_auths(self): + cmd = """python ../../main.py apigateway query-access-auths """ with os.popen(cmd) as f: content = f.read() @@ -617,8 +617,8 @@ def test_query_subscription_keys(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_subscription_key(self): - cmd = """python ../../main.py apigateway create-subscription-key """ + def test_create_access_auth(self): + cmd = """python ../../main.py apigateway create-access-auth """ with os.popen(cmd) as f: content = f.read() @@ -626,8 +626,8 @@ def test_create_subscription_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_subscription_key(self): - cmd = """python ../../main.py apigateway query-subscription-key --subscription-key-id 'xxx'""" + def test_check_auth_exist(self): + cmd = """python ../../main.py apigateway check-auth-exist --access-key 'xxx' --auth-user-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -635,8 +635,8 @@ def test_query_subscription_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_subscription_key(self): - cmd = """python ../../main.py apigateway update-subscription-key --subscription-key-id 'xxx'""" + def test_query_access_auth(self): + cmd = """python ../../main.py apigateway query-access-auth --access-auth-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -644,8 +644,8 @@ def test_update_subscription_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_subscription_key(self): - cmd = """python ../../main.py apigateway delete-subscription-key --subscription-key-id 'xxx'""" + def test_update_access_auth(self): + cmd = """python ../../main.py apigateway update-access-auth --access-auth-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -653,8 +653,8 @@ def test_delete_subscription_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_uc_access_keys(self): - cmd = """python ../../main.py apigateway query-uc-access-keys """ + def test_delete_access_auth(self): + cmd = """python ../../main.py apigateway delete-access-auth --access-auth-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -662,8 +662,8 @@ def test_query_uc_access_keys(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_check_pin(self): - cmd = """python ../../main.py apigateway check-pin --pin 'xxx'""" + def test_query_bind_group_auth(self): + cmd = """python ../../main.py apigateway query-bind-group-auth --access-auth-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -671,8 +671,8 @@ def test_check_pin(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_user_domains(self): - cmd = """python ../../main.py apigateway query-user-domains --api-group-id 'xxx'""" + def test_bind_group_auth(self): + cmd = """python ../../main.py apigateway bind-group-auth --access-auth-id 'xxx' --deployment-ids 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -680,8 +680,8 @@ def test_query_user_domains(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_user_domain(self): - cmd = """python ../../main.py apigateway create-user-domain --domain 'xxx' --api-group-id 'xxx'""" + def test_query_auth_group_list(self): + cmd = """python ../../main.py apigateway query-auth-group-list --auth-user-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -689,8 +689,8 @@ def test_create_user_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_user_domain(self): - cmd = """python ../../main.py apigateway delete-user-domain --domain-ids 'xxx'""" + def test_authorized_api_group_list(self): + cmd = """python ../../main.py apigateway authorized-api-group-list """ with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/baseanti_test.py b/testcases/generated/baseanti_test.py index cc2bde1..4cef530 100644 --- a/testcases/generated/baseanti_test.py +++ b/testcases/generated/baseanti_test.py @@ -23,8 +23,8 @@ class BaseantiTest(unittest.TestCase): - def test_describe_attack_logs(self): - cmd = """python ../../main.py baseanti describe-attack-logs --start-time 'xxx' --end-time 'xxx'""" + def test_describe_ip_resources(self): + cmd = """python ../../main.py baseanti describe-ip-resources """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_attack_logs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_attack_statistics(self): - cmd = """python ../../main.py baseanti describe-attack-statistics --start-time 'xxx' --end-time 'xxx'""" + def test_describe_elastic_ip_resources(self): + cmd = """python ../../main.py baseanti describe-elastic-ip-resources """ with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_describe_attack_statistics(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_attack_type_count(self): - cmd = """python ../../main.py baseanti describe-attack-type-count --start-time 'xxx' --end-time 'xxx'""" + def test_describe_cps_ip_resources(self): + cmd = """python ../../main.py baseanti describe-cps-ip-resources """ with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_describe_attack_type_count(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_ip_monitor_flow(self): - cmd = """python ../../main.py baseanti describe-ip-monitor-flow --start-time 'xxx' --end-time 'xxx'""" + def test_describe_ccs_ip_resources(self): + cmd = """python ../../main.py baseanti describe-ccs-ip-resources """ with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_describe_ip_monitor_flow(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_ip_resources(self): - cmd = """python ../../main.py baseanti describe-ip-resources """ + def test_describe_waf_ip_resources(self): + cmd = """python ../../main.py baseanti describe-waf-ip-resources """ with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_describe_ip_resources(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_elastic_ip_resources(self): - cmd = """python ../../main.py baseanti describe-elastic-ip-resources """ + def test_describe_ip_resource_info(self): + cmd = """python ../../main.py baseanti describe-ip-resource-info --ip 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_describe_elastic_ip_resources(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_cps_ip_resources(self): - cmd = """python ../../main.py baseanti describe-cps-ip-resources """ + def test_describe_ip_safety_info(self): + cmd = """python ../../main.py baseanti describe-ip-safety-info --ip 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_describe_cps_ip_resources(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_ccs_ip_resources(self): - cmd = """python ../../main.py baseanti describe-ccs-ip-resources """ + def test_set_clean_threshold(self): + cmd = """python ../../main.py baseanti set-clean-threshold --ip 'xxx' --clean-threshold-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_describe_ccs_ip_resources(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_ip_resource_info(self): - cmd = """python ../../main.py baseanti describe-ip-resource-info --ip 'xxx'""" + def test_set_ip_clean_threshold(self): + cmd = """python ../../main.py baseanti set-ip-clean-threshold --ip-clean-threshold-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_describe_ip_resource_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_ip_safety_info(self): - cmd = """python ../../main.py baseanti describe-ip-safety-info --ip 'xxx'""" + def test_describe_ip_clean_threshold_range(self): + cmd = """python ../../main.py baseanti describe-ip-clean-threshold-range --ip 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_describe_ip_safety_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_clean_threshold(self): - cmd = """python ../../main.py baseanti set-clean-threshold --ip 'xxx' --clean-threshold-spec '{"":""}'""" + def test_describe_ip_resource_protect_info(self): + cmd = """python ../../main.py baseanti describe-ip-resource-protect-info --ip 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_set_clean_threshold(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_ip_clean_threshold(self): - cmd = """python ../../main.py baseanti set-ip-clean-threshold --ip-clean-threshold-spec '{"":""}'""" + def test_describe_ip_resource_flow(self): + cmd = """python ../../main.py baseanti describe-ip-resource-flow --ip 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_set_ip_clean_threshold(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_ip_clean_threshold_range(self): - cmd = """python ../../main.py baseanti describe-ip-clean-threshold-range --ip 'xxx'""" + def test_describe_attack_logs(self): + cmd = """python ../../main.py baseanti describe-attack-logs --start-time 'xxx' --end-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_describe_ip_clean_threshold_range(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_ip_resource_protect_info(self): - cmd = """python ../../main.py baseanti describe-ip-resource-protect-info --ip 'xxx'""" + def test_describe_attack_statistics(self): + cmd = """python ../../main.py baseanti describe-attack-statistics --start-time 'xxx' --end-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,17 @@ def test_describe_ip_resource_protect_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_ip_resource_flow(self): - cmd = """python ../../main.py baseanti describe-ip-resource-flow --ip 'xxx'""" + def test_describe_attack_type_count(self): + cmd = """python ../../main.py baseanti describe-attack-type-count --start-time 'xxx' --end-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_ip_monitor_flow(self): + cmd = """python ../../main.py baseanti describe-ip-monitor-flow --start-time 'xxx' --end-time 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/cdn_test.py b/testcases/generated/cdn_test.py index 05babf5..49a3fd1 100644 --- a/testcases/generated/cdn_test.py +++ b/testcases/generated/cdn_test.py @@ -23,8 +23,8 @@ class CdnTest(unittest.TestCase): - def test_query_domains_log(self): - cmd = """python ../../main.py cdn query-domains-log """ + def test_query_forbidden_info_list(self): + cmd = """python ../../main.py cdn query-forbidden-info-list """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_query_domains_log(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_domain_log(self): - cmd = """python ../../main.py cdn query-domain-log --domain 'xxx'""" + def test_create_forbidden_info(self): + cmd = """python ../../main.py cdn create-forbidden-info """ with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_query_domain_log(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_online_billing_type(self): - cmd = """python ../../main.py cdn query-online-billing-type """ + def test_delete_forbidden_info(self): + cmd = """python ../../main.py cdn delete-forbidden-info """ with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_query_online_billing_type(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_online_billing_type(self): - cmd = """python ../../main.py cdn set-online-billing-type """ + def test_query_un_forbidden_status(self): + cmd = """python ../../main.py cdn query-un-forbidden-status """ with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_set_online_billing_type(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_band(self): - cmd = """python ../../main.py cdn query-band """ + def test_create_live_domain_prefecth_task(self): + cmd = """python ../../main.py cdn create-live-domain-prefecth-task """ with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_query_band(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_band_with_area(self): - cmd = """python ../../main.py cdn query-band-with-area """ + def test_query_live_prefetch_task(self): + cmd = """python ../../main.py cdn query-live-prefetch-task """ with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_query_band_with_area(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_domain_config_status(self): - cmd = """python ../../main.py cdn query-domain-config-status --task-id 'xxx'""" + def test_query_area_isp_list(self): + cmd = """python ../../main.py cdn query-area-isp-list """ with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_query_domain_config_status(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_area_isp_list(self): - cmd = """python ../../main.py cdn query-area-isp-list """ + def test_query_area_isp_list_v2(self): + cmd = """python ../../main.py cdn query-area-isp-list-v2 """ with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_query_area_isp_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_preview_certificate(self): - cmd = """python ../../main.py cdn preview-certificate --domain 'xxx'""" + def test_query_mix_statistics_data(self): + cmd = """python ../../main.py cdn query-mix-statistics-data """ with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_preview_certificate(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_default_http_header_key(self): - cmd = """python ../../main.py cdn query-default-http-header-key """ + def test_query_mix_statistics_with_area_data(self): + cmd = """python ../../main.py cdn query-mix-statistics-with-area-data """ with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_query_default_http_header_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_ip_black_list(self): - cmd = """python ../../main.py cdn query-ip-black-list --domain 'xxx'""" + def test_query_mix_traffic_group_sum(self): + cmd = """python ../../main.py cdn query-mix-traffic-group-sum """ with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_query_ip_black_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_ip_black_list(self): - cmd = """python ../../main.py cdn set-ip-black-list --domain 'xxx'""" + def test_query_statistics_data(self): + cmd = """python ../../main.py cdn query-statistics-data """ with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_set_ip_black_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_operate_ip_black_list(self): - cmd = """python ../../main.py cdn operate-ip-black-list --domain 'xxx'""" + def test_query_statistics_data_group_by_area(self): + cmd = """python ../../main.py cdn query-statistics-data-group-by-area """ with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_operate_ip_black_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_cache_rule(self): - cmd = """python ../../main.py cdn create-cache-rule --domain 'xxx'""" + def test_query_statistics_data_group_sum(self): + cmd = """python ../../main.py cdn query-statistics-data-group-sum """ with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_create_cache_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_cache_rule(self): - cmd = """python ../../main.py cdn update-cache-rule --domain 'xxx'""" + def test_query_live_statistics_data(self): + cmd = """python ../../main.py cdn query-live-statistics-data """ with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_update_cache_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_cache_rule(self): - cmd = """python ../../main.py cdn delete-cache-rule --domain 'xxx'""" + def test_query_live_statistics_area_data_group_by(self): + cmd = """python ../../main.py cdn query-live-statistics-area-data-group-by """ with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_delete_cache_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_http_header(self): - cmd = """python ../../main.py cdn query-http-header --domain 'xxx'""" + def test_query_live_traffic_group_sum(self): + cmd = """python ../../main.py cdn query-live-traffic-group-sum """ with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_query_http_header(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_http_header(self): - cmd = """python ../../main.py cdn set-http-header --domain 'xxx'""" + def test_query_statistics_top_ip(self): + cmd = """python ../../main.py cdn query-statistics-top-ip """ with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_set_http_header(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_http_header(self): - cmd = """python ../../main.py cdn delete-http-header --domain 'xxx'""" + def test_query_statistics_top_url(self): + cmd = """python ../../main.py cdn query-statistics-top-url """ with os.popen(cmd) as f: content = f.read() @@ -194,8 +194,8 @@ def test_delete_http_header(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_video_draft(self): - cmd = """python ../../main.py cdn set-video-draft --domain 'xxx'""" + def test_query_dir_bandwidth(self): + cmd = """python ../../main.py cdn query-dir-bandwidth """ with os.popen(cmd) as f: content = f.read() @@ -203,8 +203,8 @@ def test_set_video_draft(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_range(self): - cmd = """python ../../main.py cdn set-range --domain 'xxx'""" + def test_query_dir_stats_data(self): + cmd = """python ../../main.py cdn query-dir-stats-data """ with os.popen(cmd) as f: content = f.read() @@ -212,8 +212,8 @@ def test_set_range(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_ignore_query_string(self): - cmd = """python ../../main.py cdn set-ignore-query-string --domain 'xxx'""" + def test_query_customized_dir_band_width(self): + cmd = """python ../../main.py cdn query-customized-dir-band-width """ with os.popen(cmd) as f: content = f.read() @@ -221,8 +221,8 @@ def test_set_ignore_query_string(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_user_agent(self): - cmd = """python ../../main.py cdn query-user-agent --domain 'xxx'""" + def test_query_stream_info(self): + cmd = """python ../../main.py cdn query-stream-info --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -230,8 +230,8 @@ def test_query_user_agent(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_user_agent_config(self): - cmd = """python ../../main.py cdn set-user-agent-config --domain 'xxx'""" + def test_query_domain_temp_inst_list(self): + cmd = """python ../../main.py cdn query-domain-temp-inst-list """ with os.popen(cmd) as f: content = f.read() @@ -239,8 +239,8 @@ def test_set_user_agent_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_accesskey_config(self): - cmd = """python ../../main.py cdn query-accesskey-config --domain 'xxx'""" + def test_query_domain_temp_pro_keys(self): + cmd = """python ../../main.py cdn query-domain-temp-pro-keys """ with os.popen(cmd) as f: content = f.read() @@ -248,8 +248,8 @@ def test_query_accesskey_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_accesskey_config(self): - cmd = """python ../../main.py cdn set-accesskey-config --domain 'xxx'""" + def test_modify_domain_temp_inst(self): + cmd = """python ../../main.py cdn modify-domain-temp-inst """ with os.popen(cmd) as f: content = f.read() @@ -257,8 +257,8 @@ def test_set_accesskey_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_refer(self): - cmd = """python ../../main.py cdn set-refer --domain 'xxx'""" + def test_query_domain_temp_inst(self): + cmd = """python ../../main.py cdn query-domain-temp-inst --inst-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -266,8 +266,8 @@ def test_set_refer(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_monitor(self): - cmd = """python ../../main.py cdn query-monitor --domain 'xxx'""" + def test_del_domain_temp_instance(self): + cmd = """python ../../main.py cdn del-domain-temp-instance --inst-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -275,8 +275,8 @@ def test_query_monitor(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_monitor(self): - cmd = """python ../../main.py cdn set-monitor --domain 'xxx'""" + def test_get_domain_list(self): + cmd = """python ../../main.py cdn get-domain-list """ with os.popen(cmd) as f: content = f.read() @@ -284,8 +284,8 @@ def test_set_monitor(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_monitor(self): - cmd = """python ../../main.py cdn stop-monitor --domain 'xxx'""" + def test_get_domain_list_by_filter(self): + cmd = """python ../../main.py cdn get-domain-list-by-filter """ with os.popen(cmd) as f: content = f.read() @@ -293,8 +293,8 @@ def test_stop_monitor(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_source(self): - cmd = """python ../../main.py cdn set-source --domain 'xxx'""" + def test_get_domain_detail(self): + cmd = """python ../../main.py cdn get-domain-detail --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -302,8 +302,8 @@ def test_set_source(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_operate_share_cache(self): - cmd = """python ../../main.py cdn operate-share-cache --domain 'xxx'""" + def test_create_domain(self): + cmd = """python ../../main.py cdn create-domain --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -311,8 +311,8 @@ def test_operate_share_cache(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_http_type(self): - cmd = """python ../../main.py cdn set-http-type --domain 'xxx'""" + def test_delete_domain(self): + cmd = """python ../../main.py cdn delete-domain --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -320,8 +320,8 @@ def test_set_http_type(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_follow_redirect(self): - cmd = """python ../../main.py cdn query-follow-redirect --domain 'xxx'""" + def test_start_domain(self): + cmd = """python ../../main.py cdn start-domain --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -329,8 +329,8 @@ def test_query_follow_redirect(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_follow_redirect(self): - cmd = """python ../../main.py cdn set-follow-redirect --domain 'xxx'""" + def test_stop_domain(self): + cmd = """python ../../main.py cdn stop-domain --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -338,8 +338,8 @@ def test_set_follow_redirect(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_follow_source_protocol(self): - cmd = """python ../../main.py cdn query-follow-source-protocol --domain 'xxx'""" + def test_query_oss_buckets(self): + cmd = """python ../../main.py cdn query-oss-buckets """ with os.popen(cmd) as f: content = f.read() @@ -347,8 +347,8 @@ def test_query_follow_source_protocol(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_follow_source_protocol(self): - cmd = """python ../../main.py cdn set-follow-source-protocol --domain 'xxx'""" + def test_batch_create(self): + cmd = """python ../../main.py cdn batch-create """ with os.popen(cmd) as f: content = f.read() @@ -356,8 +356,8 @@ def test_set_follow_source_protocol(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_domain_config(self): - cmd = """python ../../main.py cdn set-domain-config --domain 'xxx'""" + def test_query_domain_config(self): + cmd = """python ../../main.py cdn query-domain-config --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -365,8 +365,8 @@ def test_set_domain_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_domain_all_config_classify(self): - cmd = """python ../../main.py cdn query-domain-all-config-classify --domain 'xxx'""" + def test_config_service_notice(self): + cmd = """python ../../main.py cdn config-service-notice """ with os.popen(cmd) as f: content = f.read() @@ -374,8 +374,62 @@ def test_query_domain_all_config_classify(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_execute_domain_copy(self): - cmd = """python ../../main.py cdn execute-domain-copy """ + def test_query_service_notice(self): + cmd = """python ../../main.py cdn query-service-notice """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_online_billing_type(self): + cmd = """python ../../main.py cdn query-online-billing-type """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_set_online_billing_type(self): + cmd = """python ../../main.py cdn set-online-billing-type """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_domain_config_status(self): + cmd = """python ../../main.py cdn query-domain-config-status --task-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_check_whether_ip_belong_to_jcloud(self): + cmd = """python ../../main.py cdn check-whether-ip-belong-to-jcloud """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_service_ip(self): + cmd = """python ../../main.py cdn query-service-ip """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_get_all_upper_node_ip_list(self): + cmd = """python ../../main.py cdn get-all-upper-node-ip-list """ with os.popen(cmd) as f: content = f.read() @@ -437,8 +491,8 @@ def test_batch_delete_domain_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_domain_list(self): - cmd = """python ../../main.py cdn get-domain-list """ + def test_query_waf_switch(self): + cmd = """python ../../main.py cdn query-waf-switch --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -446,8 +500,8 @@ def test_get_domain_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_domain_list_by_filter(self): - cmd = """python ../../main.py cdn get-domain-list-by-filter """ + def test_set_waf_switch(self): + cmd = """python ../../main.py cdn set-waf-switch --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -455,8 +509,8 @@ def test_get_domain_list_by_filter(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_domain_detail(self): - cmd = """python ../../main.py cdn get-domain-detail --domain 'xxx'""" + def test_query_waf_white_rule_switch(self): + cmd = """python ../../main.py cdn query-waf-white-rule-switch --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -464,8 +518,8 @@ def test_get_domain_detail(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_domain(self): - cmd = """python ../../main.py cdn create-domain --domain 'xxx'""" + def test_set_waf_white_rule_switch(self): + cmd = """python ../../main.py cdn set-waf-white-rule-switch --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -473,8 +527,8 @@ def test_create_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_domain(self): - cmd = """python ../../main.py cdn delete-domain --domain 'xxx'""" + def test_querywaf_white_rules(self): + cmd = """python ../../main.py cdn querywaf-white-rules --domain 'xxx' --rule-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -482,8 +536,8 @@ def test_delete_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_domain(self): - cmd = """python ../../main.py cdn start-domain --domain 'xxx'""" + def test_create_waf_white_rule(self): + cmd = """python ../../main.py cdn create-waf-white-rule --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -491,8 +545,8 @@ def test_start_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_domain(self): - cmd = """python ../../main.py cdn stop-domain --domain 'xxx'""" + def test_update_waf_white_rule(self): + cmd = """python ../../main.py cdn update-waf-white-rule --domain 'xxx' --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -500,8 +554,8 @@ def test_stop_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_oss_buckets(self): - cmd = """python ../../main.py cdn query-oss-buckets """ + def test_enable_waf_white_rules(self): + cmd = """python ../../main.py cdn enable-waf-white-rules --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -509,8 +563,8 @@ def test_query_oss_buckets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_batch_create(self): - cmd = """python ../../main.py cdn batch-create """ + def test_disable_waf_white_rules(self): + cmd = """python ../../main.py cdn disable-waf-white-rules --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -518,8 +572,467 @@ def test_batch_create(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_domain_config(self): - cmd = """python ../../main.py cdn query-domain-config --domain 'xxx'""" + def test_delete_waf_white_rules(self): + cmd = """python ../../main.py cdn delete-waf-white-rules --domain 'xxx' --ids 'xxx' --rule-type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_waf_black_rule_switch(self): + cmd = """python ../../main.py cdn query-waf-black-rule-switch --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_set_waf_black_rule_switch(self): + cmd = """python ../../main.py cdn set-waf-black-rule-switch --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_querywaf_black_rules(self): + cmd = """python ../../main.py cdn querywaf-black-rules --domain 'xxx' --rule-type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_waf_black_rule(self): + cmd = """python ../../main.py cdn create-waf-black-rule --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_waf_black_rule(self): + cmd = """python ../../main.py cdn update-waf-black-rule --domain 'xxx' --id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_enable_waf_black_rules(self): + cmd = """python ../../main.py cdn enable-waf-black-rules --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_disable_waf_black_rules(self): + cmd = """python ../../main.py cdn disable-waf-black-rules --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_waf_black_rules(self): + cmd = """python ../../main.py cdn delete-waf-black-rules --domain 'xxx' --ids 'xxx' --rule-type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_ccprotect_switch(self): + cmd = """python ../../main.py cdn query-ccprotect-switch --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_set_ccprotect_switch(self): + cmd = """python ../../main.py cdn set-ccprotect-switch --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_ccprotect_rules(self): + cmd = """python ../../main.py cdn query-ccprotect-rules --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_ccprotect_rule(self): + cmd = """python ../../main.py cdn create-ccprotect-rule --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_ccprotect_rule(self): + cmd = """python ../../main.py cdn update-ccprotect-rule --domain 'xxx' --id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_enable_ccprotect_rule(self): + cmd = """python ../../main.py cdn enable-ccprotect-rule --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_disable_ccprotect_rule(self): + cmd = """python ../../main.py cdn disable-ccprotect-rule --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_ccprotect_rule(self): + cmd = """python ../../main.py cdn delete-ccprotect-rule --domain 'xxx' --ids 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_web_protect_switch(self): + cmd = """python ../../main.py cdn query-web-protect-switch --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_set_web_protect_switch(self): + cmd = """python ../../main.py cdn set-web-protect-switch --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_web_protect_settings(self): + cmd = """python ../../main.py cdn query-web-protect-settings --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_web_protect_settings(self): + cmd = """python ../../main.py cdn update-web-protect-settings --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_waf_regions(self): + cmd = """python ../../main.py cdn query-waf-regions --skip-type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_ip_black_setting_status(self): + cmd = """python ../../main.py cdn query-ip-black-setting-status --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_bat_create_prefetch_task(self): + cmd = """python ../../main.py cdn bat-create-prefetch-task """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_prefetch_task(self): + cmd = """python ../../main.py cdn update-prefetch-task """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_prefetch_task(self): + cmd = """python ../../main.py cdn query-prefetch-task """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_stop_prefetch_task(self): + cmd = """python ../../main.py cdn stop-prefetch-task """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_operate_purge_task(self): + cmd = """python ../../main.py cdn operate-purge-task """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_purge_task(self): + cmd = """python ../../main.py cdn query-purge-task """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_net_protection_rules(self): + cmd = """python ../../main.py cdn query-net-protection-rules """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_set_net_protection_rules(self): + cmd = """python ../../main.py cdn set-net-protection-rules """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_net_protection_rules_switch(self): + cmd = """python ../../main.py cdn query-net-protection-rules-switch """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_set_net_protection_rules_switch(self): + cmd = """python ../../main.py cdn set-net-protection-rules-switch """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_geo_areas(self): + cmd = """python ../../main.py cdn query-geo-areas """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_attack_type_count(self): + cmd = """python ../../main.py cdn query-attack-type-count """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_ddos_graph(self): + cmd = """python ../../main.py cdn query-ddos-graph """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_search_attack_log(self): + cmd = """python ../../main.py cdn search-attack-log """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_preview_certificate(self): + cmd = """python ../../main.py cdn preview-certificate --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_default_http_header_key(self): + cmd = """python ../../main.py cdn query-default-http-header-key """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_ip_black_list(self): + cmd = """python ../../main.py cdn query-ip-black-list --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_set_ip_black_list(self): + cmd = """python ../../main.py cdn set-ip-black-list --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_operate_ip_black_list(self): + cmd = """python ../../main.py cdn operate-ip-black-list --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_custom_error_page(self): + cmd = """python ../../main.py cdn query-custom-error-page --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_set_custom_error_page(self): + cmd = """python ../../main.py cdn set-custom-error-page --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_cache_rule(self): + cmd = """python ../../main.py cdn create-cache-rule --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_cache_rule(self): + cmd = """python ../../main.py cdn update-cache-rule --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_cache_rule(self): + cmd = """python ../../main.py cdn delete-cache-rule --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_set_cache_rules(self): + cmd = """python ../../main.py cdn set-cache-rules --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_query_http_header(self): + cmd = """python ../../main.py cdn query-http-header --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_set_http_header(self): + cmd = """python ../../main.py cdn set-http-header --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_http_header(self): + cmd = """python ../../main.py cdn delete-http-header --domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_set_video_draft(self): + cmd = """python ../../main.py cdn set-video-draft --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -527,8 +1040,8 @@ def test_query_domain_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_check_whether_ip_belong_to_jcloud(self): - cmd = """python ../../main.py cdn check-whether-ip-belong-to-jcloud """ + def test_set_range(self): + cmd = """python ../../main.py cdn set-range --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -536,8 +1049,8 @@ def test_check_whether_ip_belong_to_jcloud(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_live_domain_back_source(self): - cmd = """python ../../main.py cdn set-live-domain-back-source --domain 'xxx'""" + def test_set_ignore_query_string(self): + cmd = """python ../../main.py cdn set-ignore-query-string --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -545,8 +1058,8 @@ def test_set_live_domain_back_source(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_live_domain_ip_black_list(self): - cmd = """python ../../main.py cdn set-live-domain-ip-black-list --domain 'xxx'""" + def test_set_filter_args(self): + cmd = """python ../../main.py cdn set-filter-args --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -554,8 +1067,8 @@ def test_set_live_domain_ip_black_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_live_domain_refer(self): - cmd = """python ../../main.py cdn set-live-domain-refer --domain 'xxx'""" + def test_query_filter_args(self): + cmd = """python ../../main.py cdn query-filter-args --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -563,8 +1076,8 @@ def test_set_live_domain_refer(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_operate_live_domain_ip_black_list(self): - cmd = """python ../../main.py cdn operate-live-domain-ip-black-list --domain 'xxx'""" + def test_query_user_agent(self): + cmd = """python ../../main.py cdn query-user-agent --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -572,8 +1085,8 @@ def test_operate_live_domain_ip_black_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_live_domain_back_source_host(self): - cmd = """python ../../main.py cdn set-live-domain-back-source-host --domain 'xxx'""" + def test_set_user_agent_config(self): + cmd = """python ../../main.py cdn set-user-agent-config --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -581,8 +1094,8 @@ def test_set_live_domain_back_source_host(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_live_domain_access_key(self): - cmd = """python ../../main.py cdn set-live-domain-access-key --domain 'xxx'""" + def test_query_accesskey_config(self): + cmd = """python ../../main.py cdn query-accesskey-config --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -590,8 +1103,8 @@ def test_set_live_domain_access_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_protocol_convert(self): - cmd = """python ../../main.py cdn set-protocol-convert --domain 'xxx'""" + def test_set_accesskey_config(self): + cmd = """python ../../main.py cdn set-accesskey-config --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -599,8 +1112,8 @@ def test_set_protocol_convert(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_forbidden_stream(self): - cmd = """python ../../main.py cdn delete-forbidden-stream --domain 'xxx'""" + def test_set_refer(self): + cmd = """python ../../main.py cdn set-refer --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -608,8 +1121,8 @@ def test_delete_forbidden_stream(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_push_domain_orapp_or_stream(self): - cmd = """python ../../main.py cdn query-push-domain-orapp-or-stream --domain 'xxx'""" + def test_query_monitor(self): + cmd = """python ../../main.py cdn query-monitor --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -617,8 +1130,8 @@ def test_query_push_domain_orapp_or_stream(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_batch_create_live_domain(self): - cmd = """python ../../main.py cdn batch-create-live-domain """ + def test_set_monitor(self): + cmd = """python ../../main.py cdn set-monitor --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -626,8 +1139,8 @@ def test_batch_create_live_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_live_domain_detail(self): - cmd = """python ../../main.py cdn query-live-domain-detail --domain 'xxx'""" + def test_stop_monitor(self): + cmd = """python ../../main.py cdn stop-monitor --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -635,8 +1148,8 @@ def test_query_live_domain_detail(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_live_domain_apps(self): - cmd = """python ../../main.py cdn query-live-domain-apps --domain 'xxx'""" + def test_set_source(self): + cmd = """python ../../main.py cdn set-source --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -644,8 +1157,8 @@ def test_query_live_domain_apps(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_live_domain_prefecth_task(self): - cmd = """python ../../main.py cdn create-live-domain-prefecth-task """ + def test_operate_share_cache(self): + cmd = """python ../../main.py cdn operate-share-cache --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -653,8 +1166,8 @@ def test_create_live_domain_prefecth_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_live_prefetch_task(self): - cmd = """python ../../main.py cdn query-live-prefetch-task """ + def test_set_http_type(self): + cmd = """python ../../main.py cdn set-http-type --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -662,8 +1175,8 @@ def test_query_live_prefetch_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_refresh_task_by_ids(self): - cmd = """python ../../main.py cdn query-refresh-task-by-ids """ + def test_query_follow_redirect(self): + cmd = """python ../../main.py cdn query-follow-redirect --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -671,8 +1184,8 @@ def test_query_refresh_task_by_ids(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_refresh_task_by_id(self): - cmd = """python ../../main.py cdn query-refresh-task-by-id --task-id 'xxx'""" + def test_set_follow_redirect(self): + cmd = """python ../../main.py cdn set-follow-redirect --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -680,8 +1193,8 @@ def test_query_refresh_task_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_refresh_task_for_callback(self): - cmd = """python ../../main.py cdn create-refresh-task-for-callback """ + def test_query_follow_source_protocol(self): + cmd = """python ../../main.py cdn query-follow-source-protocol --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -689,8 +1202,8 @@ def test_create_refresh_task_for_callback(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_refresh_task_for_callback_v2(self): - cmd = """python ../../main.py cdn create-refresh-task-for-callback-v2 """ + def test_set_follow_source_protocol(self): + cmd = """python ../../main.py cdn set-follow-source-protocol --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -698,8 +1211,8 @@ def test_create_refresh_task_for_callback_v2(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_refresh_task(self): - cmd = """python ../../main.py cdn query-refresh-task """ + def test_set_domain_config(self): + cmd = """python ../../main.py cdn set-domain-config --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -707,8 +1220,8 @@ def test_query_refresh_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_refresh_task(self): - cmd = """python ../../main.py cdn create-refresh-task """ + def test_query_domain_all_config_classify(self): + cmd = """python ../../main.py cdn query-domain-all-config-classify --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -716,8 +1229,8 @@ def test_create_refresh_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_net_protection_rules(self): - cmd = """python ../../main.py cdn query-net-protection-rules """ + def test_execute_domain_copy(self): + cmd = """python ../../main.py cdn execute-domain-copy """ with os.popen(cmd) as f: content = f.read() @@ -725,8 +1238,8 @@ def test_query_net_protection_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_net_protection_rules(self): - cmd = """python ../../main.py cdn set-net-protection-rules """ + def test_query_extra_cache_time(self): + cmd = """python ../../main.py cdn query-extra-cache-time --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -734,8 +1247,8 @@ def test_set_net_protection_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_net_protection_rules_switch(self): - cmd = """python ../../main.py cdn query-net-protection-rules-switch """ + def test_set_extra_cache_time(self): + cmd = """python ../../main.py cdn set-extra-cache-time --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -743,8 +1256,8 @@ def test_query_net_protection_rules_switch(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_net_protection_rules_switch(self): - cmd = """python ../../main.py cdn set-net-protection-rules-switch """ + def test_delete_extra_cache_time(self): + cmd = """python ../../main.py cdn delete-extra-cache-time --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -752,8 +1265,8 @@ def test_set_net_protection_rules_switch(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_geo_areas(self): - cmd = """python ../../main.py cdn query-geo-areas """ + def test_batch_set_extra_cache_time(self): + cmd = """python ../../main.py cdn batch-set-extra-cache-time --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -761,8 +1274,8 @@ def test_query_geo_areas(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_attack_type_count(self): - cmd = """python ../../main.py cdn query-attack-type-count """ + def test_set_gzip(self): + cmd = """python ../../main.py cdn set-gzip --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -770,8 +1283,8 @@ def test_query_attack_type_count(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_ddos_graph(self): - cmd = """python ../../main.py cdn query-ddos-graph """ + def test_config_back_source_rule(self): + cmd = """python ../../main.py cdn config-back-source-rule --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -779,8 +1292,8 @@ def test_query_ddos_graph(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_search_attack_log(self): - cmd = """python ../../main.py cdn search-attack-log """ + def test_query_back_source_rule(self): + cmd = """python ../../main.py cdn query-back-source-rule --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -788,8 +1301,8 @@ def test_search_attack_log(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_all_upper_node_ip_list(self): - cmd = """python ../../main.py cdn get-all-upper-node-ip-list """ + def test_config_url_rule(self): + cmd = """python ../../main.py cdn config-url-rule --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -797,8 +1310,8 @@ def test_get_all_upper_node_ip_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_ssl_cert_list(self): - cmd = """python ../../main.py cdn get-ssl-cert-list """ + def test_query_url_rule(self): + cmd = """python ../../main.py cdn query-url-rule --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -806,8 +1319,8 @@ def test_get_ssl_cert_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_ssl_cert_detail(self): - cmd = """python ../../main.py cdn get-ssl-cert-detail --ssl-cert-id 'xxx'""" + def test_config_http2(self): + cmd = """python ../../main.py cdn config-http2 --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -815,8 +1328,8 @@ def test_get_ssl_cert_detail(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_upload_cert(self): - cmd = """python ../../main.py cdn upload-cert --cert-name 'xxx' --key-file 'xxx' --cert-file 'xxx'""" + def test_query_http2(self): + cmd = """python ../../main.py cdn query-http2 --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -824,8 +1337,8 @@ def test_upload_cert(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_mix_statistics_data(self): - cmd = """python ../../main.py cdn query-mix-statistics-data """ + def test_config_back_source_path(self): + cmd = """python ../../main.py cdn config-back-source-path --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -833,8 +1346,8 @@ def test_query_mix_statistics_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_mix_statistics_with_area_data(self): - cmd = """python ../../main.py cdn query-mix-statistics-with-area-data """ + def test_query_back_source_path(self): + cmd = """python ../../main.py cdn query-back-source-path --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -842,8 +1355,8 @@ def test_query_mix_statistics_with_area_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_mix_traffic_group_sum(self): - cmd = """python ../../main.py cdn query-mix-traffic-group-sum """ + def test_set_accelerate_region(self): + cmd = """python ../../main.py cdn set-accelerate-region --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -851,8 +1364,8 @@ def test_query_mix_traffic_group_sum(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_statistics_data(self): - cmd = """python ../../main.py cdn query-statistics-data """ + def test_config_back_source_rules(self): + cmd = """python ../../main.py cdn config-back-source-rules --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -860,8 +1373,8 @@ def test_query_statistics_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_statistics_data_group_by_area(self): - cmd = """python ../../main.py cdn query-statistics-data-group-by-area """ + def test_query_back_source_rules(self): + cmd = """python ../../main.py cdn query-back-source-rules --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -869,8 +1382,8 @@ def test_query_statistics_data_group_by_area(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_statistics_data_group_sum(self): - cmd = """python ../../main.py cdn query-statistics-data-group-sum """ + def test_config_back_source_oss(self): + cmd = """python ../../main.py cdn config-back-source-oss --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -878,8 +1391,8 @@ def test_query_statistics_data_group_sum(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_live_statistics_data(self): - cmd = """python ../../main.py cdn query-live-statistics-data """ + def test_query_back_source_oss(self): + cmd = """python ../../main.py cdn query-back-source-oss --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -887,8 +1400,8 @@ def test_query_live_statistics_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_live_statistics_area_data_group_by(self): - cmd = """python ../../main.py cdn query-live-statistics-area-data-group-by """ + def test_speed_limit(self): + cmd = """python ../../main.py cdn speed-limit --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -896,8 +1409,8 @@ def test_query_live_statistics_area_data_group_by(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_live_traffic_group_sum(self): - cmd = """python ../../main.py cdn query-live-traffic-group-sum """ + def test_query_band(self): + cmd = """python ../../main.py cdn query-band """ with os.popen(cmd) as f: content = f.read() @@ -905,8 +1418,8 @@ def test_query_live_traffic_group_sum(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_statistics_top_ip(self): - cmd = """python ../../main.py cdn query-statistics-top-ip """ + def test_query_band_with_area(self): + cmd = """python ../../main.py cdn query-band-with-area """ with os.popen(cmd) as f: content = f.read() @@ -914,8 +1427,8 @@ def test_query_statistics_top_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_statistics_top_url(self): - cmd = """python ../../main.py cdn query-statistics-top-url """ + def test_query_cdn_user_quota(self): + cmd = """python ../../main.py cdn query-cdn-user-quota """ with os.popen(cmd) as f: content = f.read() @@ -923,8 +1436,8 @@ def test_query_statistics_top_url(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_dir_bandwidth(self): - cmd = """python ../../main.py cdn query-dir-bandwidth """ + def test_query_refresh_task_by_ids(self): + cmd = """python ../../main.py cdn query-refresh-task-by-ids """ with os.popen(cmd) as f: content = f.read() @@ -932,8 +1445,8 @@ def test_query_dir_bandwidth(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_waf_switch(self): - cmd = """python ../../main.py cdn query-waf-switch --domain 'xxx'""" + def test_set_refresh_limit(self): + cmd = """python ../../main.py cdn set-refresh-limit """ with os.popen(cmd) as f: content = f.read() @@ -941,8 +1454,8 @@ def test_query_waf_switch(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_waf_switch(self): - cmd = """python ../../main.py cdn set-waf-switch --domain 'xxx'""" + def test_query_refresh_limit(self): + cmd = """python ../../main.py cdn query-refresh-limit """ with os.popen(cmd) as f: content = f.read() @@ -950,8 +1463,8 @@ def test_set_waf_switch(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_waf_white_rule_switch(self): - cmd = """python ../../main.py cdn query-waf-white-rule-switch --domain 'xxx'""" + def test_query_refresh_task_by_id(self): + cmd = """python ../../main.py cdn query-refresh-task-by-id --task-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -959,8 +1472,8 @@ def test_query_waf_white_rule_switch(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_waf_white_rule_switch(self): - cmd = """python ../../main.py cdn set-waf-white-rule-switch --domain 'xxx'""" + def test_create_refresh_task_for_callback(self): + cmd = """python ../../main.py cdn create-refresh-task-for-callback """ with os.popen(cmd) as f: content = f.read() @@ -968,8 +1481,8 @@ def test_set_waf_white_rule_switch(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_querywaf_white_rules(self): - cmd = """python ../../main.py cdn querywaf-white-rules --domain 'xxx' --rule-type 'xxx'""" + def test_create_refresh_task_for_callback_v2(self): + cmd = """python ../../main.py cdn create-refresh-task-for-callback-v2 """ with os.popen(cmd) as f: content = f.read() @@ -977,8 +1490,8 @@ def test_querywaf_white_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_waf_white_rule(self): - cmd = """python ../../main.py cdn create-waf-white-rule --domain 'xxx'""" + def test_query_refresh_task(self): + cmd = """python ../../main.py cdn query-refresh-task """ with os.popen(cmd) as f: content = f.read() @@ -986,8 +1499,8 @@ def test_create_waf_white_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_waf_white_rule(self): - cmd = """python ../../main.py cdn update-waf-white-rule --domain 'xxx' --id 'xxx'""" + def test_create_refresh_task(self): + cmd = """python ../../main.py cdn create-refresh-task """ with os.popen(cmd) as f: content = f.read() @@ -995,8 +1508,8 @@ def test_update_waf_white_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_enable_waf_white_rules(self): - cmd = """python ../../main.py cdn enable-waf-white-rules --domain 'xxx'""" + def test_get_ssl_cert_list(self): + cmd = """python ../../main.py cdn get-ssl-cert-list """ with os.popen(cmd) as f: content = f.read() @@ -1004,8 +1517,8 @@ def test_enable_waf_white_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disable_waf_white_rules(self): - cmd = """python ../../main.py cdn disable-waf-white-rules --domain 'xxx'""" + def test_get_ssl_cert_detail(self): + cmd = """python ../../main.py cdn get-ssl-cert-detail --ssl-cert-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1013,8 +1526,8 @@ def test_disable_waf_white_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_waf_white_rules(self): - cmd = """python ../../main.py cdn delete-waf-white-rules --domain 'xxx' --ids 'xxx' --rule-type 'xxx'""" + def test_upload_cert(self): + cmd = """python ../../main.py cdn upload-cert --cert-name 'xxx' --key-file 'xxx' --cert-file 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1022,8 +1535,8 @@ def test_delete_waf_white_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_waf_black_rule_switch(self): - cmd = """python ../../main.py cdn query-waf-black-rule-switch --domain 'xxx'""" + def test_query_avg_bandwidth_for_pcdn(self): + cmd = """python ../../main.py cdn query-avg-bandwidth-for-pcdn --starttime 'xxx' --stoptime 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1031,8 +1544,8 @@ def test_query_waf_black_rule_switch(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_waf_black_rule_switch(self): - cmd = """python ../../main.py cdn set-waf-black-rule-switch --domain 'xxx'""" + def test_query_device_status_for_pcdn(self): + cmd = """python ../../main.py cdn query-device-status-for-pcdn --mac-addr 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1040,8 +1553,8 @@ def test_set_waf_black_rule_switch(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_querywaf_black_rules(self): - cmd = """python ../../main.py cdn querywaf-black-rules --domain 'xxx' --rule-type 'xxx'""" + def test_query_jdbox_statistics_data(self): + cmd = """python ../../main.py cdn query-jdbox-statistics-data """ with os.popen(cmd) as f: content = f.read() @@ -1049,8 +1562,8 @@ def test_querywaf_black_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_waf_black_rule(self): - cmd = """python ../../main.py cdn create-waf-black-rule --domain 'xxx'""" + def test_query_jdbox_statistics_data_with_group(self): + cmd = """python ../../main.py cdn query-jdbox-statistics-data-with-group """ with os.popen(cmd) as f: content = f.read() @@ -1058,8 +1571,8 @@ def test_create_waf_black_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_waf_black_rule(self): - cmd = """python ../../main.py cdn update-waf-black-rule --domain 'xxx' --id 'xxx'""" + def test_query_jbox_avg_bandwidth(self): + cmd = """python ../../main.py cdn query-jbox-avg-bandwidth --starttime 'xxx' --stoptime 'xxx' --plugin-pin 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1067,8 +1580,8 @@ def test_update_waf_black_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_enable_waf_black_rules(self): - cmd = """python ../../main.py cdn enable-waf-black-rules --domain 'xxx'""" + def test_query_domains_log(self): + cmd = """python ../../main.py cdn query-domains-log """ with os.popen(cmd) as f: content = f.read() @@ -1076,8 +1589,8 @@ def test_enable_waf_black_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disable_waf_black_rules(self): - cmd = """python ../../main.py cdn disable-waf-black-rules --domain 'xxx'""" + def test_query_domain_log(self): + cmd = """python ../../main.py cdn query-domain-log --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1085,8 +1598,8 @@ def test_disable_waf_black_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_waf_black_rules(self): - cmd = """python ../../main.py cdn delete-waf-black-rules --domain 'xxx' --ids 'xxx' --rule-type 'xxx'""" + def test_waf_query_pv_for_area_and_ip(self): + cmd = """python ../../main.py cdn waf-query-pv-for-area-and-ip """ with os.popen(cmd) as f: content = f.read() @@ -1094,8 +1607,8 @@ def test_delete_waf_black_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_ccprotect_switch(self): - cmd = """python ../../main.py cdn query-ccprotect-switch --domain 'xxx'""" + def test_waf_query_pv(self): + cmd = """python ../../main.py cdn waf-query-pv """ with os.popen(cmd) as f: content = f.read() @@ -1103,8 +1616,8 @@ def test_query_ccprotect_switch(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_ccprotect_switch(self): - cmd = """python ../../main.py cdn set-ccprotect-switch --domain 'xxx'""" + def test_waf_query_attack_details(self): + cmd = """python ../../main.py cdn waf-query-attack-details """ with os.popen(cmd) as f: content = f.read() @@ -1112,8 +1625,8 @@ def test_set_ccprotect_switch(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_ccprotect_rules(self): - cmd = """python ../../main.py cdn query-ccprotect-rules --domain 'xxx'""" + def test_set_auth_config(self): + cmd = """python ../../main.py cdn set-auth-config --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1121,8 +1634,8 @@ def test_query_ccprotect_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_ccprotect_rule(self): - cmd = """python ../../main.py cdn create-ccprotect-rule --domain 'xxx'""" + def test_set_source_auth_config(self): + cmd = """python ../../main.py cdn set-source-auth-config --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1130,8 +1643,8 @@ def test_create_ccprotect_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_ccprotect_rule(self): - cmd = """python ../../main.py cdn update-ccprotect-rule --domain 'xxx' --id 'xxx'""" + def test_set_live_domain_back_source(self): + cmd = """python ../../main.py cdn set-live-domain-back-source --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1139,8 +1652,8 @@ def test_update_ccprotect_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_enable_ccprotect_rule(self): - cmd = """python ../../main.py cdn enable-ccprotect-rule --domain 'xxx'""" + def test_set_live_domain_ip_black_list(self): + cmd = """python ../../main.py cdn set-live-domain-ip-black-list --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1148,8 +1661,8 @@ def test_enable_ccprotect_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disable_ccprotect_rule(self): - cmd = """python ../../main.py cdn disable-ccprotect-rule --domain 'xxx'""" + def test_set_live_domain_refer(self): + cmd = """python ../../main.py cdn set-live-domain-refer --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1157,8 +1670,8 @@ def test_disable_ccprotect_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_ccprotect_rule(self): - cmd = """python ../../main.py cdn delete-ccprotect-rule --domain 'xxx' --ids 'xxx'""" + def test_operate_live_domain_ip_black_list(self): + cmd = """python ../../main.py cdn operate-live-domain-ip-black-list --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1166,8 +1679,8 @@ def test_delete_ccprotect_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_web_protect_switch(self): - cmd = """python ../../main.py cdn query-web-protect-switch --domain 'xxx'""" + def test_set_live_domain_back_source_host(self): + cmd = """python ../../main.py cdn set-live-domain-back-source-host --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1175,8 +1688,8 @@ def test_query_web_protect_switch(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_web_protect_switch(self): - cmd = """python ../../main.py cdn set-web-protect-switch --domain 'xxx'""" + def test_set_live_domain_access_key(self): + cmd = """python ../../main.py cdn set-live-domain-access-key --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1184,8 +1697,8 @@ def test_set_web_protect_switch(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_web_protect_settings(self): - cmd = """python ../../main.py cdn query-web-protect-settings --domain 'xxx'""" + def test_set_protocol_convert(self): + cmd = """python ../../main.py cdn set-protocol-convert --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1193,8 +1706,8 @@ def test_query_web_protect_settings(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_web_protect_settings(self): - cmd = """python ../../main.py cdn update-web-protect-settings --domain 'xxx'""" + def test_delete_forbidden_stream(self): + cmd = """python ../../main.py cdn delete-forbidden-stream --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1202,8 +1715,8 @@ def test_update_web_protect_settings(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_waf_regions(self): - cmd = """python ../../main.py cdn query-waf-regions --skip-type 'xxx'""" + def test_query_push_domain_orapp_or_stream(self): + cmd = """python ../../main.py cdn query-push-domain-orapp-or-stream --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1211,8 +1724,8 @@ def test_query_waf_regions(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_ip_black_setting_status(self): - cmd = """python ../../main.py cdn query-ip-black-setting-status --domain 'xxx'""" + def test_query_live_domain_ip_black_white_list(self): + cmd = """python ../../main.py cdn query-live-domain-ip-black-white-list --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1220,8 +1733,8 @@ def test_query_ip_black_setting_status(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_waf_query_pv_for_area_and_ip(self): - cmd = """python ../../main.py cdn waf-query-pv-for-area-and-ip """ + def test_batch_create_live_domain(self): + cmd = """python ../../main.py cdn batch-create-live-domain """ with os.popen(cmd) as f: content = f.read() @@ -1229,8 +1742,8 @@ def test_waf_query_pv_for_area_and_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_waf_query_pv(self): - cmd = """python ../../main.py cdn waf-query-pv """ + def test_query_live_domain_detail(self): + cmd = """python ../../main.py cdn query-live-domain-detail --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1238,8 +1751,8 @@ def test_waf_query_pv(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_waf_query_attack_details(self): - cmd = """python ../../main.py cdn waf-query-attack-details """ + def test_query_live_domain_apps(self): + cmd = """python ../../main.py cdn query-live-domain-apps --domain 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/clouddnsservice_test.py b/testcases/generated/clouddnsservice_test.py index e403518..4d36dcd 100644 --- a/testcases/generated/clouddnsservice_test.py +++ b/testcases/generated/clouddnsservice_test.py @@ -23,8 +23,8 @@ class ClouddnsserviceTest(unittest.TestCase): - def test_get_action_log(self): - cmd = """python ../../main.py clouddnsservice get-action-log --page-number '5' --page-size '5' --start-time 'xxx' --end-time 'xxx'""" + def test_search_rr(self): + cmd = """python ../../main.py clouddnsservice search-rr --domain-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_get_action_log(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_domains(self): - cmd = """python ../../main.py clouddnsservice get-domains --page-number '5' --page-size '5'""" + def test_get_view_tree(self): + cmd = """python ../../main.py clouddnsservice get-view-tree --domain-id 'xxx' --pack-id '5' --view-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_get_domains(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_domain(self): - cmd = """python ../../main.py clouddnsservice add-domain --pack-id '5' --domain-name 'xxx'""" + def test_add_rr(self): + cmd = """python ../../main.py clouddnsservice add-rr --domain-id 'xxx' --req '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_add_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_del_domain(self): - cmd = """python ../../main.py clouddnsservice del-domain --domain-id '5'""" + def test_update_rr(self): + cmd = """python ../../main.py clouddnsservice update-rr --domain-id 'xxx' --req '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_del_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_domain(self): - cmd = """python ../../main.py clouddnsservice update-domain --domain-name 'xxx' --id '5'""" + def test_operate_rr(self): + cmd = """python ../../main.py clouddnsservice operate-rr --domain-id 'xxx' --ids '[5]' --action 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_update_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_domain_query_count(self): - cmd = """python ../../main.py clouddnsservice get-domain-query-count --domain-id 'xxx' --domain-name 'xxx' --start 'xxx' --end 'xxx'""" + def test_batch_set_dns_resolve(self): + cmd = """python ../../main.py clouddnsservice batch-set-dns-resolve --req '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_get_domain_query_count(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_domain_query_traffic(self): - cmd = """python ../../main.py clouddnsservice get-domain-query-traffic --domain-id 'xxx' --domain-name 'xxx' --start 'xxx' --end 'xxx'""" + def test_get_domains(self): + cmd = """python ../../main.py clouddnsservice get-domains --page-number '5' --page-size '5'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_get_domain_query_traffic(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_search_rr(self): - cmd = """python ../../main.py clouddnsservice search-rr --domain-id 'xxx'""" + def test_add_domain(self): + cmd = """python ../../main.py clouddnsservice add-domain --pack-id '5' --domain-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_search_rr(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_view_tree(self): - cmd = """python ../../main.py clouddnsservice get-view-tree --domain-id 'xxx' --pack-id '5' --view-id '5'""" + def test_del_domain(self): + cmd = """python ../../main.py clouddnsservice del-domain --domain-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_get_view_tree(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_rr(self): - cmd = """python ../../main.py clouddnsservice add-rr --domain-id 'xxx' --req '{"":""}'""" + def test_update_domain(self): + cmd = """python ../../main.py clouddnsservice update-domain --domain-name 'xxx' --id '5'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_add_rr(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_rr(self): - cmd = """python ../../main.py clouddnsservice update-rr --domain-id 'xxx' --req '{"":""}'""" + def test_get_domain_query_count(self): + cmd = """python ../../main.py clouddnsservice get-domain-query-count --domain-id 'xxx' --domain-name 'xxx' --start 'xxx' --end 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_update_rr(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_operate_rr(self): - cmd = """python ../../main.py clouddnsservice operate-rr --domain-id 'xxx' --ids '[5]' --action 'xxx'""" + def test_get_domain_query_traffic(self): + cmd = """python ../../main.py clouddnsservice get-domain-query-traffic --domain-id 'xxx' --domain-name 'xxx' --start 'xxx' --end 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_operate_rr(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_batch_set_dns_resolve(self): - cmd = """python ../../main.py clouddnsservice batch-set-dns-resolve --req '[{"":""}]'""" + def test_get_action_log(self): + cmd = """python ../../main.py clouddnsservice get-action-log --page-number '5' --page-size '5' --start-time 'xxx' --end-time 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/containerregistry_test.py b/testcases/generated/containerregistry_test.py index b942683..a589967 100644 --- a/testcases/generated/containerregistry_test.py +++ b/testcases/generated/containerregistry_test.py @@ -23,8 +23,8 @@ class ContainerregistryTest(unittest.TestCase): - def test_get_authorization_token(self): - cmd = """python ../../main.py containerregistry get-authorization-token --registry-name 'xxx'""" + def test_create_repository(self): + cmd = """python ../../main.py containerregistry create-repository --registry-name 'xxx' --repository-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_get_authorization_token(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_authorization_tokens(self): - cmd = """python ../../main.py containerregistry describe-authorization-tokens --registry-name 'xxx'""" + def test_describe_repositories(self): + cmd = """python ../../main.py containerregistry describe-repositories """ with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_describe_authorization_tokens(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_release_authorization_token(self): - cmd = """python ../../main.py containerregistry release-authorization-token --registry-name 'xxx'""" + def test_delete_repository(self): + cmd = """python ../../main.py containerregistry delete-repository --registry-name 'xxx' --repository-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_release_authorization_token(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_images(self): - cmd = """python ../../main.py containerregistry describe-images """ + def test_check_repository_name(self): + cmd = """python ../../main.py containerregistry check-repository-name --registry-name 'xxx' --repository-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_describe_images(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_image(self): - cmd = """python ../../main.py containerregistry delete-image --registry-name 'xxx' --repository-name 'xxx'""" + def test_describe_images(self): + cmd = """python ../../main.py containerregistry describe-images """ with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_delete_image(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_quotas(self): - cmd = """python ../../main.py containerregistry describe-quotas """ + def test_delete_image(self): + cmd = """python ../../main.py containerregistry delete-image --registry-name 'xxx' --repository-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_check_registry_name(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_repository(self): - cmd = """python ../../main.py containerregistry create-repository --registry-name 'xxx' --repository-name 'xxx'""" + def test_describe_quotas(self): + cmd = """python ../../main.py containerregistry describe-quotas """ with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_create_repository(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_repositories(self): - cmd = """python ../../main.py containerregistry describe-repositories """ + def test_get_authorization_token(self): + cmd = """python ../../main.py containerregistry get-authorization-token --registry-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_describe_repositories(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_repository(self): - cmd = """python ../../main.py containerregistry delete-repository --registry-name 'xxx' --repository-name 'xxx'""" + def test_describe_authorization_tokens(self): + cmd = """python ../../main.py containerregistry describe-authorization-tokens --registry-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_delete_repository(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_check_repository_name(self): - cmd = """python ../../main.py containerregistry check-repository-name --registry-name 'xxx' --repository-name 'xxx'""" + def test_release_authorization_token(self): + cmd = """python ../../main.py containerregistry release-authorization-token --registry-name 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/cps_test.py b/testcases/generated/cps_test.py index 1085c1e..57a8405 100644 --- a/testcases/generated/cps_test.py +++ b/testcases/generated/cps_test.py @@ -23,8 +23,8 @@ class CpsTest(unittest.TestCase): - def test_describe_elastic_ips(self): - cmd = """python ../../main.py cps describe-elastic-ips """ + def test_describe_ipv6address(self): + cmd = """python ../../main.py cps describe-ipv6address --ipv6address-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_elastic_ips(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_apply_elastic_ips(self): - cmd = """python ../../main.py cps apply-elastic-ips --elastic-ip-spec '{"":""}'""" + def test_describe_ipv6addresses(self): + cmd = """python ../../main.py cps describe-ipv6addresses """ with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_apply_elastic_ips(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_elastic_ip(self): - cmd = """python ../../main.py cps describe-elastic-ip --elastic-ip-id 'xxx'""" + def test_assign_ipv6addresses_bandwidth(self): + cmd = """python ../../main.py cps assign-ipv6addresses-bandwidth --ipv6address-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_describe_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_elastic_ip_bandwidth(self): - cmd = """python ../../main.py cps modify-elastic-ip-bandwidth --elastic-ip-id 'xxx' --bandwidth '5'""" + def test_modify_ipv6address_bandwidth(self): + cmd = """python ../../main.py cps modify-ipv6address-bandwidth --ipv6address-id 'xxx' --bandwidth '5'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_modify_elastic_ip_bandwidth(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_device_types(self): - cmd = """python ../../main.py cps describe-device-types """ + def test_describe_certs(self): + cmd = """python ../../main.py cps describe-certs """ with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_describe_device_types(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_os(self): - cmd = """python ../../main.py cps describe-os --device-type 'xxx'""" + def test_create_cert(self): + cmd = """python ../../main.py cps create-cert --cert-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_describe_os(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_device_raids(self): - cmd = """python ../../main.py cps describe-device-raids --device-type 'xxx'""" + def test_describe_cert(self): + cmd = """python ../../main.py cps describe-cert --cert-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_describe_device_raids(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instance(self): - cmd = """python ../../main.py cps describe-instance --instance-id 'xxx'""" + def test_remove_cert(self): + cmd = """python ../../main.py cps remove-cert --cert-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_describe_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instances(self): - cmd = """python ../../main.py cps describe-instances """ + def test_modify_cert(self): + cmd = """python ../../main.py cps modify-cert --cert-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_describe_instances(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_instances(self): - cmd = """python ../../main.py cps create-instances --instance-spec '{"":""}'""" + def test_describe_alias_ips(self): + cmd = """python ../../main.py cps describe-alias-ips """ with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_create_instances(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instance_name(self): - cmd = """python ../../main.py cps describe-instance-name --instance-id 'xxx'""" + def test_create_alias_ip(self): + cmd = """python ../../main.py cps create-alias-ip --alias-ip-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_describe_instance_name(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_instance(self): - cmd = """python ../../main.py cps modify-instance --instance-id 'xxx'""" + def test_delete_alias_ip(self): + cmd = """python ../../main.py cps delete-alias-ip --alias-ip-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_modify_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instance_raid(self): - cmd = """python ../../main.py cps describe-instance-raid --instance-id 'xxx'""" + def test_describe_secondary_cidrs(self): + cmd = """python ../../main.py cps describe-secondary-cidrs --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_describe_instance_raid(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instance_status(self): - cmd = """python ../../main.py cps describe-instance-status --instance-id 'xxx'""" + def test_create_secondary_cidr(self): + cmd = """python ../../main.py cps create-secondary-cidr --secondary-cidr-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_describe_instance_status(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_restart_instance(self): - cmd = """python ../../main.py cps restart-instance --instance-id 'xxx'""" + def test_delete_secondary_cidr(self): + cmd = """python ../../main.py cps delete-secondary-cidr --secondary-cidr-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_restart_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_instance(self): - cmd = """python ../../main.py cps stop-instance --instance-id 'xxx'""" + def test_describe_elastic_ips(self): + cmd = """python ../../main.py cps describe-elastic-ips """ with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_stop_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_instance(self): - cmd = """python ../../main.py cps start-instance --instance-id 'xxx'""" + def test_apply_elastic_ips(self): + cmd = """python ../../main.py cps apply-elastic-ips --elastic-ip-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_start_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_reinstall_instance(self): - cmd = """python ../../main.py cps reinstall-instance --instance-id 'xxx' --instance-spec '{"":""}'""" + def test_describe_elastic_ip(self): + cmd = """python ../../main.py cps describe-elastic-ip --elastic-ip-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_reinstall_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_bandwidth(self): - cmd = """python ../../main.py cps modify-bandwidth --instance-id 'xxx' --bandwidth '5'""" + def test_modify_elastic_ip_bandwidth(self): + cmd = """python ../../main.py cps modify-elastic-ip-bandwidth --elastic-ip-id 'xxx' --bandwidth '5'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +194,8 @@ def test_modify_bandwidth(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_associate_elastic_ip(self): - cmd = """python ../../main.py cps associate-elastic-ip --instance-id 'xxx' --elastic-ip-id 'xxx'""" + def test_describe_elastic_ip_name(self): + cmd = """python ../../main.py cps describe-elastic-ip-name --elastic-ip-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +203,8 @@ def test_associate_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disassociate_elastic_ip(self): - cmd = """python ../../main.py cps disassociate-elastic-ip --instance-id 'xxx' --elastic-ip-id 'xxx'""" + def test_describe_server_groups(self): + cmd = """python ../../main.py cps describe-server-groups """ with os.popen(cmd) as f: content = f.read() @@ -212,8 +212,8 @@ def test_disassociate_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_reset_password(self): - cmd = """python ../../main.py cps reset-password --instance-id 'xxx' --password 'xxx'""" + def test_create_server_group(self): + cmd = """python ../../main.py cps create-server-group --server-group-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -221,8 +221,26 @@ def test_reset_password(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instance_monitor_info(self): - cmd = """python ../../main.py cps describe-instance-monitor-info --instance-id 'xxx'""" + def test_describe_server_group(self): + cmd = """python ../../main.py cps describe-server-group --server-group-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_server_group(self): + cmd = """python ../../main.py cps modify-server-group --server-group-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_server_group(self): + cmd = """python ../../main.py cps delete-server-group --server-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -275,8 +293,8 @@ def test_delete_keypairs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_listeners(self): - cmd = """python ../../main.py cps describe-listeners """ + def test_describe_load_balancers(self): + cmd = """python ../../main.py cps describe-load-balancers """ with os.popen(cmd) as f: content = f.read() @@ -284,8 +302,8 @@ def test_describe_listeners(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_listener(self): - cmd = """python ../../main.py cps create-listener --listener-spec '{"":""}'""" + def test_create_load_balancer(self): + cmd = """python ../../main.py cps create-load-balancer --load-balancer-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -293,8 +311,8 @@ def test_create_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_listener(self): - cmd = """python ../../main.py cps modify-listener --listener-id 'xxx'""" + def test_modify_load_balancer(self): + cmd = """python ../../main.py cps modify-load-balancer --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -302,8 +320,8 @@ def test_modify_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_listener(self): - cmd = """python ../../main.py cps describe-listener --listener-id 'xxx'""" + def test_describe_load_balancer(self): + cmd = """python ../../main.py cps describe-load-balancer --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -311,8 +329,8 @@ def test_describe_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_listener(self): - cmd = """python ../../main.py cps delete-listener --listener-id 'xxx'""" + def test_start_load_balancer(self): + cmd = """python ../../main.py cps start-load-balancer --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -320,8 +338,8 @@ def test_delete_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_listener(self): - cmd = """python ../../main.py cps start-listener --listener-id 'xxx'""" + def test_stop_load_balancer(self): + cmd = """python ../../main.py cps stop-load-balancer --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -329,8 +347,8 @@ def test_start_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_listener(self): - cmd = """python ../../main.py cps stop-listener --listener-id 'xxx'""" + def test_associate_elastic_ip_lb(self): + cmd = """python ../../main.py cps associate-elastic-ip-lb --load-balancer-id 'xxx' --elastic-ip-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -338,8 +356,8 @@ def test_stop_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_load_balancers(self): - cmd = """python ../../main.py cps describe-load-balancers """ + def test_disassociate_elastic_ip_lb(self): + cmd = """python ../../main.py cps disassociate-elastic-ip-lb --load-balancer-id 'xxx' --elastic-ip-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -347,8 +365,8 @@ def test_describe_load_balancers(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_load_balancer(self): - cmd = """python ../../main.py cps create-load-balancer --load-balancer-spec '{"":""}'""" + def test_describe_slbs_name(self): + cmd = """python ../../main.py cps describe-slbs-name --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -356,8 +374,8 @@ def test_create_load_balancer(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_load_balancer(self): - cmd = """python ../../main.py cps modify-load-balancer --load-balancer-id 'xxx'""" + def test_describe_servers(self): + cmd = """python ../../main.py cps describe-servers --server-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -365,8 +383,8 @@ def test_modify_load_balancer(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_load_balancer(self): - cmd = """python ../../main.py cps describe-load-balancer --load-balancer-id 'xxx'""" + def test_add_servers(self): + cmd = """python ../../main.py cps add-servers --server-group-id 'xxx' --server-spec '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -374,8 +392,8 @@ def test_describe_load_balancer(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_load_balancer(self): - cmd = """python ../../main.py cps start-load-balancer --load-balancer-id 'xxx'""" + def test_modify_server(self): + cmd = """python ../../main.py cps modify-server --server-group-id 'xxx' --server-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -383,8 +401,8 @@ def test_start_load_balancer(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_load_balancer(self): - cmd = """python ../../main.py cps stop-load-balancer --load-balancer-id 'xxx'""" + def test_remove_server(self): + cmd = """python ../../main.py cps remove-server --server-group-id 'xxx' --server-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -392,8 +410,8 @@ def test_stop_load_balancer(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_associate_elastic_ip_lb(self): - cmd = """python ../../main.py cps associate-elastic-ip-lb --load-balancer-id 'xxx' --elastic-ip-id 'xxx'""" + def test_describe_ipv6gateways(self): + cmd = """python ../../main.py cps describe-ipv6gateways """ with os.popen(cmd) as f: content = f.read() @@ -401,8 +419,8 @@ def test_associate_elastic_ip_lb(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disassociate_elastic_ip_lb(self): - cmd = """python ../../main.py cps disassociate-elastic-ip-lb --load-balancer-id 'xxx' --elastic-ip-id 'xxx'""" + def test_describe_ipv6gateway(self): + cmd = """python ../../main.py cps describe-ipv6gateway --ipv6gateway-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -410,8 +428,8 @@ def test_disassociate_elastic_ip_lb(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_regiones(self): - cmd = """python ../../main.py cps describe-regiones """ + def test_modify_ipv6gateway(self): + cmd = """python ../../main.py cps modify-ipv6gateway --ipv6gateway-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -419,8 +437,8 @@ def test_describe_regiones(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_cpslbregions(self): - cmd = """python ../../main.py cps describe-cpslbregions """ + def test_describe_basic_subnet(self): + cmd = """python ../../main.py cps describe-basic-subnet --az 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -428,8 +446,8 @@ def test_describe_cpslbregions(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_route_table(self): - cmd = """python ../../main.py cps describe-route-table --route-table-id 'xxx'""" + def test_describe_subnets(self): + cmd = """python ../../main.py cps describe-subnets """ with os.popen(cmd) as f: content = f.read() @@ -437,8 +455,8 @@ def test_describe_route_table(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_route_tables(self): - cmd = """python ../../main.py cps describe-route-tables """ + def test_create_subnet(self): + cmd = """python ../../main.py cps create-subnet --subnet-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -446,8 +464,8 @@ def test_describe_route_tables(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_servers(self): - cmd = """python ../../main.py cps describe-servers --server-group-id 'xxx'""" + def test_assign_ipv6cidr(self): + cmd = """python ../../main.py cps assign-ipv6cidr --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -455,8 +473,8 @@ def test_describe_servers(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_servers(self): - cmd = """python ../../main.py cps add-servers --server-group-id 'xxx' --server-spec '[{"":""}]'""" + def test_describe_subnet(self): + cmd = """python ../../main.py cps describe-subnet --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -464,8 +482,8 @@ def test_add_servers(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_server(self): - cmd = """python ../../main.py cps modify-server --server-group-id 'xxx' --server-id 'xxx'""" + def test_modify_subnet(self): + cmd = """python ../../main.py cps modify-subnet --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -473,8 +491,8 @@ def test_modify_server(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_remove_server(self): - cmd = """python ../../main.py cps remove-server --server-group-id 'xxx' --server-id 'xxx'""" + def test_delete_subnet(self): + cmd = """python ../../main.py cps delete-subnet --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -482,8 +500,8 @@ def test_remove_server(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_server_groups(self): - cmd = """python ../../main.py cps describe-server-groups """ + def test_describe_vpc(self): + cmd = """python ../../main.py cps describe-vpc --vpc-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -491,8 +509,8 @@ def test_describe_server_groups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_server_group(self): - cmd = """python ../../main.py cps create-server-group --server-group-spec '{"":""}'""" + def test_modify_vpc(self): + cmd = """python ../../main.py cps modify-vpc --vpc-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -500,8 +518,8 @@ def test_create_server_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_server_group(self): - cmd = """python ../../main.py cps describe-server-group --server-group-id 'xxx'""" + def test_delete_vpc(self): + cmd = """python ../../main.py cps delete-vpc --vpc-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -509,8 +527,8 @@ def test_describe_server_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_server_group(self): - cmd = """python ../../main.py cps modify-server-group --server-group-id 'xxx'""" + def test_describe_vpcs(self): + cmd = """python ../../main.py cps describe-vpcs """ with os.popen(cmd) as f: content = f.read() @@ -518,8 +536,8 @@ def test_modify_server_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_server_group(self): - cmd = """python ../../main.py cps delete-server-group --server-group-id 'xxx'""" + def test_create_vpc(self): + cmd = """python ../../main.py cps create-vpc --vpc-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -527,8 +545,8 @@ def test_delete_server_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_basic_subnet(self): - cmd = """python ../../main.py cps describe-basic-subnet --az 'xxx'""" + def test_assign_ipv6gateway(self): + cmd = """python ../../main.py cps assign-ipv6gateway --vpc-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -536,8 +554,8 @@ def test_describe_basic_subnet(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_subnets(self): - cmd = """python ../../main.py cps describe-subnets """ + def test_describe_listeners(self): + cmd = """python ../../main.py cps describe-listeners """ with os.popen(cmd) as f: content = f.read() @@ -545,8 +563,8 @@ def test_describe_subnets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_subnet(self): - cmd = """python ../../main.py cps create-subnet --subnet-spec '{"":""}'""" + def test_create_listener(self): + cmd = """python ../../main.py cps create-listener --listener-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -554,8 +572,8 @@ def test_create_subnet(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_subnet(self): - cmd = """python ../../main.py cps describe-subnet --subnet-id 'xxx'""" + def test_modify_listener(self): + cmd = """python ../../main.py cps modify-listener --listener-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -563,8 +581,8 @@ def test_describe_subnet(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_subnet(self): - cmd = """python ../../main.py cps modify-subnet --subnet-id 'xxx'""" + def test_describe_listener(self): + cmd = """python ../../main.py cps describe-listener --listener-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -572,8 +590,8 @@ def test_modify_subnet(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_subnet(self): - cmd = """python ../../main.py cps delete-subnet --subnet-id 'xxx'""" + def test_delete_listener(self): + cmd = """python ../../main.py cps delete-listener --listener-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -581,8 +599,8 @@ def test_delete_subnet(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_vpc(self): - cmd = """python ../../main.py cps describe-vpc --vpc-id 'xxx'""" + def test_start_listener(self): + cmd = """python ../../main.py cps start-listener --listener-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -590,8 +608,8 @@ def test_describe_vpc(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_vpc(self): - cmd = """python ../../main.py cps modify-vpc --vpc-id 'xxx'""" + def test_stop_listener(self): + cmd = """python ../../main.py cps stop-listener --listener-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -599,8 +617,8 @@ def test_modify_vpc(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vpc(self): - cmd = """python ../../main.py cps delete-vpc --vpc-id 'xxx'""" + def test_describe_device_types(self): + cmd = """python ../../main.py cps describe-device-types """ with os.popen(cmd) as f: content = f.read() @@ -608,8 +626,8 @@ def test_delete_vpc(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_vpcs(self): - cmd = """python ../../main.py cps describe-vpcs """ + def test_describe_os(self): + cmd = """python ../../main.py cps describe-os --device-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -617,8 +635,242 @@ def test_describe_vpcs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_vpc(self): - cmd = """python ../../main.py cps create-vpc --vpc-spec '{"":""}'""" + def test_describe_device_raids(self): + cmd = """python ../../main.py cps describe-device-raids --device-type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_instance(self): + cmd = """python ../../main.py cps describe-instance --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_instances(self): + cmd = """python ../../main.py cps describe-instances """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_instances(self): + cmd = """python ../../main.py cps create-instances --instance-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_instance_name(self): + cmd = """python ../../main.py cps describe-instance-name --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_assign_ipv6address(self): + cmd = """python ../../main.py cps assign-ipv6address --instance-id 'xxx' --subnet-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_instance(self): + cmd = """python ../../main.py cps modify-instance --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_instance_raid(self): + cmd = """python ../../main.py cps describe-instance-raid --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_instance_status(self): + cmd = """python ../../main.py cps describe-instance-status --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_restart_instance(self): + cmd = """python ../../main.py cps restart-instance --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_stop_instance(self): + cmd = """python ../../main.py cps stop-instance --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_start_instance(self): + cmd = """python ../../main.py cps start-instance --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_restart_instances(self): + cmd = """python ../../main.py cps restart-instances """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_stop_instances(self): + cmd = """python ../../main.py cps stop-instances """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_start_instances(self): + cmd = """python ../../main.py cps start-instances """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_reinstall_instance(self): + cmd = """python ../../main.py cps reinstall-instance --instance-id 'xxx' --instance-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_bandwidth(self): + cmd = """python ../../main.py cps modify-bandwidth --instance-id 'xxx' --bandwidth '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_associate_elastic_ip(self): + cmd = """python ../../main.py cps associate-elastic-ip --instance-id 'xxx' --elastic-ip-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_disassociate_elastic_ip(self): + cmd = """python ../../main.py cps disassociate-elastic-ip --instance-id 'xxx' --elastic-ip-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_reset_password(self): + cmd = """python ../../main.py cps reset-password --instance-id 'xxx' --password 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_available_private_ip(self): + cmd = """python ../../main.py cps describe-available-private-ip --instance-id 'xxx' --subnet-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_instance_monitor_info(self): + cmd = """python ../../main.py cps describe-instance-monitor-info --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_event_logs(self): + cmd = """python ../../main.py cps describe-event-logs --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_route_table(self): + cmd = """python ../../main.py cps describe-route-table --route-table-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_route_tables(self): + cmd = """python ../../main.py cps describe-route-tables """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_regiones(self): + cmd = """python ../../main.py cps describe-regiones """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_cpslbregions(self): + cmd = """python ../../main.py cps describe-cpslbregions """ with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/cr_test.py b/testcases/generated/cr_test.py deleted file mode 100644 index 5daa937..0000000 --- a/testcases/generated/cr_test.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding=utf8 - -# Copyright 2018 JDCLOUD.COM -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# NOTE: This class is auto generated by the jdcloud code generator program. - -import unittest -import os -import json - - -class CrTest(unittest.TestCase): - - def test_get_authorization_token(self): - cmd = """python ../../main.py cr get-authorization-token --registry-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_describe_authorization_tokens(self): - cmd = """python ../../main.py cr describe-authorization-tokens --registry-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_release_authorization_token(self): - cmd = """python ../../main.py cr release-authorization-token --registry-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_describe_images(self): - cmd = """python ../../main.py cr describe-images """ - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_delete_image(self): - cmd = """python ../../main.py cr delete-image --registry-name 'xxx' --repository-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_describe_quotas(self): - cmd = """python ../../main.py cr describe-quotas """ - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_describe_registries(self): - cmd = """python ../../main.py cr describe-registries """ - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_create_registry(self): - cmd = """python ../../main.py cr create-registry --registry-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_describe_registry(self): - cmd = """python ../../main.py cr describe-registry --registry-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_delete_registry(self): - cmd = """python ../../main.py cr delete-registry --registry-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_check_registry_name(self): - cmd = """python ../../main.py cr check-registry-name --registry-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_create_repository(self): - cmd = """python ../../main.py cr create-repository --registry-name 'xxx' --repository-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_describe_repositories(self): - cmd = """python ../../main.py cr describe-repositories """ - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_delete_repository(self): - cmd = """python ../../main.py cr delete-repository --registry-name 'xxx' --repository-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_check_repository_name(self): - cmd = """python ../../main.py cr check-repository-name --registry-name 'xxx' --repository-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - diff --git a/testcases/generated/deploy_test.py b/testcases/generated/deploy_test.py index 8b7bd69..a870f70 100644 --- a/testcases/generated/deploy_test.py +++ b/testcases/generated/deploy_test.py @@ -41,8 +41,8 @@ def test_describe_app(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_deploy(self): - cmd = """python ../../main.py deploy create-deploy --group-id 'xxx' --deploy-source '5'""" + def test_describe_groups(self): + cmd = """python ../../main.py deploy describe-groups """ with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_create_deploy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_deploy(self): - cmd = """python ../../main.py deploy describe-deploy --deploy-id 'xxx'""" + def test_describe_group(self): + cmd = """python ../../main.py deploy describe-group --group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_describe_deploy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_groups(self): - cmd = """python ../../main.py deploy describe-groups """ + def test_create_deploy(self): + cmd = """python ../../main.py deploy create-deploy --group-id 'xxx' --deploy-source '5'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_describe_groups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_group(self): - cmd = """python ../../main.py deploy describe-group --group-id 'xxx'""" + def test_describe_deploy(self): + cmd = """python ../../main.py deploy describe-deploy --deploy-id 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/detection_test.py b/testcases/generated/detection_test.py index bb5a426..af9b92f 100644 --- a/testcases/generated/detection_test.py +++ b/testcases/generated/detection_test.py @@ -23,8 +23,8 @@ class DetectionTest(unittest.TestCase): - def test_describe_agent_status(self): - cmd = """python ../../main.py detection describe-agent-status --filters '[{"":""}]'""" + def test_get_site_monitor(self): + cmd = """python ../../main.py detection get-site-monitor """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_agent_status(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_metric_data_am(self): - cmd = """python ../../main.py detection describe-metric-data-am --resource-id 'xxx'""" + def test_create_site_monitor(self): + cmd = """python ../../main.py detection create-site-monitor --address 'xxx' --cycle '5' --name 'xxx' --source '[{"":""}]' --task-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_describe_metric_data_am(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_probe_task(self): - cmd = """python ../../main.py detection create-probe-task --client-token 'xxx' --create-probe-task-spec '{"":""}'""" + def test_update_site_monitor(self): + cmd = """python ../../main.py detection update-site-monitor --address 'xxx' --cycle '5' --name 'xxx' --source '[{"":""}]' --task-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_create_probe_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_probe_task(self): - cmd = """python ../../main.py detection delete-probe-task --probe-task-ids 'xxx'""" + def test_delete_site_monitor(self): + cmd = """python ../../main.py detection delete-site-monitor """ with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_delete_probe_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_probe_task(self): - cmd = """python ../../main.py detection describe-probe-task --probe-task-id 'xxx'""" + def test_enable_site_monitor(self): + cmd = """python ../../main.py detection enable-site-monitor """ with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_describe_probe_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_probe_task(self): - cmd = """python ../../main.py detection update-probe-task --probe-task-id 'xxx' --probes '[{"":""}]'""" + def test_validate_site_monitor_address(self): + cmd = """python ../../main.py detection validate-site-monitor-address """ with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_update_probe_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_probe_history(self): - cmd = """python ../../main.py detection describe-probe-history --probe-task-id 'xxx' --probe-id 'xxx'""" + def test_get_site_monitor_data_points(self): + cmd = """python ../../main.py detection get-site-monitor-data-points """ with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_describe_probe_history(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_discribe_probes(self): - cmd = """python ../../main.py detection discribe-probes --probe-task-id 'xxx'""" + def test_get_site_monitor_source(self): + cmd = """python ../../main.py detection get-site-monitor-source """ with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_discribe_probes(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_probe_task_enable(self): - cmd = """python ../../main.py detection probe-task-enable """ + def test_test_site_monitor(self): + cmd = """python ../../main.py detection test-site-monitor --address 'xxx' --cycle '5' --name 'xxx' --source '[{"":""}]' --task-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_probe_task_enable(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_probe_tasks(self): - cmd = """python ../../main.py detection describe-probe-tasks """ + def test_describe_agent_status(self): + cmd = """python ../../main.py detection describe-agent-status --filters '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_describe_probe_tasks(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_site_monitor(self): - cmd = """python ../../main.py detection get-site-monitor """ + def test_describe_metric_data_am(self): + cmd = """python ../../main.py detection describe-metric-data-am --resource-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_get_site_monitor(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_site_monitor(self): - cmd = """python ../../main.py detection create-site-monitor --address 'xxx' --cycle '5' --name 'xxx' --source '[{"":""}]' --task-type 'xxx'""" + def test_create_probe_task(self): + cmd = """python ../../main.py detection create-probe-task --client-token 'xxx' --create-probe-task-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_create_site_monitor(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_site_monitor(self): - cmd = """python ../../main.py detection update-site-monitor --address 'xxx' --cycle '5' --name 'xxx' --source '[{"":""}]' --task-type 'xxx'""" + def test_delete_probe_task(self): + cmd = """python ../../main.py detection delete-probe-task --probe-task-ids 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_update_site_monitor(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_site_monitor(self): - cmd = """python ../../main.py detection delete-site-monitor """ + def test_describe_probe_task(self): + cmd = """python ../../main.py detection describe-probe-task --probe-task-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_delete_site_monitor(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_enable_site_monitor(self): - cmd = """python ../../main.py detection enable-site-monitor """ + def test_update_probe_task(self): + cmd = """python ../../main.py detection update-probe-task --probe-task-id 'xxx' --probes '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_enable_site_monitor(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_validate_site_monitor_address(self): - cmd = """python ../../main.py detection validate-site-monitor-address """ + def test_describe_probe_history(self): + cmd = """python ../../main.py detection describe-probe-history --probe-task-id 'xxx' --probe-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_validate_site_monitor_address(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_site_monitor_data_points(self): - cmd = """python ../../main.py detection get-site-monitor-data-points """ + def test_discribe_probes(self): + cmd = """python ../../main.py detection discribe-probes --probe-task-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_get_site_monitor_data_points(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_site_monitor_source(self): - cmd = """python ../../main.py detection get-site-monitor-source """ + def test_probe_task_enable(self): + cmd = """python ../../main.py detection probe-task-enable """ with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_get_site_monitor_source(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_test_site_monitor(self): - cmd = """python ../../main.py detection test-site-monitor --address 'xxx' --cycle '5' --name 'xxx' --source '[{"":""}]' --task-type 'xxx'""" + def test_describe_probe_tasks(self): + cmd = """python ../../main.py detection describe-probe-tasks """ with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/disk_test.py b/testcases/generated/disk_test.py index a3057d3..c63ede2 100644 --- a/testcases/generated/disk_test.py +++ b/testcases/generated/disk_test.py @@ -86,6 +86,24 @@ def test_extend_disk(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_volumes_ignore_service_code(self): + cmd = """python ../../main.py disk describe-volumes-ignore-service-code """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_quota(self): + cmd = """python ../../main.py disk describe-quota --type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_snapshots(self): cmd = """python ../../main.py disk describe-snapshots """ with os.popen(cmd) as f: @@ -140,3 +158,93 @@ def test_delete_snapshot(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_snapshots_capacity(self): + cmd = """python ../../main.py disk describe-snapshots-capacity """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_snapshot_chain(self): + cmd = """python ../../main.py disk describe-snapshot-chain """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_soldout(self): + cmd = """python ../../main.py disk describe-soldout """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_snapshot_policy(self): + cmd = """python ../../main.py disk create-snapshot-policy --name 'xxx' --interval '5' --effective-time 'xxx' --snapshot-lifecycle '5' --status '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_snapshot_policy(self): + cmd = """python ../../main.py disk update-snapshot-policy --policy-id 'xxx' --name 'xxx' --interval '5' --effective-time 'xxx' --snapshot-lifecycle '5' --status '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_snapshot_policy(self): + cmd = """python ../../main.py disk delete-snapshot-policy --policy-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_snapshot_policies(self): + cmd = """python ../../main.py disk describe-snapshot-policies """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_snap_polices(self): + cmd = """python ../../main.py disk describe-snap-polices """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_apply_snapshot_policies(self): + cmd = """python ../../main.py disk apply-snapshot-policies """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_snapshot_policy_disk_relations(self): + cmd = """python ../../main.py disk describe-snapshot-policy-disk-relations """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + diff --git a/testcases/generated/domainservice_test.py b/testcases/generated/domainservice_test.py index 0603897..edca704 100644 --- a/testcases/generated/domainservice_test.py +++ b/testcases/generated/domainservice_test.py @@ -23,8 +23,8 @@ class DomainserviceTest(unittest.TestCase): - def test_describe_action_log(self): - cmd = """python ../../main.py domainservice describe-action-log --page-number '5' --page-size '5' --start-time 'xxx' --end-time 'xxx'""" + def test_describe_resource_record(self): + cmd = """python ../../main.py domainservice describe-resource-record --domain-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_action_log(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_domains(self): - cmd = """python ../../main.py domainservice describe-domains --page-number '5' --page-size '5'""" + def test_create_resource_record(self): + cmd = """python ../../main.py domainservice create-resource-record --domain-id 'xxx' --req '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_describe_domains(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_domain(self): - cmd = """python ../../main.py domainservice create-domain --pack-id '5' --domain-name 'xxx'""" + def test_modify_resource_record(self): + cmd = """python ../../main.py domainservice modify-resource-record --domain-id 'xxx' --resource-record-id 'xxx' --req '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_create_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_domain(self): - cmd = """python ../../main.py domainservice modify-domain --domain-id 'xxx' --domain-name 'xxx'""" + def test_delete_resource_record(self): + cmd = """python ../../main.py domainservice delete-resource-record --domain-id 'xxx' --resource-record-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_modify_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_domain(self): - cmd = """python ../../main.py domainservice delete-domain --domain-id 'xxx'""" + def test_modify_resource_record_status(self): + cmd = """python ../../main.py domainservice modify-resource-record-status --domain-id 'xxx' --resource-record-id 'xxx' --action 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_delete_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_domain_query_count(self): - cmd = """python ../../main.py domainservice describe-domain-query-count --domain-id 'xxx' --domain-name 'xxx' --start 'xxx' --end 'xxx'""" + def test_describe_view_tree(self): + cmd = """python ../../main.py domainservice describe-view-tree --domain-id 'xxx' --pack-id '5' --view-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_describe_domain_query_count(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_domain_query_traffic(self): - cmd = """python ../../main.py domainservice describe-domain-query-traffic --domain-id 'xxx' --domain-name 'xxx' --start 'xxx' --end 'xxx'""" + def test_batch_set_resource_records(self): + cmd = """python ../../main.py domainservice batch-set-resource-records --domain-id 'xxx' --req '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_describe_domain_query_traffic(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_resource_record(self): - cmd = """python ../../main.py domainservice describe-resource-record --domain-id 'xxx'""" + def test_describe_domains(self): + cmd = """python ../../main.py domainservice describe-domains --page-number '5' --page-size '5'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_describe_resource_record(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_resource_record(self): - cmd = """python ../../main.py domainservice create-resource-record --domain-id 'xxx' --req '{"":""}'""" + def test_create_domain(self): + cmd = """python ../../main.py domainservice create-domain --pack-id '5' --domain-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_create_resource_record(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_resource_record(self): - cmd = """python ../../main.py domainservice modify-resource-record --domain-id 'xxx' --resource-record-id 'xxx' --req '{"":""}'""" + def test_modify_domain(self): + cmd = """python ../../main.py domainservice modify-domain --domain-id 'xxx' --domain-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_modify_resource_record(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_resource_record(self): - cmd = """python ../../main.py domainservice delete-resource-record --domain-id 'xxx' --resource-record-id 'xxx'""" + def test_delete_domain(self): + cmd = """python ../../main.py domainservice delete-domain --domain-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_delete_resource_record(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_resource_record_status(self): - cmd = """python ../../main.py domainservice modify-resource-record-status --domain-id 'xxx' --resource-record-id 'xxx' --action 'xxx'""" + def test_describe_domain_query_count(self): + cmd = """python ../../main.py domainservice describe-domain-query-count --domain-id 'xxx' --domain-name 'xxx' --start 'xxx' --end 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_modify_resource_record_status(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_view_tree(self): - cmd = """python ../../main.py domainservice describe-view-tree --domain-id 'xxx' --pack-id '5' --view-id '5'""" + def test_describe_domain_query_traffic(self): + cmd = """python ../../main.py domainservice describe-domain-query-traffic --domain-id 'xxx' --domain-name 'xxx' --start 'xxx' --end 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_describe_view_tree(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_batch_set_resource_records(self): - cmd = """python ../../main.py domainservice batch-set-resource-records --domain-id 'xxx' --req '[{"":""}]'""" + def test_describe_action_log(self): + cmd = """python ../../main.py domainservice describe-action-log --page-number '5' --page-size '5' --start-time 'xxx' --end-time 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/elite_test.py b/testcases/generated/elite_test.py index 82631ad..c5af0e2 100644 --- a/testcases/generated/elite_test.py +++ b/testcases/generated/elite_test.py @@ -32,8 +32,8 @@ def test_jdx_query_delivery_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_jdx_report_order(self): - cmd = """python ../../main.py elite jdx-report-order --report-order-info '{"":""}'""" + def test_get_store_service(self): + cmd = """python ../../main.py elite get-store-service --buyer-pin 'xxx' --business-data 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_jdx_report_order(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_jdx_create_order(self): - cmd = """python ../../main.py elite jdx-create-order --create-order-info '{"":""}'""" + def test_jdx_query_product(self): + cmd = """python ../../main.py elite jdx-query-product --page-no '5' --page-size '5'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_jdx_create_order(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_jdx_query_price(self): - cmd = """python ../../main.py elite jdx-query-price --query-price-param '{"":""}'""" + def test_list_sale_service(self): + cmd = """python ../../main.py elite list-sale-service --page-no '5' --page-size '5'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_jdx_query_price(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_jdx_query_product(self): - cmd = """python ../../main.py elite jdx-query-product --page-no '5' --page-size '5'""" + def test_get_sale_service_by_deliver_number(self): + cmd = """python ../../main.py elite get-sale-service-by-deliver-number --deliver-number 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_jdx_query_product(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_sale_service(self): - cmd = """python ../../main.py elite list-sale-service --page-no '5' --page-size '5'""" + def test_confirm_sale_service_delivery(self): + cmd = """python ../../main.py elite confirm-sale-service-delivery --confirm-delivery-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_list_sale_service(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_sale_service_by_deliver_number(self): - cmd = """python ../../main.py elite get-sale-service-by-deliver-number --deliver-number 'xxx'""" + def test_jdx_report_order(self): + cmd = """python ../../main.py elite jdx-report-order --report-order-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_get_sale_service_by_deliver_number(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_confirm_sale_service_delivery(self): - cmd = """python ../../main.py elite confirm-sale-service-delivery --confirm-delivery-info '{"":""}'""" + def test_jdx_create_order(self): + cmd = """python ../../main.py elite jdx-create-order --create-order-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_confirm_sale_service_delivery(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_store_service(self): - cmd = """python ../../main.py elite get-store-service --buyer-pin 'xxx' --business-data 'xxx'""" + def test_jdx_query_price(self): + cmd = """python ../../main.py elite jdx-query-price --query-price-param '{"":""}'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/function_test.py b/testcases/generated/function_test.py index 7e90c47..272d4eb 100644 --- a/testcases/generated/function_test.py +++ b/testcases/generated/function_test.py @@ -23,8 +23,8 @@ class FunctionTest(unittest.TestCase): - def test_list_alias(self): - cmd = """python ../../main.py function list-alias --function-name 'xxx'""" + def test_list_function(self): + cmd = """python ../../main.py function list-function --list-all 'true'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_list_alias(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_alias(self): - cmd = """python ../../main.py function create-alias --function-name 'xxx' --alias-name 'xxx'""" + def test_create_function(self): + cmd = """python ../../main.py function create-function """ with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_create_alias(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_alias(self): - cmd = """python ../../main.py function get-alias --function-name 'xxx' --alias-name 'xxx'""" + def test_get_function(self): + cmd = """python ../../main.py function get-function --function-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_get_alias(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_alias(self): - cmd = """python ../../main.py function update-alias --function-name 'xxx' --alias-name 'xxx' --description 'xxx' --version 'xxx'""" + def test_update_function(self): + cmd = """python ../../main.py function update-function --function-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_update_alias(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_alias(self): - cmd = """python ../../main.py function delete-alias --function-name 'xxx' --alias-name 'xxx'""" + def test_delete_function(self): + cmd = """python ../../main.py function delete-function --function-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_delete_alias(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_function(self): - cmd = """python ../../main.py function list-function --list-all 'true'""" + def test_invoke(self): + cmd = """python ../../main.py function invoke --function-name 'xxx' --version-name 'xxx' --event 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_list_function(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_function(self): - cmd = """python ../../main.py function create-function """ + def test_async_invoke(self): + cmd = """python ../../main.py function async-invoke --function-name 'xxx' --version-name 'xxx' --event 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_create_function(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_function(self): - cmd = """python ../../main.py function get-function --function-name 'xxx'""" + def test_list_version(self): + cmd = """python ../../main.py function list-version --function-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_get_function(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_function(self): - cmd = """python ../../main.py function update-function --function-name 'xxx'""" + def test_create_version(self): + cmd = """python ../../main.py function create-version --function-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_update_function(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_function(self): - cmd = """python ../../main.py function delete-function --function-name 'xxx'""" + def test_get_version(self): + cmd = """python ../../main.py function get-version --function-name 'xxx' --version-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_delete_function(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_invoke(self): - cmd = """python ../../main.py function invoke --function-name 'xxx' --version-name 'xxx' --event 'xxx'""" + def test_delete_version(self): + cmd = """python ../../main.py function delete-version --function-name 'xxx' --version-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_invoke(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_async_invoke(self): - cmd = """python ../../main.py function async-invoke --function-name 'xxx' --version-name 'xxx' --event 'xxx'""" + def test_list_alias(self): + cmd = """python ../../main.py function list-alias --function-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_async_invoke(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_trigger(self): - cmd = """python ../../main.py function get-trigger --function-name 'xxx' --version-name 'xxx' --trigger-id 'xxx'""" + def test_create_alias(self): + cmd = """python ../../main.py function create-alias --function-name 'xxx' --alias-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_get_trigger(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_version(self): - cmd = """python ../../main.py function list-version --function-name 'xxx'""" + def test_get_alias(self): + cmd = """python ../../main.py function get-alias --function-name 'xxx' --alias-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_list_version(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_version(self): - cmd = """python ../../main.py function create-version --function-name 'xxx'""" + def test_update_alias(self): + cmd = """python ../../main.py function update-alias --function-name 'xxx' --alias-name 'xxx' --description 'xxx' --version 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_create_version(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_version(self): - cmd = """python ../../main.py function get-version --function-name 'xxx' --version-name 'xxx'""" + def test_delete_alias(self): + cmd = """python ../../main.py function delete-alias --function-name 'xxx' --alias-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_get_version(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_version(self): - cmd = """python ../../main.py function delete-version --function-name 'xxx' --version-name 'xxx'""" + def test_get_trigger(self): + cmd = """python ../../main.py function get-trigger --function-name 'xxx' --version-name 'xxx' --trigger-id 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/iam_test.py b/testcases/generated/iam_test.py index c2de7cc..ae330b9 100644 --- a/testcases/generated/iam_test.py +++ b/testcases/generated/iam_test.py @@ -23,8 +23,8 @@ class IamTest(unittest.TestCase): - def test_enable_sub_user_access_key(self): - cmd = """python ../../main.py iam enable-sub-user-access-key --sub-user 'xxx' --access-key 'xxx'""" + def test_create_sub_user(self): + cmd = """python ../../main.py iam create-sub-user --create-sub-user-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_enable_sub_user_access_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disable_sub_user_access_key(self): - cmd = """python ../../main.py iam disable-sub-user-access-key --sub-user 'xxx' --access-key 'xxx'""" + def test_describe_sub_user(self): + cmd = """python ../../main.py iam describe-sub-user --sub-user 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_disable_sub_user_access_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_sub_user_access_key(self): - cmd = """python ../../main.py iam delete-sub-user-access-key --sub-user 'xxx' --access-key 'xxx'""" + def test_update_sub_user(self): + cmd = """python ../../main.py iam update-sub-user --sub-user 'xxx' --update-sub-user-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_delete_sub_user_access_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_group(self): - cmd = """python ../../main.py iam create-group --create-group-info '{"":""}'""" + def test_delete_sub_user(self): + cmd = """python ../../main.py iam delete-sub-user --sub-user 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_create_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_group(self): - cmd = """python ../../main.py iam describe-group --group-name 'xxx'""" + def test_describe_sub_users(self): + cmd = """python ../../main.py iam describe-sub-users """ with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_describe_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_group(self): - cmd = """python ../../main.py iam update-group --group-name 'xxx' --update-group-info '{"":""}'""" + def test_describe_sub_user_groups(self): + cmd = """python ../../main.py iam describe-sub-user-groups --sub-user 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_update_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_group(self): - cmd = """python ../../main.py iam delete-group --group-name 'xxx'""" + def test_describe_attached_sub_user_policies(self): + cmd = """python ../../main.py iam describe-attached-sub-user-policies --sub-user 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_delete_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_group_sub_users(self): - cmd = """python ../../main.py iam describe-group-sub-users --group-name 'xxx'""" + def test_detach_sub_user_policy(self): + cmd = """python ../../main.py iam detach-sub-user-policy --sub-user 'xxx' --policy-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_describe_group_sub_users(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_groups(self): - cmd = """python ../../main.py iam describe-groups """ + def test_attach_sub_user_policy(self): + cmd = """python ../../main.py iam attach-sub-user-policy --sub-user 'xxx' --policy-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_describe_groups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_attached_group_policies(self): - cmd = """python ../../main.py iam describe-attached-group-policies --group-name 'xxx'""" + def test_create_permission(self): + cmd = """python ../../main.py iam create-permission --create-permission-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_describe_attached_group_policies(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_detach_group_policy(self): - cmd = """python ../../main.py iam detach-group-policy --group-name 'xxx' --policy-name 'xxx'""" + def test_describe_permission_detail(self): + cmd = """python ../../main.py iam describe-permission-detail --permission-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_detach_group_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_attach_group_policy(self): - cmd = """python ../../main.py iam attach-group-policy --group-name 'xxx' --policy-name 'xxx'""" + def test_update_permission(self): + cmd = """python ../../main.py iam update-permission --permission-id '5' --update-permission-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_attach_group_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_remove_sub_user_from_group(self): - cmd = """python ../../main.py iam remove-sub-user-from-group --group-name 'xxx' --sub-user 'xxx'""" + def test_describe_permissions(self): + cmd = """python ../../main.py iam describe-permissions --page-number '5' --page-size '5' --query-type '5'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_remove_sub_user_from_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_sub_user_to_group(self): - cmd = """python ../../main.py iam add-sub-user-to-group --group-name 'xxx' --sub-user 'xxx'""" + def test_describe_sub_user_permissions(self): + cmd = """python ../../main.py iam describe-sub-user-permissions --sub-user 'xxx' --page-number '5' --page-size '5'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_add_sub_user_to_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_permission(self): - cmd = """python ../../main.py iam create-permission --create-permission-info '{"":""}'""" + def test_add_permissions_to_sub_user(self): + cmd = """python ../../main.py iam add-permissions-to-sub-user --sub-user 'xxx' --add-permissions-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_create_permission(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_permission_detail(self): - cmd = """python ../../main.py iam describe-permission-detail --permission-id '5'""" + def test_remove_permission_of_sub_user(self): + cmd = """python ../../main.py iam remove-permission-of-sub-user --permission-id '5' --sub-user 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_describe_permission_detail(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_permission(self): - cmd = """python ../../main.py iam update-permission --permission-id '5' --update-permission-info '{"":""}'""" + def test_enable_sub_user_access_key(self): + cmd = """python ../../main.py iam enable-sub-user-access-key --sub-user 'xxx' --access-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_update_permission(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_permissions(self): - cmd = """python ../../main.py iam describe-permissions --page-number '5' --page-size '5' --query-type '5'""" + def test_disable_sub_user_access_key(self): + cmd = """python ../../main.py iam disable-sub-user-access-key --sub-user 'xxx' --access-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_describe_permissions(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_sub_user_permissions(self): - cmd = """python ../../main.py iam describe-sub-user-permissions --sub-user 'xxx' --page-number '5' --page-size '5'""" + def test_delete_sub_user_access_key(self): + cmd = """python ../../main.py iam delete-sub-user-access-key --sub-user 'xxx' --access-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +194,8 @@ def test_describe_sub_user_permissions(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_permissions_to_sub_user(self): - cmd = """python ../../main.py iam add-permissions-to-sub-user --sub-user 'xxx' --add-permissions-info '{"":""}'""" + def test_create_policy(self): + cmd = """python ../../main.py iam create-policy --create-policy-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +203,8 @@ def test_add_permissions_to_sub_user(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_remove_permission_of_sub_user(self): - cmd = """python ../../main.py iam remove-permission-of-sub-user --permission-id '5' --sub-user 'xxx'""" + def test_describe_policy(self): + cmd = """python ../../main.py iam describe-policy --policy-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -212,8 +212,8 @@ def test_remove_permission_of_sub_user(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_policy(self): - cmd = """python ../../main.py iam create-policy --create-policy-info '{"":""}'""" + def test_update_policy(self): + cmd = """python ../../main.py iam update-policy --policy-name 'xxx' --update-policy-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -221,8 +221,8 @@ def test_create_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_policy(self): - cmd = """python ../../main.py iam describe-policy --policy-name 'xxx'""" + def test_delete_policy(self): + cmd = """python ../../main.py iam delete-policy --policy-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -230,8 +230,8 @@ def test_describe_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_policy(self): - cmd = """python ../../main.py iam update-policy --policy-name 'xxx' --update-policy-info '{"":""}'""" + def test_update_policy_description(self): + cmd = """python ../../main.py iam update-policy-description --policy-name 'xxx' --update-policy-description-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -239,8 +239,8 @@ def test_update_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_policy(self): - cmd = """python ../../main.py iam delete-policy --policy-name 'xxx'""" + def test_describe_policies(self): + cmd = """python ../../main.py iam describe-policies """ with os.popen(cmd) as f: content = f.read() @@ -248,8 +248,8 @@ def test_delete_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_policy_description(self): - cmd = """python ../../main.py iam update-policy-description --policy-name 'xxx' --update-policy-description-info '{"":""}'""" + def test_create_group(self): + cmd = """python ../../main.py iam create-group --create-group-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -257,8 +257,8 @@ def test_update_policy_description(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_policies(self): - cmd = """python ../../main.py iam describe-policies """ + def test_describe_group(self): + cmd = """python ../../main.py iam describe-group --group-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -266,8 +266,8 @@ def test_describe_policies(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_role(self): - cmd = """python ../../main.py iam create-role --create-role-info '{"":""}'""" + def test_update_group(self): + cmd = """python ../../main.py iam update-group --group-name 'xxx' --update-group-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -275,8 +275,8 @@ def test_create_role(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_role(self): - cmd = """python ../../main.py iam describe-role --role-name 'xxx'""" + def test_delete_group(self): + cmd = """python ../../main.py iam delete-group --group-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -284,8 +284,8 @@ def test_describe_role(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_role(self): - cmd = """python ../../main.py iam delete-role --role-name 'xxx'""" + def test_describe_group_sub_users(self): + cmd = """python ../../main.py iam describe-group-sub-users --group-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -293,8 +293,8 @@ def test_delete_role(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_assume_role_policy(self): - cmd = """python ../../main.py iam update-assume-role-policy --role-name 'xxx' --update-assume-role-policy-info '{"":""}'""" + def test_describe_groups(self): + cmd = """python ../../main.py iam describe-groups """ with os.popen(cmd) as f: content = f.read() @@ -302,8 +302,8 @@ def test_update_assume_role_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_roles(self): - cmd = """python ../../main.py iam describe-roles """ + def test_describe_attached_group_policies(self): + cmd = """python ../../main.py iam describe-attached-group-policies --group-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -311,8 +311,8 @@ def test_describe_roles(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_attach_role_policy(self): - cmd = """python ../../main.py iam attach-role-policy --role-name 'xxx' --policy-name 'xxx'""" + def test_detach_group_policy(self): + cmd = """python ../../main.py iam detach-group-policy --group-name 'xxx' --policy-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -320,8 +320,8 @@ def test_attach_role_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_detach_role_policy(self): - cmd = """python ../../main.py iam detach-role-policy --role-name 'xxx' --policy-name 'xxx'""" + def test_attach_group_policy(self): + cmd = """python ../../main.py iam attach-group-policy --group-name 'xxx' --policy-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -329,8 +329,8 @@ def test_detach_role_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_role_policies(self): - cmd = """python ../../main.py iam describe-role-policies --role-name 'xxx' --sort '5'""" + def test_remove_sub_user_from_group(self): + cmd = """python ../../main.py iam remove-sub-user-from-group --group-name 'xxx' --sub-user 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -338,8 +338,8 @@ def test_describe_role_policies(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_sub_user(self): - cmd = """python ../../main.py iam create-sub-user --create-sub-user-info '{"":""}'""" + def test_add_sub_user_to_group(self): + cmd = """python ../../main.py iam add-sub-user-to-group --group-name 'xxx' --sub-user 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -347,8 +347,8 @@ def test_create_sub_user(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_sub_user(self): - cmd = """python ../../main.py iam describe-sub-user --sub-user 'xxx'""" + def test_create_role(self): + cmd = """python ../../main.py iam create-role --create-role-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -356,8 +356,8 @@ def test_describe_sub_user(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_sub_user(self): - cmd = """python ../../main.py iam update-sub-user --sub-user 'xxx' --update-sub-user-info '{"":""}'""" + def test_describe_role(self): + cmd = """python ../../main.py iam describe-role --role-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -365,8 +365,8 @@ def test_update_sub_user(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_sub_user(self): - cmd = """python ../../main.py iam delete-sub-user --sub-user 'xxx'""" + def test_delete_role(self): + cmd = """python ../../main.py iam delete-role --role-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -374,8 +374,8 @@ def test_delete_sub_user(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_sub_users(self): - cmd = """python ../../main.py iam describe-sub-users """ + def test_update_assume_role_policy(self): + cmd = """python ../../main.py iam update-assume-role-policy --role-name 'xxx' --update-assume-role-policy-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -383,8 +383,8 @@ def test_describe_sub_users(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_sub_user_groups(self): - cmd = """python ../../main.py iam describe-sub-user-groups --sub-user 'xxx'""" + def test_describe_roles(self): + cmd = """python ../../main.py iam describe-roles """ with os.popen(cmd) as f: content = f.read() @@ -392,8 +392,8 @@ def test_describe_sub_user_groups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_attached_sub_user_policies(self): - cmd = """python ../../main.py iam describe-attached-sub-user-policies --sub-user 'xxx'""" + def test_attach_role_policy(self): + cmd = """python ../../main.py iam attach-role-policy --role-name 'xxx' --policy-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -401,8 +401,8 @@ def test_describe_attached_sub_user_policies(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_detach_sub_user_policy(self): - cmd = """python ../../main.py iam detach-sub-user-policy --sub-user 'xxx' --policy-name 'xxx'""" + def test_detach_role_policy(self): + cmd = """python ../../main.py iam detach-role-policy --role-name 'xxx' --policy-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -410,8 +410,8 @@ def test_detach_sub_user_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_attach_sub_user_policy(self): - cmd = """python ../../main.py iam attach-sub-user-policy --sub-user 'xxx' --policy-name 'xxx'""" + def test_describe_role_policies(self): + cmd = """python ../../main.py iam describe-role-policies --role-name 'xxx' --sort '5'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/iotcore_test.py b/testcases/generated/iotcore_test.py index d917ec0..b94e4c9 100644 --- a/testcases/generated/iotcore_test.py +++ b/testcases/generated/iotcore_test.py @@ -23,8 +23,8 @@ class IotcoreTest(unittest.TestCase): - def test_device_query(self): - cmd = """python ../../main.py iotcore device-query --instance-id 'xxx' --device-id 'xxx'""" + def test_list_product_abilities(self): + cmd = """python ../../main.py iotcore list-product-abilities --instance-id 'xxx' --product-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_device_query(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_thing_type_list(self): - cmd = """python ../../main.py iotcore thing-type-list --instance-id 'xxx'""" + def test_import_thing_model(self): + cmd = """python ../../main.py iotcore import-thing-model --instance-id 'xxx' --product-key 'xxx' --thing-model '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_thing_type_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_thing_type_describe(self): - cmd = """python ../../main.py iotcore thing-type-describe --instance-id 'xxx'""" + def test_export_thing_model(self): + cmd = """python ../../main.py iotcore export-thing-model --instance-id 'xxx' --product-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_thing_type_describe(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_thing_model(self): - cmd = """python ../../main.py iotcore describe-thing-model --instance-id 'xxx' --thing-model-id 'xxx'""" + def test_invoke_thing_topic(self): + cmd = """python ../../main.py iotcore invoke-thing-topic --instance-id 'xxx' --identifier 'xxx' --product-key 'xxx' --topic-short-name 'xxx' --topic-message 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_describe_thing_model(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_device_register(self): - cmd = """python ../../main.py iotcore device-register --instance-id 'xxx' --device-info-vo '{"":""}'""" + def test_describe_thing_shadow(self): + cmd = """python ../../main.py iotcore describe-thing-shadow --instance-id 'xxx' --identifier 'xxx' --product-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_device_register(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_download_certificate(self): - cmd = """python ../../main.py iotcore download-certificate --instance-id 'xxx' --device-id 'xxx'""" + def test_update_thing_shadow(self): + cmd = """python ../../main.py iotcore update-thing-shadow --instance-id 'xxx' --identifier 'xxx' --product-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_download_certificate(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_device(self): - cmd = """python ../../main.py iotcore delete-device --instance-id 'xxx' --device-id 'xxx'""" + def test_invoke_thing_service(self): + cmd = """python ../../main.py iotcore invoke-thing-service --instance-id 'xxx' --identifier 'xxx' --product-key 'xxx' --name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_delete_device(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_device_property_set(self): - cmd = """python ../../main.py iotcore device-property-set --instance-id 'xxx' --device-property-vo '{"":""}'""" + def test_add_device_links(self): + cmd = """python ../../main.py iotcore add-device-links --instance-id 'xxx' --parent-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_device_property_set(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_invoke_function(self): - cmd = """python ../../main.py iotcore invoke-function --instance-id 'xxx' --device-function-vo '{"":""}'""" + def test_query_device_page(self): + cmd = """python ../../main.py iotcore query-device-page --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_invoke_function(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_event_list(self): - cmd = """python ../../main.py iotcore event-list --instance-id 'xxx' --event-report-page-bo '{"":""}'""" + def test_update_device(self): + cmd = """python ../../main.py iotcore update-device --instance-id 'xxx' --device-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_event_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_function_list(self): - cmd = """python ../../main.py iotcore function-list --instance-id 'xxx' --function-call-page-bo '{"":""}'""" + def test_add_device(self): + cmd = """python ../../main.py iotcore add-device --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_function_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_invoke_thing_topic(self): - cmd = """python ../../main.py iotcore invoke-thing-topic --instance-id 'xxx' --identifier 'xxx' --product-key 'xxx' --topic-short-name 'xxx' --topic-message 'xxx'""" + def test_query_device_detail(self): + cmd = """python ../../main.py iotcore query-device-detail --device-name 'xxx' --instance-id 'xxx' --product-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_invoke_thing_topic(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_thing_shadow(self): - cmd = """python ../../main.py iotcore describe-thing-shadow --instance-id 'xxx' --identifier 'xxx' --product-key 'xxx'""" + def test_remove_device(self): + cmd = """python ../../main.py iotcore remove-device --device-name 'xxx' --instance-id 'xxx' --product-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_describe_thing_shadow(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_thing_shadow(self): - cmd = """python ../../main.py iotcore update-thing-shadow --instance-id 'xxx' --identifier 'xxx' --product-key 'xxx'""" + def test_list_products(self): + cmd = """python ../../main.py iotcore list-products --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_update_thing_shadow(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_invoke_thing_service(self): - cmd = """python ../../main.py iotcore invoke-thing-service --instance-id 'xxx' --identifier 'xxx' --product-key 'xxx' --name 'xxx'""" + def test_create_product(self): + cmd = """python ../../main.py iotcore create-product --instance-id 'xxx' --product-name 'xxx' --product-type '5'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_invoke_thing_service(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_device_links(self): - cmd = """python ../../main.py iotcore add-device-links --instance-id 'xxx' --parent-id 'xxx'""" + def test_describe_product(self): + cmd = """python ../../main.py iotcore describe-product --instance-id 'xxx' --product-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_add_device_links(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_device_page(self): - cmd = """python ../../main.py iotcore query-device-page --instance-id 'xxx'""" + def test_update_product(self): + cmd = """python ../../main.py iotcore update-product --instance-id 'xxx' --product-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_query_device_page(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_device(self): - cmd = """python ../../main.py iotcore update-device --instance-id 'xxx' --device-id 'xxx'""" + def test_delete_product(self): + cmd = """python ../../main.py iotcore delete-product --instance-id 'xxx' --product-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_update_device(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_device(self): - cmd = """python ../../main.py iotcore add-device --instance-id 'xxx'""" + def test_update_loo_device(self): + cmd = """python ../../main.py iotcore update-loo-device --instance-id 'xxx' --device-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +194,8 @@ def test_add_device(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_device_detail(self): - cmd = """python ../../main.py iotcore query-device-detail --device-name 'xxx' --instance-id 'xxx' --product-key 'xxx'""" + def test_add_loo_device(self): + cmd = """python ../../main.py iotcore add-loo-device --instance-id 'xxx' --pre-order-id 'xxx' --user-pin-param 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +203,8 @@ def test_query_device_detail(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_remove_device(self): - cmd = """python ../../main.py iotcore remove-device --device-name 'xxx' --instance-id 'xxx' --product-key 'xxx'""" + def test_loongray_query_page(self): + cmd = """python ../../main.py iotcore loongray-query-page --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -212,8 +212,8 @@ def test_remove_device(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_elevator_operating_status(self): - cmd = """python ../../main.py iotcore elevator-operating-status --instance-id 'xxx'""" + def test_query_admin_statistics(self): + cmd = """python ../../main.py iotcore query-admin-statistics --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -221,8 +221,8 @@ def test_elevator_operating_status(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_collector_read_message(self): - cmd = """python ../../main.py iotcore collector-read-message --instance-id 'xxx' --identifier 'xxx' --protocol 'xxx'""" + def test_remove_loongray_device(self): + cmd = """python ../../main.py iotcore remove-loongray-device --device-name 'xxx' --instance-id 'xxx' --product-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -230,8 +230,8 @@ def test_collector_read_message(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_read_holding_registers(self): - cmd = """python ../../main.py iotcore read-holding-registers --instance-id 'xxx' --identifier 'xxx' --address-of-first-register '5' --number-of-registers '5'""" + def test_register_device(self): + cmd = """python ../../main.py iotcore register-device --instance-id 'xxx' --device-info-vo '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -239,8 +239,8 @@ def test_read_holding_registers(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_collector_write_message(self): - cmd = """python ../../main.py iotcore collector-write-message --instance-id 'xxx' --identifier 'xxx' --data '{"":""}'""" + def test_download_device_certificate(self): + cmd = """python ../../main.py iotcore download-device-certificate --instance-id 'xxx' --device-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -248,8 +248,8 @@ def test_collector_write_message(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_loo_device(self): - cmd = """python ../../main.py iotcore update-loo-device --instance-id 'xxx' --device-id 'xxx' --device-type 'xxx'""" + def test_delete_device(self): + cmd = """python ../../main.py iotcore delete-device --instance-id 'xxx' --device-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -257,8 +257,8 @@ def test_update_loo_device(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_loo_device(self): - cmd = """python ../../main.py iotcore add-loo-device --instance-id 'xxx' --pre-order-id 'xxx' --user-pin-param 'xxx' --device-type 'xxx'""" + def test_describe_device(self): + cmd = """python ../../main.py iotcore describe-device --instance-id 'xxx' --device-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -266,8 +266,8 @@ def test_add_loo_device(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_loongray_query_page(self): - cmd = """python ../../main.py iotcore loongray-query-page --instance-id 'xxx'""" + def test_describe_thing_type_list(self): + cmd = """python ../../main.py iotcore describe-thing-type-list --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -275,8 +275,8 @@ def test_loongray_query_page(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_remove_loongray_device(self): - cmd = """python ../../main.py iotcore remove-loongray-device --device-name 'xxx' --instance-id 'xxx' --product-key 'xxx'""" + def test_describe_thing_type(self): + cmd = """python ../../main.py iotcore describe-thing-type --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -284,8 +284,8 @@ def test_remove_loongray_device(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_product_with_admin(self): - cmd = """python ../../main.py iotcore describe-product-with-admin --instance-id 'xxx' --product-key 'xxx'""" + def test_describe_thing_model(self): + cmd = """python ../../main.py iotcore describe-thing-model --instance-id 'xxx' --thing-type-code 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -293,8 +293,8 @@ def test_describe_product_with_admin(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_product_with_admin(self): - cmd = """python ../../main.py iotcore update-product-with-admin --instance-id 'xxx' --product-key 'xxx'""" + def test_set_device_property(self): + cmd = """python ../../main.py iotcore set-device-property --instance-id 'xxx' --device-property-vo '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -302,8 +302,8 @@ def test_update_product_with_admin(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_product_with_admin(self): - cmd = """python ../../main.py iotcore delete-product-with-admin --instance-id 'xxx' --product-key 'xxx'""" + def test_invoke_function(self): + cmd = """python ../../main.py iotcore invoke-function --instance-id 'xxx' --device-function-vo '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -311,8 +311,8 @@ def test_delete_product_with_admin(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_products_with_admin(self): - cmd = """python ../../main.py iotcore list-products-with-admin --instance-id 'xxx'""" + def test_describe_event_list(self): + cmd = """python ../../main.py iotcore describe-event-list --instance-id 'xxx' --event-report-page-bo '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -320,8 +320,8 @@ def test_list_products_with_admin(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_admin_product(self): - cmd = """python ../../main.py iotcore create-admin-product --instance-id 'xxx' --product-name 'xxx' --product-type '5'""" + def test_describe_function_list(self): + cmd = """python ../../main.py iotcore describe-function-list --instance-id 'xxx' --function-call-page-bo '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -329,8 +329,8 @@ def test_create_admin_product(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_products(self): - cmd = """python ../../main.py iotcore list-products --instance-id 'xxx'""" + def test_describe_property(self): + cmd = """python ../../main.py iotcore describe-property --instance-id 'xxx' --device-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -338,8 +338,8 @@ def test_list_products(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_product(self): - cmd = """python ../../main.py iotcore create-product --instance-id 'xxx' --product-name 'xxx' --product-type '5'""" + def test_describe_property_snapshot(self): + cmd = """python ../../main.py iotcore describe-property-snapshot --instance-id 'xxx' --device-snapshot-request-vo '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -347,8 +347,8 @@ def test_create_product(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_product(self): - cmd = """python ../../main.py iotcore describe-product --instance-id 'xxx' --product-key 'xxx'""" + def test_create_device_topo(self): + cmd = """python ../../main.py iotcore create-device-topo --instance-id 'xxx' --device-topo-info-vo '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -356,8 +356,8 @@ def test_describe_product(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_product(self): - cmd = """python ../../main.py iotcore update-product --instance-id 'xxx' --product-key 'xxx'""" + def test_describe_device_topo(self): + cmd = """python ../../main.py iotcore describe-device-topo --instance-id 'xxx' --device-topo-page-bo '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -365,8 +365,8 @@ def test_update_product(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_product(self): - cmd = """python ../../main.py iotcore delete-product --instance-id 'xxx' --product-key 'xxx'""" + def test_update_device_topo(self): + cmd = """python ../../main.py iotcore update-device-topo --instance-id 'xxx' --device-topo-info-vo '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -374,8 +374,8 @@ def test_delete_product(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_product_abilities(self): - cmd = """python ../../main.py iotcore list-product-abilities --instance-id 'xxx' --product-key 'xxx'""" + def test_delete_device_topo(self): + cmd = """python ../../main.py iotcore delete-device-topo --instance-id 'xxx' --device-topo-info-vo '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -383,8 +383,8 @@ def test_list_product_abilities(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_import_thing_model(self): - cmd = """python ../../main.py iotcore import-thing-model --instance-id 'xxx' --product-key 'xxx' --thing-model '{"":""}'""" + def test_describe_product_with_admin(self): + cmd = """python ../../main.py iotcore describe-product-with-admin --instance-id 'xxx' --product-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -392,8 +392,35 @@ def test_import_thing_model(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_export_thing_model(self): - cmd = """python ../../main.py iotcore export-thing-model --instance-id 'xxx' --product-key 'xxx'""" + def test_update_product_with_admin(self): + cmd = """python ../../main.py iotcore update-product-with-admin --instance-id 'xxx' --product-key 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_product_with_admin(self): + cmd = """python ../../main.py iotcore delete-product-with-admin --instance-id 'xxx' --product-key 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_list_products_with_admin(self): + cmd = """python ../../main.py iotcore list-products-with-admin --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_admin_product(self): + cmd = """python ../../main.py iotcore create-admin-product --instance-id 'xxx' --product-name 'xxx' --product-type '5' --coll-device-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -428,3 +455,66 @@ def test_describe_product_topic(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_get_device_group(self): + cmd = """python ../../main.py iotcore get-device-group --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_get_device_group_list(self): + cmd = """python ../../main.py iotcore get-device-group-list --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_find_device_group_link_page(self): + cmd = """python ../../main.py iotcore find-device-group-link-page --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_elevator_operating_status(self): + cmd = """python ../../main.py iotcore elevator-operating-status --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_collector_read_message(self): + cmd = """python ../../main.py iotcore collector-read-message --instance-id 'xxx' --identifier 'xxx' --protocol 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_read_holding_registers(self): + cmd = """python ../../main.py iotcore read-holding-registers --instance-id 'xxx' --identifier 'xxx' --address-of-first-register '5' --number-of-registers '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_collector_write_message(self): + cmd = """python ../../main.py iotcore collector-write-message --instance-id 'xxx' --identifier 'xxx' --data '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + diff --git a/testcases/generated/iothub_test.py b/testcases/generated/iothub_test.py index 06ad7d6..b2ae993 100644 --- a/testcases/generated/iothub_test.py +++ b/testcases/generated/iothub_test.py @@ -23,6 +23,33 @@ class IothubTest(unittest.TestCase): + def test_list_product_abilities(self): + cmd = """python ../../main.py iothub list-product-abilities --product-key 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_import_thing_model(self): + cmd = """python ../../main.py iothub import-thing-model --product-key 'xxx' --thing-model '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_export_thing_model(self): + cmd = """python ../../main.py iothub export-thing-model --product-key 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_thing_shadow(self): cmd = """python ../../main.py iothub describe-thing-shadow --identifier 'xxx' --product-key 'xxx'""" with os.popen(cmd) as f: @@ -149,30 +176,3 @@ def test_delete_product(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_product_abilities(self): - cmd = """python ../../main.py iothub list-product-abilities --product-key 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_import_thing_model(self): - cmd = """python ../../main.py iothub import-thing-model --product-key 'xxx' --thing-model '{"":""}'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_export_thing_model(self): - cmd = """python ../../main.py iothub export-thing-model --product-key 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - diff --git a/testcases/generated/iotlink_test.py b/testcases/generated/iotlink_test.py index 9875d42..fa4c4cf 100644 --- a/testcases/generated/iotlink_test.py +++ b/testcases/generated/iotlink_test.py @@ -23,6 +23,60 @@ class IotlinkTest(unittest.TestCase): + def test_card_info(self): + cmd = """python ../../main.py iotlink card-info --iccid 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_real_name_query_iot(self): + cmd = """python ../../main.py iotlink real-name-query-iot --iccid 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_gprs_status_by_imsi(self): + cmd = """python ../../main.py iotlink gprs-status-by-imsi --imsi 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_on_off_status_by_imsi(self): + cmd = """python ../../main.py iotlink on-off-status-by-imsi --imsi 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_life_status_by_imsi(self): + cmd = """python ../../main.py iotlink life-status-by-imsi --imsi 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_gprs_realtime_info_by_imsi(self): + cmd = """python ../../main.py iotlink gprs-realtime-info-by-imsi --imsi 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_gprs_status(self): cmd = """python ../../main.py iotlink gprs-status --iccid 'xxx'""" with os.popen(cmd) as f: diff --git a/testcases/generated/ipanti_test.py b/testcases/generated/ipanti_test.py index b519eaf..b5b5dcb 100644 --- a/testcases/generated/ipanti_test.py +++ b/testcases/generated/ipanti_test.py @@ -23,8 +23,8 @@ class IpantiTest(unittest.TestCase): - def test_describe_ddo_sattack_logs(self): - cmd = """python ../../main.py ipanti describe-ddo-sattack-logs --start-time 'xxx'""" + def test_describe_forward_rules(self): + cmd = """python ../../main.py ipanti describe-forward-rules --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_ddo_sattack_logs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_ccattack_logs(self): - cmd = """python ../../main.py ipanti describe-ccattack-logs --start-time 'xxx'""" + def test_create_forward_rule(self): + cmd = """python ../../main.py ipanti create-forward-rule --instance-id 'xxx' --forward-rule-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_describe_ccattack_logs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_ccattack_log_details(self): - cmd = """python ../../main.py ipanti describe-ccattack-log-details """ + def test_create_forward_rules(self): + cmd = """python ../../main.py ipanti create-forward-rules --instance-id 'xxx' --forward-rule-spec-list '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_describe_ccattack_log_details(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_attack_statistics(self): - cmd = """python ../../main.py ipanti describe-attack-statistics --start-time 'xxx' --type '5'""" + def test_describe_forward_rule(self): + cmd = """python ../../main.py ipanti describe-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,134 @@ def test_describe_attack_statistics(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_attack_type_count(self): - cmd = """python ../../main.py ipanti describe-attack-type-count --start-time 'xxx'""" + def test_modify_forward_rule(self): + cmd = """python ../../main.py ipanti modify-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx' --forward-rule-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_forward_rule(self): + cmd = """python ../../main.py ipanti delete-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_switch_forward_rule_protect(self): + cmd = """python ../../main.py ipanti switch-forward-rule-protect --instance-id 'xxx' --forward-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_switch_forward_rule_origin(self): + cmd = """python ../../main.py ipanti switch-forward-rule-origin --instance-id 'xxx' --forward-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_protection_rule_of_forward_rule(self): + cmd = """python ../../main.py ipanti describe-protection-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_protection_rule_of_forward_rule(self): + cmd = """python ../../main.py ipanti modify-protection-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx' --forward-protection-rule-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_geo_areas(self): + cmd = """python ../../main.py ipanti describe-geo-areas """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_black_list_rule_of_forward_rule(self): + cmd = """python ../../main.py ipanti describe-black-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_black_list_rule_of_forward_rule(self): + cmd = """python ../../main.py ipanti modify-black-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx' --modify-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_enable_black_list_rule_of_forward_rule(self): + cmd = """python ../../main.py ipanti enable-black-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_disable_black_list_rule_of_forward_rule(self): + cmd = """python ../../main.py ipanti disable-black-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_white_list_rule_of_forward_rule(self): + cmd = """python ../../main.py ipanti describe-white-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_white_list_rule_of_forward_rule(self): + cmd = """python ../../main.py ipanti modify-white-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx' --modify-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_enable_white_list_rule_of_forward_rule(self): + cmd = """python ../../main.py ipanti enable-white-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_disable_white_list_rule_of_forward_rule(self): + cmd = """python ../../main.py ipanti disable-white-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,6 +212,15 @@ def test_describe_fwd_graph(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_business_graph(self): + cmd = """python ../../main.py ipanti describe-business-graph --start-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_ccgraph(self): cmd = """python ../../main.py ipanti describe-ccgraph --start-time 'xxx'""" with os.popen(cmd) as f: @@ -95,8 +230,8 @@ def test_describe_ccgraph(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_forward_rules(self): - cmd = """python ../../main.py ipanti describe-forward-rules --instance-id 'xxx'""" + def test_describe_status_graph(self): + cmd = """python ../../main.py ipanti describe-status-graph --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +239,8 @@ def test_describe_forward_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_forward_rule(self): - cmd = """python ../../main.py ipanti create-forward-rule --instance-id 'xxx' --forward-rule-spec '{"":""}'""" + def test_describe_conn_stat_graph(self): + cmd = """python ../../main.py ipanti describe-conn-stat-graph --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +248,8 @@ def test_create_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_forward_rule(self): - cmd = """python ../../main.py ipanti describe-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + def test_describe_ddo_sattack_logs(self): + cmd = """python ../../main.py ipanti describe-ddo-sattack-logs --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +257,8 @@ def test_describe_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_forward_rule(self): - cmd = """python ../../main.py ipanti modify-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx' --forward-rule-spec '{"":""}'""" + def test_describe_ddo_sip_attack_logs(self): + cmd = """python ../../main.py ipanti describe-ddo-sip-attack-logs --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +266,8 @@ def test_modify_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_forward_rule(self): - cmd = """python ../../main.py ipanti delete-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + def test_describe_ccattack_logs(self): + cmd = """python ../../main.py ipanti describe-ccattack-logs --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +275,8 @@ def test_delete_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_switch_forward_rule_protect(self): - cmd = """python ../../main.py ipanti switch-forward-rule-protect --instance-id 'xxx' --forward-rule-id 'xxx'""" + def test_describe_ccattack_log_details(self): + cmd = """python ../../main.py ipanti describe-ccattack-log-details """ with os.popen(cmd) as f: content = f.read() @@ -149,8 +284,8 @@ def test_switch_forward_rule_protect(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_switch_forward_rule_origin(self): - cmd = """python ../../main.py ipanti switch-forward-rule-origin --instance-id 'xxx' --forward-rule-id 'xxx'""" + def test_describe_attack_statistics(self): + cmd = """python ../../main.py ipanti describe-attack-statistics --start-time 'xxx' --type '5'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +293,8 @@ def test_switch_forward_rule_origin(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_protection_rule_of_forward_rule(self): - cmd = """python ../../main.py ipanti describe-protection-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + def test_describe_attack_type_count(self): + cmd = """python ../../main.py ipanti describe-attack-type-count --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -167,8 +302,8 @@ def test_describe_protection_rule_of_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_protection_rule_of_forward_rule(self): - cmd = """python ../../main.py ipanti modify-protection-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx' --forward-protection-rule-spec '{"":""}'""" + def test_describe_dispatch_rules(self): + cmd = """python ../../main.py ipanti describe-dispatch-rules --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +311,8 @@ def test_modify_protection_rule_of_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_geo_areas(self): - cmd = """python ../../main.py ipanti describe-geo-areas """ + def test_create_dispatch_rule(self): + cmd = """python ../../main.py ipanti create-dispatch-rule --instance-id 'xxx' --create-dispatch-rule-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +320,8 @@ def test_describe_geo_areas(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_black_list_rule_of_forward_rule(self): - cmd = """python ../../main.py ipanti describe-black-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + def test_create_dispatch_rules(self): + cmd = """python ../../main.py ipanti create-dispatch-rules --instance-id 'xxx' --dispatch-rule-spec-list '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +329,8 @@ def test_describe_black_list_rule_of_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_black_list_rule_of_forward_rule(self): - cmd = """python ../../main.py ipanti modify-black-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx' --modify-spec '{"":""}'""" + def test_modify_dispatch_rule(self): + cmd = """python ../../main.py ipanti modify-dispatch-rule --instance-id 'xxx' --dispatch-rule-id 'xxx' --modify-dispatch-rule-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +338,8 @@ def test_modify_black_list_rule_of_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_enable_black_list_rule_of_forward_rule(self): - cmd = """python ../../main.py ipanti enable-black-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + def test_delete_dispatch_rule(self): + cmd = """python ../../main.py ipanti delete-dispatch-rule --instance-id 'xxx' --dispatch-rule-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -212,8 +347,8 @@ def test_enable_black_list_rule_of_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disable_black_list_rule_of_forward_rule(self): - cmd = """python ../../main.py ipanti disable-black-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + def test_switch_dispatch_rule_protect(self): + cmd = """python ../../main.py ipanti switch-dispatch-rule-protect --instance-id 'xxx' --dispatch-rule-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -221,8 +356,8 @@ def test_disable_black_list_rule_of_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_white_list_rule_of_forward_rule(self): - cmd = """python ../../main.py ipanti describe-white-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + def test_switch_dispatch_rule_origin(self): + cmd = """python ../../main.py ipanti switch-dispatch-rule-origin --instance-id 'xxx' --dispatch-rule-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -230,8 +365,8 @@ def test_describe_white_list_rule_of_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_white_list_rule_of_forward_rule(self): - cmd = """python ../../main.py ipanti modify-white-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx' --modify-spec '{"":""}'""" + def test_describe_instance_acl(self): + cmd = """python ../../main.py ipanti describe-instance-acl --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -239,8 +374,8 @@ def test_modify_white_list_rule_of_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_enable_white_list_rule_of_forward_rule(self): - cmd = """python ../../main.py ipanti enable-white-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + def test_modify_instance_acl(self): + cmd = """python ../../main.py ipanti modify-instance-acl --instance-id 'xxx' --instance-acl-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -248,8 +383,80 @@ def test_enable_white_list_rule_of_forward_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disable_white_list_rule_of_forward_rule(self): - cmd = """python ../../main.py ipanti disable-white-list-rule-of-forward-rule --instance-id 'xxx' --forward-rule-id 'xxx'""" + def test_recover_instance_acl(self): + cmd = """python ../../main.py ipanti recover-instance-acl --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_custom_pages(self): + cmd = """python ../../main.py ipanti describe-custom-pages --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_custom_page(self): + cmd = """python ../../main.py ipanti create-custom-page --instance-id 'xxx' --custom-page-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_custom_page(self): + cmd = """python ../../main.py ipanti modify-custom-page --instance-id 'xxx' --page-id 'xxx' --custom-page-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_custom_page(self): + cmd = """python ../../main.py ipanti delete-custom-page --instance-id 'xxx' --page-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_instance_custom_page(self): + cmd = """python ../../main.py ipanti modify-instance-custom-page --instance-id 'xxx' --page-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_instance_custom_page_default(self): + cmd = """python ../../main.py ipanti modify-instance-custom-page-default --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_enable_instance_custom_page(self): + cmd = """python ../../main.py ipanti enable-instance-custom-page --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_disable_instance_custom_page(self): + cmd = """python ../../main.py ipanti disable-instance-custom-page --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -320,6 +527,33 @@ def test_modify_alarm_config(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_origin_white_ip_list(self): + cmd = """python ../../main.py ipanti describe-origin-white-ip-list --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_service_ip_list(self): + cmd = """python ../../main.py ipanti describe-service-ip-list --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_instance_id_by_resource_id(self): + cmd = """python ../../main.py ipanti describe-instance-id-by-resource-id --resource-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_name_list(self): cmd = """python ../../main.py ipanti describe-name-list """ with os.popen(cmd) as f: @@ -338,6 +572,15 @@ def test_describe_protection_statistics(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_protection_outline(self): + cmd = """python ../../main.py ipanti describe-protection-outline """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_check_name(self): cmd = """python ../../main.py ipanti check-name --name 'xxx'""" with os.popen(cmd) as f: @@ -365,6 +608,15 @@ def test_describe_cps_ip_list(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_ccs_ip_list(self): + cmd = """python ../../main.py ipanti describe-ccs-ip-list """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_ip_sets(self): cmd = """python ../../main.py ipanti describe-ip-sets --instance-id 'xxx'""" with os.popen(cmd) as f: @@ -428,6 +680,15 @@ def test_create_web_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_create_web_rules(self): + cmd = """python ../../main.py ipanti create-web-rules --instance-id 'xxx' --web-rule-spec-list '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_web_rule(self): cmd = """python ../../main.py ipanti describe-web-rule --instance-id 'xxx' --web-rule-id 'xxx'""" with os.popen(cmd) as f: @@ -518,6 +779,87 @@ def test_disable_web_rule_ccobserver_mode(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_js_pages_of_web_rule(self): + cmd = """python ../../main.py ipanti describe-js-pages-of-web-rule --instance-id 'xxx' --web-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_js_page_of_web_rule(self): + cmd = """python ../../main.py ipanti create-js-page-of-web-rule --instance-id 'xxx' --web-rule-id 'xxx' --js-page-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_js_pages_of_web_rule(self): + cmd = """python ../../main.py ipanti create-js-pages-of-web-rule --instance-id 'xxx' --web-rule-id 'xxx' --js-pages-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_js_page_of_web_rule(self): + cmd = """python ../../main.py ipanti modify-js-page-of-web-rule --instance-id 'xxx' --web-rule-id 'xxx' --js-page-id 'xxx' --js-page-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_js_page_of_web_rule(self): + cmd = """python ../../main.py ipanti delete-js-page-of-web-rule --instance-id 'xxx' --web-rule-id 'xxx' --js-page-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_disable_web_rule_js_page(self): + cmd = """python ../../main.py ipanti disable-web-rule-js-page --instance-id 'xxx' --web-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_enable_web_rule_js_page(self): + cmd = """python ../../main.py ipanti enable-web-rule-js-page --instance-id 'xxx' --web-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_web_rule_js_page_to_all(self): + cmd = """python ../../main.py ipanti modify-web-rule-js-page-to-all --instance-id 'xxx' --web-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_web_rule_js_page_to_custom(self): + cmd = """python ../../main.py ipanti modify-web-rule-js-page-to-custom --instance-id 'xxx' --web-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_ccprotection_rules_of_web_rule(self): cmd = """python ../../main.py ipanti describe-ccprotection-rules-of-web-rule --instance-id 'xxx' --web-rule-id 'xxx'""" with os.popen(cmd) as f: @@ -581,6 +923,24 @@ def test_disable_ccprotection_rule_of_web_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_enable_web_rule_ccprotection_rule(self): + cmd = """python ../../main.py ipanti enable-web-rule-ccprotection-rule --instance-id 'xxx' --web-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_disable_web_rule_ccprotection_rule(self): + cmd = """python ../../main.py ipanti disable-web-rule-ccprotection-rule --instance-id 'xxx' --web-rule-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_ccprotection_config_of_web_rule(self): cmd = """python ../../main.py ipanti describe-ccprotection-config-of-web-rule --instance-id 'xxx' --web-rule-id 'xxx'""" with os.popen(cmd) as f: diff --git a/testcases/generated/jcq_test.py b/testcases/generated/jcq_test.py index 10ab736..106f2c7 100644 --- a/testcases/generated/jcq_test.py +++ b/testcases/generated/jcq_test.py @@ -32,8 +32,8 @@ def test_describe_access_point(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_consumer_group_ids(self): - cmd = """python ../../main.py jcq describe-consumer-group-ids """ + def test_describe_topics(self): + cmd = """python ../../main.py jcq describe-topics """ with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_describe_consumer_group_ids(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_dead_letter_numbers(self): - cmd = """python ../../main.py jcq describe-dead-letter-numbers """ + def test_create_topic(self): + cmd = """python ../../main.py jcq create-topic --topic-name 'xxx' --type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_describe_dead_letter_numbers(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_dead_letter_numbers_with_topic(self): - cmd = """python ../../main.py jcq describe-dead-letter-numbers-with-topic --topic-name 'xxx'""" + def test_describe_topic(self): + cmd = """python ../../main.py jcq describe-topic --topic-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_describe_dead_letter_numbers_with_topic(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_dead_letters(self): - cmd = """python ../../main.py jcq list-dead-letters --topic-name 'xxx' --consumer-group-id 'xxx' --start-time 'xxx' --end-time 'xxx'""" + def test_delete_topic(self): + cmd = """python ../../main.py jcq delete-topic --topic-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_list_dead_letters(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_dead_letters(self): - cmd = """python ../../main.py jcq delete-dead-letters --topic-name 'xxx' --consumer-group-id 'xxx'""" + def test_describe_dead_letter_numbers(self): + cmd = """python ../../main.py jcq describe-dead-letter-numbers """ with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_delete_dead_letters(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_resend_dead_letters(self): - cmd = """python ../../main.py jcq resend-dead-letters --topic-name 'xxx' --consumer-group-id 'xxx'""" + def test_describe_dead_letter_numbers_with_topic(self): + cmd = """python ../../main.py jcq describe-dead-letter-numbers-with-topic --topic-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_resend_dead_letters(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_messages(self): - cmd = """python ../../main.py jcq describe-messages --topic-name 'xxx' --start-time 'xxx' --end-time 'xxx'""" + def test_list_dead_letters(self): + cmd = """python ../../main.py jcq list-dead-letters --topic-name 'xxx' --consumer-group-id 'xxx' --start-time 'xxx' --end-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_describe_messages(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_message(self): - cmd = """python ../../main.py jcq describe-message --topic-name 'xxx' --message-id 'xxx'""" + def test_delete_dead_letters(self): + cmd = """python ../../main.py jcq delete-dead-letters --topic-name 'xxx' --consumer-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_describe_message(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_message_trace(self): - cmd = """python ../../main.py jcq describe-message-trace --topic-name 'xxx' --message-id 'xxx'""" + def test_resend_dead_letters(self): + cmd = """python ../../main.py jcq resend-dead-letters --topic-name 'xxx' --consumer-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_describe_message_trace(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_messages_by_business_id(self): - cmd = """python ../../main.py jcq describe-messages-by-business-id --topic-name 'xxx' --business-id 'xxx'""" + def test_describe_permission(self): + cmd = """python ../../main.py jcq describe-permission --topic-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_describe_messages_by_business_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_permission(self): - cmd = """python ../../main.py jcq describe-permission --topic-name 'xxx'""" + def test_add_permission(self): + cmd = """python ../../main.py jcq add-permission --topic-name 'xxx' --permission 'xxx' --target-user-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_describe_permission(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_permission(self): - cmd = """python ../../main.py jcq add-permission --topic-name 'xxx' --permission 'xxx' --target-user-id 'xxx'""" + def test_remove_permission(self): + cmd = """python ../../main.py jcq remove-permission --topic-name 'xxx' --permission 'xxx' --target-user-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_add_permission(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_remove_permission(self): - cmd = """python ../../main.py jcq remove-permission --topic-name 'xxx' --permission 'xxx' --target-user-id 'xxx'""" + def test_describe_consumer_group_ids(self): + cmd = """python ../../main.py jcq describe-consumer-group-ids """ with os.popen(cmd) as f: content = f.read() @@ -212,8 +212,8 @@ def test_reset_consume_offset(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_topics(self): - cmd = """python ../../main.py jcq describe-topics """ + def test_describe_messages(self): + cmd = """python ../../main.py jcq describe-messages --topic-name 'xxx' --start-time 'xxx' --end-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -221,8 +221,8 @@ def test_describe_topics(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_topic(self): - cmd = """python ../../main.py jcq create-topic --topic-name 'xxx' --type 'xxx'""" + def test_describe_message(self): + cmd = """python ../../main.py jcq describe-message --topic-name 'xxx' --message-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -230,8 +230,8 @@ def test_create_topic(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_topic(self): - cmd = """python ../../main.py jcq describe-topic --topic-name 'xxx'""" + def test_describe_message_trace(self): + cmd = """python ../../main.py jcq describe-message-trace --topic-name 'xxx' --message-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -239,8 +239,8 @@ def test_describe_topic(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_topic(self): - cmd = """python ../../main.py jcq delete-topic --topic-name 'xxx'""" + def test_describe_messages_by_business_id(self): + cmd = """python ../../main.py jcq describe-messages-by-business-id --topic-name 'xxx' --business-id 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/jdccs_test.py b/testcases/generated/jdccs_test.py index cee22b4..b14ebf9 100644 --- a/testcases/generated/jdccs_test.py +++ b/testcases/generated/jdccs_test.py @@ -23,6 +23,96 @@ class JdccsTest(unittest.TestCase): + def test_describe_metrics(self): + cmd = """python ../../main.py jdccs describe-metrics """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_metric_data(self): + cmd = """python ../../main.py jdccs describe-metric-data --idc 'xxx' --metric 'xxx' --resource-id 'xxx' --start-time '5' --end-time '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_last_downsample(self): + cmd = """python ../../main.py jdccs last-downsample --idc 'xxx' --metric 'xxx' --resource-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_bandwidth_traffics(self): + cmd = """python ../../main.py jdccs describe-bandwidth-traffics --idc 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_bandwidth_traffic(self): + cmd = """python ../../main.py jdccs describe-bandwidth-traffic --idc 'xxx' --bandwidth-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_traffic_sampling(self): + cmd = """python ../../main.py jdccs describe-traffic-sampling --resource-id 'xxx' --start-time '5' --end-time '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_open_devices(self): + cmd = """python ../../main.py jdccs describe-open-devices """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_open_devices_data(self): + cmd = """python ../../main.py jdccs describe-open-devices-data --device-type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_rangetime_cabinet_current(self): + cmd = """python ../../main.py jdccs describe-rangetime-cabinet-current --idc 'xxx' --resource-id 'xxx' --start-time '5' --end-time '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_realtime_cabinet_current(self): + cmd = """python ../../main.py jdccs describe-realtime-cabinet-current --idc 'xxx' --resource-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_alarms(self): cmd = """python ../../main.py jdccs describe-alarms """ with os.popen(cmd) as f: @@ -32,6 +122,15 @@ def test_describe_alarms(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_create_alarm(self): + cmd = """python ../../main.py jdccs create-alarm """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_alarm(self): cmd = """python ../../main.py jdccs describe-alarm --alarm-id 'xxx'""" with os.popen(cmd) as f: @@ -41,8 +140,8 @@ def test_describe_alarm(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_alarm_history(self): - cmd = """python ../../main.py jdccs describe-alarm-history """ + def test_update_alarm(self): + cmd = """python ../../main.py jdccs update-alarm --alarm-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +149,8 @@ def test_describe_alarm_history(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_metrics(self): - cmd = """python ../../main.py jdccs describe-metrics """ + def test_delete_alarm(self): + cmd = """python ../../main.py jdccs delete-alarm --alarm-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +158,8 @@ def test_describe_metrics(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_metric_data(self): - cmd = """python ../../main.py jdccs describe-metric-data --idc 'xxx' --metric 'xxx' --resource-id 'xxx' --start-time '5' --end-time '5'""" + def test_describe_alarm_history(self): + cmd = """python ../../main.py jdccs describe-alarm-history """ with os.popen(cmd) as f: content = f.read() @@ -68,8 +167,8 @@ def test_describe_metric_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_last_downsample(self): - cmd = """python ../../main.py jdccs last-downsample --idc 'xxx' --metric 'xxx' --resource-id 'xxx'""" + def test_switch_alarm(self): + cmd = """python ../../main.py jdccs switch-alarm --alarm-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +176,8 @@ def test_last_downsample(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_bandwidth_traffics(self): - cmd = """python ../../main.py jdccs describe-bandwidth-traffics --idc 'xxx'""" + def test_describe_tickets(self): + cmd = """python ../../main.py jdccs describe-tickets """ with os.popen(cmd) as f: content = f.read() @@ -86,8 +185,8 @@ def test_describe_bandwidth_traffics(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_bandwidth_traffic(self): - cmd = """python ../../main.py jdccs describe-bandwidth-traffic --idc 'xxx' --bandwidth-id 'xxx'""" + def test_describe_ticket(self): + cmd = """python ../../main.py jdccs describe-ticket --ticket-no 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +194,8 @@ def test_describe_bandwidth_traffic(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_traffic_sampling(self): - cmd = """python ../../main.py jdccs describe-traffic-sampling --resource-id 'xxx' --start-time '5' --end-time '5'""" + def test_create_general_services_ticket(self): + cmd = """python ../../main.py jdccs create-general-services-ticket """ with os.popen(cmd) as f: content = f.read() @@ -185,17 +284,8 @@ def test_describe_bandwidth(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_tickets(self): - cmd = """python ../../main.py jdccs describe-tickets """ - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_describe_ticket(self): - cmd = """python ../../main.py jdccs describe-ticket --ticket-no 'xxx'""" + def test_describe_idc_overview(self): + cmd = """python ../../main.py jdccs describe-idc-overview --idc 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/jdfusion_test.py b/testcases/generated/jdfusion_test.py index 1185fe0..cf45f8c 100644 --- a/testcases/generated/jdfusion_test.py +++ b/testcases/generated/jdfusion_test.py @@ -23,17 +23,8 @@ class JdfusionTest(unittest.TestCase): - def test_get_cloud_infos(self): - cmd = """python ../../main.py jdfusion get-cloud-infos """ - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_regist_cloud_info(self): - cmd = """python ../../main.py jdfusion regist-cloud-info --cloud '{"":""}'""" + def test_get_vpc_by_id(self): + cmd = """python ../../main.py jdfusion get-vpc-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +32,8 @@ def test_regist_cloud_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_cloud_info_by_id(self): - cmd = """python ../../main.py jdfusion get-cloud-info-by-id --cloud-id 'xxx'""" + def test_delete_vpc_by_id(self): + cmd = """python ../../main.py jdfusion delete-vpc-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +41,8 @@ def test_get_cloud_info_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_unregist_cloud_info(self): - cmd = """python ../../main.py jdfusion unregist-cloud-info --cloud-id 'xxx'""" + def test_get_vpcs(self): + cmd = """python ../../main.py jdfusion get-vpcs """ with os.popen(cmd) as f: content = f.read() @@ -59,8 +50,8 @@ def test_unregist_cloud_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_valid_cloud_info(self): - cmd = """python ../../main.py jdfusion valid-cloud-info --cloud-id 'xxx'""" + def test_create_vpc(self): + cmd = """python ../../main.py jdfusion create-vpc --vpc '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +59,8 @@ def test_valid_cloud_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_deployments(self): - cmd = """python ../../main.py jdfusion get-deployments """ + def test_get_vm_instances_by_id(self): + cmd = """python ../../main.py jdfusion get-vm-instances-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +68,8 @@ def test_get_deployments(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_deployment(self): - cmd = """python ../../main.py jdfusion create-deployment --deployment '{"":""}'""" + def test_delete_vm_instance_by_id(self): + cmd = """python ../../main.py jdfusion delete-vm-instance-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +77,8 @@ def test_create_deployment(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_reverse_deployment(self): - cmd = """python ../../main.py jdfusion reverse-deployment --reverse '{"":""}'""" + def test_get_vm_instances(self): + cmd = """python ../../main.py jdfusion get-vm-instances """ with os.popen(cmd) as f: content = f.read() @@ -95,8 +86,8 @@ def test_reverse_deployment(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_deployments_by_id(self): - cmd = """python ../../main.py jdfusion get-deployments-by-id --id 'xxx'""" + def test_create_vm_instance(self): + cmd = """python ../../main.py jdfusion create-vm-instance --vm '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +95,8 @@ def test_get_deployments_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_edit_deployment(self): - cmd = """python ../../main.py jdfusion edit-deployment --id 'xxx' --deployment '{"":""}'""" + def test_stop_vm_instance_by_id(self): + cmd = """python ../../main.py jdfusion stop-vm-instance-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +104,8 @@ def test_edit_deployment(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_deployment(self): - cmd = """python ../../main.py jdfusion delete-deployment --id 'xxx'""" + def test_start_vm_instance_by_id(self): + cmd = """python ../../main.py jdfusion start-vm-instance-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +113,8 @@ def test_delete_deployment(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_clone_deployment(self): - cmd = """python ../../main.py jdfusion clone-deployment --id 'xxx' --deployment '{"":""}'""" + def test_reboot_vm_instance_by_id(self): + cmd = """python ../../main.py jdfusion reboot-vm-instance-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +122,8 @@ def test_clone_deployment(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_dryrun_deployment(self): - cmd = """python ../../main.py jdfusion dryrun-deployment --id 'xxx'""" + def test_get_vpc_vserver_groups(self): + cmd = """python ../../main.py jdfusion get-vpc-vserver-groups """ with os.popen(cmd) as f: content = f.read() @@ -140,8 +131,8 @@ def test_dryrun_deployment(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_apply_deployment(self): - cmd = """python ../../main.py jdfusion apply-deployment --id 'xxx' --apply '{"":""}'""" + def test_create_vpc_vserver_group(self): + cmd = """python ../../main.py jdfusion create-vpc-vserver-group --vserver-group '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +140,8 @@ def test_apply_deployment(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_deployment_result(self): - cmd = """python ../../main.py jdfusion get-deployment-result --id 'xxx'""" + def test_get_vserver_groups_by_id(self): + cmd = """python ../../main.py jdfusion get-vserver-groups-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +149,8 @@ def test_get_deployment_result(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_deployment_versions(self): - cmd = """python ../../main.py jdfusion get-deployment-versions --id 'xxx'""" + def test_delete_vserver_group(self): + cmd = """python ../../main.py jdfusion delete-vserver-group --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -167,8 +158,8 @@ def test_get_deployment_versions(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_deployments_version(self): - cmd = """python ../../main.py jdfusion get-deployments-version --id 'xxx' --version_id 'xxx'""" + def test_get_cloud_infos(self): + cmd = """python ../../main.py jdfusion get-cloud-infos """ with os.popen(cmd) as f: content = f.read() @@ -176,8 +167,8 @@ def test_get_deployments_version(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_rollback_deployments_version(self): - cmd = """python ../../main.py jdfusion rollback-deployments-version --id 'xxx' --version_id 'xxx'""" + def test_regist_cloud_info(self): + cmd = """python ../../main.py jdfusion regist-cloud-info --cloud '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +176,8 @@ def test_rollback_deployments_version(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_deployments_results_by_id_record(self): - cmd = """python ../../main.py jdfusion get-deployments-results-by-id-record --id 'xxx' --record 'xxx'""" + def test_get_cloud_info_by_id(self): + cmd = """python ../../main.py jdfusion get-cloud-info-by-id --cloud-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +185,8 @@ def test_get_deployments_results_by_id_record(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_disks(self): - cmd = """python ../../main.py jdfusion get-disks """ + def test_unregist_cloud_info(self): + cmd = """python ../../main.py jdfusion unregist-cloud-info --cloud-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +194,8 @@ def test_get_disks(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_disk(self): - cmd = """python ../../main.py jdfusion create-disk --disk '{"":""}'""" + def test_valid_cloud_info(self): + cmd = """python ../../main.py jdfusion valid-cloud-info --cloud-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -212,8 +203,8 @@ def test_create_disk(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_disk_by_id(self): - cmd = """python ../../main.py jdfusion get-disk-by-id --id 'xxx'""" + def test_get_rds_databases_by_inst_id(self): + cmd = """python ../../main.py jdfusion get-rds-databases-by-inst-id --inst-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -221,8 +212,8 @@ def test_get_disk_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_remove_disk_by_id(self): - cmd = """python ../../main.py jdfusion remove-disk-by-id --id 'xxx'""" + def test_create_rds_database(self): + cmd = """python ../../main.py jdfusion create-rds-database --inst-id 'xxx' --database '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -230,8 +221,8 @@ def test_remove_disk_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_attach_disk_to_vm_instance_by_disk_id(self): - cmd = """python ../../main.py jdfusion attach-disk-to-vm-instance-by-disk-id --id 'xxx' --attach '{"":""}'""" + def test_get_rds_database_by_inst_id_and_db_name(self): + cmd = """python ../../main.py jdfusion get-rds-database-by-inst-id-and-db-name --inst-id 'xxx' --db-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -239,8 +230,8 @@ def test_attach_disk_to_vm_instance_by_disk_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_detach_disk_to_vm_instance_by_disk_id(self): - cmd = """python ../../main.py jdfusion detach-disk-to-vm-instance-by-disk-id --id 'xxx' --detach '{"":""}'""" + def test_delete_rds_database(self): + cmd = """python ../../main.py jdfusion delete-rds-database --inst-id 'xxx' --db-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -293,8 +284,8 @@ def test_get_bucket_files(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_transfer_tasks(self): - cmd = """python ../../main.py jdfusion get-transfer-tasks """ + def test_get_vpc_slb_by_id(self): + cmd = """python ../../main.py jdfusion get-vpc-slb-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -302,8 +293,8 @@ def test_get_transfer_tasks(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_transfer_task(self): - cmd = """python ../../main.py jdfusion create-transfer-task """ + def test_delete_vpc_slb_by_id(self): + cmd = """python ../../main.py jdfusion delete-vpc-slb-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -311,8 +302,8 @@ def test_create_transfer_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_transfer_task_by_id(self): - cmd = """python ../../main.py jdfusion get-transfer-task-by-id --id 'xxx'""" + def test_get_vpc_slbs(self): + cmd = """python ../../main.py jdfusion get-vpc-slbs """ with os.popen(cmd) as f: content = f.read() @@ -320,8 +311,8 @@ def test_get_transfer_task_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_edit_transfer_task(self): - cmd = """python ../../main.py jdfusion edit-transfer-task --id 'xxx'""" + def test_create_vpc_slb(self): + cmd = """python ../../main.py jdfusion create-vpc-slb --slb '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -329,8 +320,8 @@ def test_edit_transfer_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_transfer_task(self): - cmd = """python ../../main.py jdfusion delete-transfer-task --id 'xxx'""" + def test_start_slb(self): + cmd = """python ../../main.py jdfusion start-slb --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -338,8 +329,8 @@ def test_delete_transfer_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_transfer_task(self): - cmd = """python ../../main.py jdfusion start-transfer-task --id 'xxx'""" + def test_stop_slb(self): + cmd = """python ../../main.py jdfusion stop-slb --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -347,8 +338,8 @@ def test_start_transfer_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_transfer_task(self): - cmd = """python ../../main.py jdfusion stop-transfer-task --id 'xxx'""" + def test_delete_slbs_listener(self): + cmd = """python ../../main.py jdfusion delete-slbs-listener --id 'xxx' --listener-port '5'""" with os.popen(cmd) as f: content = f.read() @@ -356,8 +347,8 @@ def test_stop_transfer_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_transfer_task_progress(self): - cmd = """python ../../main.py jdfusion get-transfer-task-progress --id 'xxx'""" + def test_start_slb_listener(self): + cmd = """python ../../main.py jdfusion start-slb-listener --id 'xxx' --listener-port '5'""" with os.popen(cmd) as f: content = f.read() @@ -365,8 +356,8 @@ def test_get_transfer_task_progress(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_transfer_task_failed_files(self): - cmd = """python ../../main.py jdfusion get-transfer-task-failed-files --id 'xxx'""" + def test_stop_slb_listener(self): + cmd = """python ../../main.py jdfusion stop-slb-listener --id 'xxx' --listener-port '5'""" with os.popen(cmd) as f: content = f.read() @@ -374,8 +365,8 @@ def test_get_transfer_task_failed_files(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_rds_accounts_by_inst_id(self): - cmd = """python ../../main.py jdfusion get-rds-accounts-by-inst-id --inst-id 'xxx'""" + def test_get_rds_specification(self): + cmd = """python ../../main.py jdfusion get-rds-specification --engine 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -383,8 +374,8 @@ def test_get_rds_accounts_by_inst_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_rds_accounts(self): - cmd = """python ../../main.py jdfusion create-rds-accounts --inst-id 'xxx' --account '{"":""}'""" + def test_get_vm_instance_types(self): + cmd = """python ../../main.py jdfusion get-vm-instance-types """ with os.popen(cmd) as f: content = f.read() @@ -392,8 +383,8 @@ def test_create_rds_accounts(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_rds_accounts_by_inst_id_and_account_name(self): - cmd = """python ../../main.py jdfusion get-rds-accounts-by-inst-id-and-account-name --inst-id 'xxx' --account-name 'xxx'""" + def test_get_vpc_network_interface_by_id(self): + cmd = """python ../../main.py jdfusion get-vpc-network-interface-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -401,8 +392,8 @@ def test_get_rds_accounts_by_inst_id_and_account_name(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_rds_account(self): - cmd = """python ../../main.py jdfusion delete-rds-account --inst-id 'xxx' --account-name 'xxx'""" + def test_delete_vpc_network_interface_by_id(self): + cmd = """python ../../main.py jdfusion delete-vpc-network-interface-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -410,8 +401,8 @@ def test_delete_rds_account(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_grant_rds_account(self): - cmd = """python ../../main.py jdfusion grant-rds-account --inst-id 'xxx' --account-name 'xxx' --db-privilege-info '{"":""}'""" + def test_get_vpc_network_interfaces(self): + cmd = """python ../../main.py jdfusion get-vpc-network-interfaces """ with os.popen(cmd) as f: content = f.read() @@ -419,8 +410,8 @@ def test_grant_rds_account(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_revoke_rds_account(self): - cmd = """python ../../main.py jdfusion revoke-rds-account --inst-id 'xxx' --account-name 'xxx' --db-name 'xxx'""" + def test_create_vpc_network_interface(self): + cmd = """python ../../main.py jdfusion create-vpc-network-interface --net-interface '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -428,8 +419,8 @@ def test_revoke_rds_account(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_grant_rds_accounts_by_task(self): - cmd = """python ../../main.py jdfusion grant-rds-accounts-by-task --inst-id 'xxx' --account-name 'xxx' --info '{"":""}'""" + def test_attach_vpc_network_interface_by_id(self): + cmd = """python ../../main.py jdfusion attach-vpc-network-interface-by-id --id 'xxx' --attach '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -437,8 +428,8 @@ def test_grant_rds_accounts_by_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_rds_databases_by_inst_id(self): - cmd = """python ../../main.py jdfusion get-rds-databases-by-inst-id --inst-id 'xxx'""" + def test_detach_vpc_network_interface_by_id(self): + cmd = """python ../../main.py jdfusion detach-vpc-network-interface-by-id --id 'xxx' --detach '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -446,8 +437,8 @@ def test_get_rds_databases_by_inst_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_rds_database(self): - cmd = """python ../../main.py jdfusion create-rds-database --inst-id 'xxx' --database '{"":""}'""" + def test_get_disks(self): + cmd = """python ../../main.py jdfusion get-disks """ with os.popen(cmd) as f: content = f.read() @@ -455,8 +446,8 @@ def test_create_rds_database(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_rds_database_by_inst_id_and_db_name(self): - cmd = """python ../../main.py jdfusion get-rds-database-by-inst-id-and-db-name --inst-id 'xxx' --db-name 'xxx'""" + def test_create_disk(self): + cmd = """python ../../main.py jdfusion create-disk --disk '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -464,8 +455,8 @@ def test_get_rds_database_by_inst_id_and_db_name(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_rds_database(self): - cmd = """python ../../main.py jdfusion delete-rds-database --inst-id 'xxx' --db-name 'xxx'""" + def test_get_disk_by_id(self): + cmd = """python ../../main.py jdfusion get-disk-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -473,8 +464,8 @@ def test_delete_rds_database(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_rds_instances(self): - cmd = """python ../../main.py jdfusion get-rds-instances """ + def test_remove_disk_by_id(self): + cmd = """python ../../main.py jdfusion remove-disk-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -482,8 +473,8 @@ def test_get_rds_instances(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_rds_instance(self): - cmd = """python ../../main.py jdfusion create-rds-instance --instance '{"":""}'""" + def test_attach_disk_to_vm_instance_by_disk_id(self): + cmd = """python ../../main.py jdfusion attach-disk-to-vm-instance-by-disk-id --id 'xxx' --attach '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -491,8 +482,8 @@ def test_create_rds_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_rds_by_inst_id(self): - cmd = """python ../../main.py jdfusion get-rds-by-inst-id --inst-id 'xxx'""" + def test_detach_disk_to_vm_instance_by_disk_id(self): + cmd = """python ../../main.py jdfusion detach-disk-to-vm-instance-by-disk-id --id 'xxx' --detach '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -500,8 +491,8 @@ def test_get_rds_by_inst_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_rds_by_inst_id(self): - cmd = """python ../../main.py jdfusion delete-rds-by-inst-id --inst-id 'xxx'""" + def test_get_rds_accounts_by_inst_id(self): + cmd = """python ../../main.py jdfusion get-rds-accounts-by-inst-id --inst-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -509,8 +500,8 @@ def test_delete_rds_by_inst_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_channels(self): - cmd = """python ../../main.py jdfusion get-channels """ + def test_create_rds_accounts(self): + cmd = """python ../../main.py jdfusion create-rds-accounts --inst-id 'xxx' --account '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -518,8 +509,8 @@ def test_get_channels(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_channel(self): - cmd = """python ../../main.py jdfusion create-channel --channel '{"":""}'""" + def test_get_rds_accounts_by_inst_id_and_account_name(self): + cmd = """python ../../main.py jdfusion get-rds-accounts-by-inst-id-and-account-name --inst-id 'xxx' --account-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -527,8 +518,8 @@ def test_create_channel(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_channel(self): - cmd = """python ../../main.py jdfusion delete-channel --id 'xxx'""" + def test_delete_rds_account(self): + cmd = """python ../../main.py jdfusion delete-rds-account --inst-id 'xxx' --account-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -536,8 +527,8 @@ def test_delete_channel(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_channel(self): - cmd = """python ../../main.py jdfusion start-channel --id 'xxx'""" + def test_grant_rds_account(self): + cmd = """python ../../main.py jdfusion grant-rds-account --inst-id 'xxx' --account-name 'xxx' --db-privilege-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -545,8 +536,8 @@ def test_start_channel(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_channel(self): - cmd = """python ../../main.py jdfusion stop-channel --id 'xxx'""" + def test_revoke_rds_account(self): + cmd = """python ../../main.py jdfusion revoke-rds-account --inst-id 'xxx' --account-name 'xxx' --db-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -554,8 +545,8 @@ def test_stop_channel(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_datasources(self): - cmd = """python ../../main.py jdfusion get-datasources """ + def test_grant_rds_accounts_by_task(self): + cmd = """python ../../main.py jdfusion grant-rds-accounts-by-task --inst-id 'xxx' --account-name 'xxx' --info '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -563,8 +554,8 @@ def test_get_datasources(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_datasource(self): - cmd = """python ../../main.py jdfusion create-datasource --datasource '{"":""}'""" + def test_get_vpc_eips(self): + cmd = """python ../../main.py jdfusion get-vpc-eips """ with os.popen(cmd) as f: content = f.read() @@ -572,8 +563,8 @@ def test_create_datasource(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_datasource(self): - cmd = """python ../../main.py jdfusion delete-datasource --id 'xxx'""" + def test_create_vpc_eip(self): + cmd = """python ../../main.py jdfusion create-vpc-eip --allocate '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -581,8 +572,8 @@ def test_delete_datasource(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_rds_specification(self): - cmd = """python ../../main.py jdfusion get-rds-specification --engine 'xxx'""" + def test_get_vpc_eip_by_id(self): + cmd = """python ../../main.py jdfusion get-vpc-eip-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -590,8 +581,8 @@ def test_get_rds_specification(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_regions(self): - cmd = """python ../../main.py jdfusion get-regions """ + def test_delete_vpc_eip_by_id(self): + cmd = """python ../../main.py jdfusion delete-vpc-eip-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -599,8 +590,17 @@ def test_get_regions(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_regions_available_zones(self): - cmd = """python ../../main.py jdfusion get-regions-available-zones --region 'xxx'""" + def test_associate_vpc_eip_by_id(self): + cmd = """python ../../main.py jdfusion associate-vpc-eip-by-id --id 'xxx' --associate '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_disassociate_vpc_eip_by_id(self): + cmd = """python ../../main.py jdfusion disassociate-vpc-eip-by-id --id 'xxx' --unassociate '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -626,8 +626,8 @@ def test_get_task_info_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vm_images(self): - cmd = """python ../../main.py jdfusion get-vm-images """ + def test_get_transfer_tasks(self): + cmd = """python ../../main.py jdfusion get-transfer-tasks """ with os.popen(cmd) as f: content = f.read() @@ -635,8 +635,8 @@ def test_get_vm_images(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vm_instances_by_id(self): - cmd = """python ../../main.py jdfusion get-vm-instances-by-id --id 'xxx'""" + def test_create_transfer_task(self): + cmd = """python ../../main.py jdfusion create-transfer-task """ with os.popen(cmd) as f: content = f.read() @@ -644,8 +644,8 @@ def test_get_vm_instances_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vm_instance_by_id(self): - cmd = """python ../../main.py jdfusion delete-vm-instance-by-id --id 'xxx'""" + def test_get_transfer_task_by_id(self): + cmd = """python ../../main.py jdfusion get-transfer-task-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -653,8 +653,8 @@ def test_delete_vm_instance_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vm_instances(self): - cmd = """python ../../main.py jdfusion get-vm-instances """ + def test_edit_transfer_task(self): + cmd = """python ../../main.py jdfusion edit-transfer-task --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -662,8 +662,8 @@ def test_get_vm_instances(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_vm_instance(self): - cmd = """python ../../main.py jdfusion create-vm-instance --vm '{"":""}'""" + def test_delete_transfer_task(self): + cmd = """python ../../main.py jdfusion delete-transfer-task --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -671,8 +671,8 @@ def test_create_vm_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_vm_instance_by_id(self): - cmd = """python ../../main.py jdfusion stop-vm-instance-by-id --id 'xxx'""" + def test_start_transfer_task(self): + cmd = """python ../../main.py jdfusion start-transfer-task --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -680,8 +680,8 @@ def test_stop_vm_instance_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_vm_instance_by_id(self): - cmd = """python ../../main.py jdfusion start-vm-instance-by-id --id 'xxx'""" + def test_stop_transfer_task(self): + cmd = """python ../../main.py jdfusion stop-transfer-task --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -689,8 +689,8 @@ def test_start_vm_instance_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_reboot_vm_instance_by_id(self): - cmd = """python ../../main.py jdfusion reboot-vm-instance-by-id --id 'xxx'""" + def test_get_transfer_task_progress(self): + cmd = """python ../../main.py jdfusion get-transfer-task-progress --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -698,8 +698,8 @@ def test_reboot_vm_instance_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vm_instance_types(self): - cmd = """python ../../main.py jdfusion get-vm-instance-types """ + def test_get_transfer_task_failed_files(self): + cmd = """python ../../main.py jdfusion get-transfer-task-failed-files --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -743,8 +743,8 @@ def test_create_vm_keypair(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpc_eips(self): - cmd = """python ../../main.py jdfusion get-vpc-eips """ + def test_get_vpc_security_group_by_id(self): + cmd = """python ../../main.py jdfusion get-vpc-security-group-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -752,8 +752,8 @@ def test_get_vpc_eips(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_vpc_eip(self): - cmd = """python ../../main.py jdfusion create-vpc-eip --allocate '{"":""}'""" + def test_delete_vpc_security_group_by_id(self): + cmd = """python ../../main.py jdfusion delete-vpc-security-group-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -761,8 +761,8 @@ def test_create_vpc_eip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpc_eip_by_id(self): - cmd = """python ../../main.py jdfusion get-vpc-eip-by-id --id 'xxx'""" + def test_get_vpc_security_groups(self): + cmd = """python ../../main.py jdfusion get-vpc-security-groups """ with os.popen(cmd) as f: content = f.read() @@ -770,8 +770,8 @@ def test_get_vpc_eip_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vpc_eip_by_id(self): - cmd = """python ../../main.py jdfusion delete-vpc-eip-by-id --id 'xxx'""" + def test_create_vpc_security_group(self): + cmd = """python ../../main.py jdfusion create-vpc-security-group --security-group '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -779,8 +779,8 @@ def test_delete_vpc_eip_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_associate_vpc_eip_by_id(self): - cmd = """python ../../main.py jdfusion associate-vpc-eip-by-id --id 'xxx' --associate '{"":""}'""" + def test_create_security_groups_rule(self): + cmd = """python ../../main.py jdfusion create-security-groups-rule --id 'xxx' --sg-rule '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -788,8 +788,8 @@ def test_associate_vpc_eip_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disassociate_vpc_eip_by_id(self): - cmd = """python ../../main.py jdfusion disassociate-vpc-eip-by-id --id 'xxx' --unassociate '{"":""}'""" + def test_delete_security_groups_rule(self): + cmd = """python ../../main.py jdfusion delete-security-groups-rule --id 'xxx' --rule-type 'xxx' --protocol 'xxx' --from-port 'xxx' --to-port 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -815,8 +815,8 @@ def test_create_vpc_lbhttp_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpc_network_interface_by_id(self): - cmd = """python ../../main.py jdfusion get-vpc-network-interface-by-id --id 'xxx'""" + def test_get_vm_images(self): + cmd = """python ../../main.py jdfusion get-vm-images """ with os.popen(cmd) as f: content = f.read() @@ -824,8 +824,8 @@ def test_get_vpc_network_interface_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vpc_network_interface_by_id(self): - cmd = """python ../../main.py jdfusion delete-vpc-network-interface-by-id --id 'xxx'""" + def test_get_vpc_subnet_by_id(self): + cmd = """python ../../main.py jdfusion get-vpc-subnet-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -833,8 +833,8 @@ def test_delete_vpc_network_interface_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpc_network_interfaces(self): - cmd = """python ../../main.py jdfusion get-vpc-network-interfaces """ + def test_delete_vpc_subnet_by_id(self): + cmd = """python ../../main.py jdfusion delete-vpc-subnet-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -842,8 +842,8 @@ def test_get_vpc_network_interfaces(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_vpc_network_interface(self): - cmd = """python ../../main.py jdfusion create-vpc-network-interface --net-interface '{"":""}'""" + def test_get_vpc_subnets(self): + cmd = """python ../../main.py jdfusion get-vpc-subnets """ with os.popen(cmd) as f: content = f.read() @@ -851,8 +851,8 @@ def test_create_vpc_network_interface(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_attach_vpc_network_interface_by_id(self): - cmd = """python ../../main.py jdfusion attach-vpc-network-interface-by-id --id 'xxx' --attach '{"":""}'""" + def test_create_vpc_subnet(self): + cmd = """python ../../main.py jdfusion create-vpc-subnet --subnet '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -860,8 +860,8 @@ def test_attach_vpc_network_interface_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_detach_vpc_network_interface_by_id(self): - cmd = """python ../../main.py jdfusion detach-vpc-network-interface-by-id --id 'xxx' --detach '{"":""}'""" + def test_get_rds_instances(self): + cmd = """python ../../main.py jdfusion get-rds-instances """ with os.popen(cmd) as f: content = f.read() @@ -869,8 +869,8 @@ def test_detach_vpc_network_interface_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpc_security_group_by_id(self): - cmd = """python ../../main.py jdfusion get-vpc-security-group-by-id --id 'xxx'""" + def test_create_rds_instance(self): + cmd = """python ../../main.py jdfusion create-rds-instance --instance '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -878,8 +878,8 @@ def test_get_vpc_security_group_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vpc_security_group_by_id(self): - cmd = """python ../../main.py jdfusion delete-vpc-security-group-by-id --id 'xxx'""" + def test_get_rds_by_inst_id(self): + cmd = """python ../../main.py jdfusion get-rds-by-inst-id --inst-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -887,8 +887,8 @@ def test_delete_vpc_security_group_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpc_security_groups(self): - cmd = """python ../../main.py jdfusion get-vpc-security-groups """ + def test_delete_rds_by_inst_id(self): + cmd = """python ../../main.py jdfusion delete-rds-by-inst-id --inst-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -896,8 +896,8 @@ def test_get_vpc_security_groups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_vpc_security_group(self): - cmd = """python ../../main.py jdfusion create-vpc-security-group --security-group '{"":""}'""" + def test_get_deployments(self): + cmd = """python ../../main.py jdfusion get-deployments """ with os.popen(cmd) as f: content = f.read() @@ -905,8 +905,8 @@ def test_create_vpc_security_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_security_groups_rule(self): - cmd = """python ../../main.py jdfusion create-security-groups-rule --id 'xxx' --sg-rule '{"":""}'""" + def test_create_deployment(self): + cmd = """python ../../main.py jdfusion create-deployment --deployment '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -914,8 +914,8 @@ def test_create_security_groups_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_security_groups_rule(self): - cmd = """python ../../main.py jdfusion delete-security-groups-rule --id 'xxx' --rule-type 'xxx' --protocol 'xxx' --from-port 'xxx' --to-port 'xxx'""" + def test_reverse_deployment(self): + cmd = """python ../../main.py jdfusion reverse-deployment --reverse '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -923,8 +923,8 @@ def test_delete_security_groups_rule(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpc_slb_by_id(self): - cmd = """python ../../main.py jdfusion get-vpc-slb-by-id --id 'xxx'""" + def test_get_deployments_by_id(self): + cmd = """python ../../main.py jdfusion get-deployments-by-id --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -932,8 +932,8 @@ def test_get_vpc_slb_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vpc_slb_by_id(self): - cmd = """python ../../main.py jdfusion delete-vpc-slb-by-id --id 'xxx'""" + def test_edit_deployment(self): + cmd = """python ../../main.py jdfusion edit-deployment --id 'xxx' --deployment '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -941,8 +941,8 @@ def test_delete_vpc_slb_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpc_slbs(self): - cmd = """python ../../main.py jdfusion get-vpc-slbs """ + def test_delete_deployment(self): + cmd = """python ../../main.py jdfusion delete-deployment --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -950,8 +950,8 @@ def test_get_vpc_slbs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_vpc_slb(self): - cmd = """python ../../main.py jdfusion create-vpc-slb --slb '{"":""}'""" + def test_clone_deployment(self): + cmd = """python ../../main.py jdfusion clone-deployment --id 'xxx' --deployment '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -959,8 +959,8 @@ def test_create_vpc_slb(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_slb(self): - cmd = """python ../../main.py jdfusion start-slb --id 'xxx'""" + def test_dryrun_deployment(self): + cmd = """python ../../main.py jdfusion dryrun-deployment --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -968,8 +968,8 @@ def test_start_slb(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_slb(self): - cmd = """python ../../main.py jdfusion stop-slb --id 'xxx'""" + def test_apply_deployment(self): + cmd = """python ../../main.py jdfusion apply-deployment --id 'xxx' --apply '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -977,8 +977,8 @@ def test_stop_slb(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_slbs_listener(self): - cmd = """python ../../main.py jdfusion delete-slbs-listener --id 'xxx' --listener-port '5'""" + def test_get_deployment_result(self): + cmd = """python ../../main.py jdfusion get-deployment-result --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -986,8 +986,8 @@ def test_delete_slbs_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_slb_listener(self): - cmd = """python ../../main.py jdfusion start-slb-listener --id 'xxx' --listener-port '5'""" + def test_get_deployment_versions(self): + cmd = """python ../../main.py jdfusion get-deployment-versions --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -995,8 +995,8 @@ def test_start_slb_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_slb_listener(self): - cmd = """python ../../main.py jdfusion stop-slb-listener --id 'xxx' --listener-port '5'""" + def test_get_deployments_version(self): + cmd = """python ../../main.py jdfusion get-deployments-version --id 'xxx' --version_id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1004,8 +1004,8 @@ def test_stop_slb_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpc_subnet_by_id(self): - cmd = """python ../../main.py jdfusion get-vpc-subnet-by-id --id 'xxx'""" + def test_rollback_deployments_version(self): + cmd = """python ../../main.py jdfusion rollback-deployments-version --id 'xxx' --version_id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1013,8 +1013,8 @@ def test_get_vpc_subnet_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vpc_subnet_by_id(self): - cmd = """python ../../main.py jdfusion delete-vpc-subnet-by-id --id 'xxx'""" + def test_get_deployments_results_by_id_record(self): + cmd = """python ../../main.py jdfusion get-deployments-results-by-id-record --id 'xxx' --record 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1022,8 +1022,8 @@ def test_delete_vpc_subnet_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpc_subnets(self): - cmd = """python ../../main.py jdfusion get-vpc-subnets """ + def test_get_regions(self): + cmd = """python ../../main.py jdfusion get-regions """ with os.popen(cmd) as f: content = f.read() @@ -1031,8 +1031,8 @@ def test_get_vpc_subnets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_vpc_subnet(self): - cmd = """python ../../main.py jdfusion create-vpc-subnet --subnet '{"":""}'""" + def test_get_regions_available_zones(self): + cmd = """python ../../main.py jdfusion get-regions-available-zones --region 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1040,8 +1040,8 @@ def test_create_vpc_subnet(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpc_by_id(self): - cmd = """python ../../main.py jdfusion get-vpc-by-id --id 'xxx'""" + def test_get_channels(self): + cmd = """python ../../main.py jdfusion get-channels """ with os.popen(cmd) as f: content = f.read() @@ -1049,8 +1049,8 @@ def test_get_vpc_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vpc_by_id(self): - cmd = """python ../../main.py jdfusion delete-vpc-by-id --id 'xxx'""" + def test_create_channel(self): + cmd = """python ../../main.py jdfusion create-channel --channel '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -1058,8 +1058,8 @@ def test_delete_vpc_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpcs(self): - cmd = """python ../../main.py jdfusion get-vpcs """ + def test_delete_channel(self): + cmd = """python ../../main.py jdfusion delete-channel --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1067,8 +1067,8 @@ def test_get_vpcs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_vpc(self): - cmd = """python ../../main.py jdfusion create-vpc --vpc '{"":""}'""" + def test_start_channel(self): + cmd = """python ../../main.py jdfusion start-channel --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1076,8 +1076,8 @@ def test_create_vpc(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vpc_vserver_groups(self): - cmd = """python ../../main.py jdfusion get-vpc-vserver-groups """ + def test_stop_channel(self): + cmd = """python ../../main.py jdfusion stop-channel --id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1085,8 +1085,8 @@ def test_get_vpc_vserver_groups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_vpc_vserver_group(self): - cmd = """python ../../main.py jdfusion create-vpc-vserver-group --vserver-group '{"":""}'""" + def test_get_datasources(self): + cmd = """python ../../main.py jdfusion get-datasources """ with os.popen(cmd) as f: content = f.read() @@ -1094,8 +1094,8 @@ def test_create_vpc_vserver_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vserver_groups_by_id(self): - cmd = """python ../../main.py jdfusion get-vserver-groups-by-id --id 'xxx'""" + def test_create_datasource(self): + cmd = """python ../../main.py jdfusion create-datasource --datasource '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -1103,8 +1103,8 @@ def test_get_vserver_groups_by_id(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vserver_group(self): - cmd = """python ../../main.py jdfusion delete-vserver-group --id 'xxx'""" + def test_delete_datasource(self): + cmd = """python ../../main.py jdfusion delete-datasource --id 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/jke_test.py b/testcases/generated/jke_test.py deleted file mode 100644 index 4fff381..0000000 --- a/testcases/generated/jke_test.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf8 - -# Copyright 2018 JDCLOUD.COM -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# NOTE: This class is auto generated by the jdcloud code generator program. - -import unittest -import os -import json - - -class JkeTest(unittest.TestCase): - - def test_describe_quotas(self): - cmd = """python ../../main.py jke describe-quotas """ - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - diff --git a/testcases/generated/jmr_test.py b/testcases/generated/jmr_test.py index 966e8f0..b80b30d 100644 --- a/testcases/generated/jmr_test.py +++ b/testcases/generated/jmr_test.py @@ -23,8 +23,35 @@ class JmrTest(unittest.TestCase): - def test_describe_cluster(self): - cmd = """python ../../main.py jmr describe-cluster --cluster-id 'xxx'""" + def test_idata_cluster(self): + cmd = """python ../../main.py jmr idata-cluster """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_get_software_info(self): + cmd = """python ../../main.py jmr get-software-info --version 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_get_jmr_version_list(self): + cmd = """python ../../main.py jmr get-jmr-version-list """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_monitor_label_list(self): + cmd = """python ../../main.py jmr monitor-label-list --cluster-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +59,8 @@ def test_describe_cluster(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_cluster(self): - cmd = """python ../../main.py jmr delete-cluster --cluster-id 'xxx'""" + def test_describe_cluster(self): + cmd = """python ../../main.py jmr describe-cluster --cluster-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +77,35 @@ def test_describe_clusters(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_release_cluster(self): + cmd = """python ../../main.py jmr release-cluster --cluster-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_cluster_expansion(self): + cmd = """python ../../main.py jmr cluster-expansion --cluster-expansion '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_cluster_reduction(self): + cmd = """python ../../main.py jmr cluster-reduction --cluster-reduction '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_create_cluster(self): - cmd = """python ../../main.py jmr create-cluster --cluster-spec '{"":""}' --client-token 'xxx'""" + cmd = """python ../../main.py jmr create-cluster --cluster-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/kms_test.py b/testcases/generated/kms_test.py index 1b041f9..a13f557 100644 --- a/testcases/generated/kms_test.py +++ b/testcases/generated/kms_test.py @@ -221,15 +221,6 @@ def test_create_secret(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_import_secret(self): - cmd = """python ../../main.py kms import-secret """ - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - def test_describe_secret_version_list(self): cmd = """python ../../main.py kms describe-secret-version-list --secret-id 'xxx'""" with os.popen(cmd) as f: @@ -284,15 +275,6 @@ def test_create_secret_version(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_export_secret(self): - cmd = """python ../../main.py kms export-secret --secret-id 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - def test_describe_secret_version_info(self): cmd = """python ../../main.py kms describe-secret-version-info --secret-id 'xxx' --version 'xxx'""" with os.popen(cmd) as f: diff --git a/testcases/generated/kubernetes_test.py b/testcases/generated/kubernetes_test.py index 577ec68..7858876 100644 --- a/testcases/generated/kubernetes_test.py +++ b/testcases/generated/kubernetes_test.py @@ -23,8 +23,8 @@ class KubernetesTest(unittest.TestCase): - def test_describe_clusters(self): - cmd = """python ../../main.py kubernetes describe-clusters """ + def test_describe_node_groups(self): + cmd = """python ../../main.py kubernetes describe-node-groups """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_clusters(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_cluster(self): - cmd = """python ../../main.py kubernetes create-cluster --name 'xxx' --node-group '{"":""}' --master-cidr 'xxx' --access-key 'xxx' --secret-key 'xxx'""" + def test_create_node_group(self): + cmd = """python ../../main.py kubernetes create-node-group --name 'xxx' --cluster-id 'xxx' --node-config '{"":""}' --initial-node-count '5' --vpc-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_create_cluster(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_cluster(self): - cmd = """python ../../main.py kubernetes describe-cluster --cluster-id 'xxx'""" + def test_describe_node_group(self): + cmd = """python ../../main.py kubernetes describe-node-group --node-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_describe_cluster(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_cluster(self): - cmd = """python ../../main.py kubernetes modify-cluster --cluster-id 'xxx'""" + def test_modify_node_group(self): + cmd = """python ../../main.py kubernetes modify-node-group --node-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_modify_cluster(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_cluster(self): - cmd = """python ../../main.py kubernetes delete-cluster --cluster-id 'xxx'""" + def test_delete_node_group(self): + cmd = """python ../../main.py kubernetes delete-node-group --node-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_delete_cluster(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_user_metrics(self): - cmd = """python ../../main.py kubernetes set-user-metrics --cluster-id 'xxx'""" + def test_set_node_group_size(self): + cmd = """python ../../main.py kubernetes set-node-group-size --node-group-id 'xxx' --expect-count '5'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_set_user_metrics(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_abort_upgrade(self): - cmd = """python ../../main.py kubernetes abort-upgrade --cluster-id 'xxx'""" + def test_set_auto_repair(self): + cmd = """python ../../main.py kubernetes set-auto-repair --node-group-id 'xxx' --enabled 'true'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_abort_upgrade(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_progress(self): - cmd = """python ../../main.py kubernetes describe-progress --cluster-id 'xxx'""" + def test_rollback_node_group_upgrade(self): + cmd = """python ../../main.py kubernetes rollback-node-group-upgrade --node-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_describe_progress(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_auto_upgrade(self): - cmd = """python ../../main.py kubernetes set-auto-upgrade --cluster-id 'xxx' --auto-upgrade 'true'""" + def test_set_node_group_ca(self): + cmd = """python ../../main.py kubernetes set-node-group-ca --node-group-id 'xxx' --ca-config '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_set_auto_upgrade(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_upgrade_cluster(self): - cmd = """python ../../main.py kubernetes upgrade-cluster --cluster-id 'xxx' --scope 'xxx' --version 'xxx'""" + def test_delete_node_instances(self): + cmd = """python ../../main.py kubernetes delete-node-instances --node-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_upgrade_cluster(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_addons(self): - cmd = """python ../../main.py kubernetes set-addons --cluster-id 'xxx' --addons-config '[{"":""}]'""" + def test_describe_server_config(self): + cmd = """python ../../main.py kubernetes describe-server-config """ with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_set_addons(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_node_groups(self): - cmd = """python ../../main.py kubernetes describe-node-groups """ + def test_describe_versions(self): + cmd = """python ../../main.py kubernetes describe-versions """ with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_describe_node_groups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_node_group(self): - cmd = """python ../../main.py kubernetes create-node-group --name 'xxx' --cluster-id 'xxx' --node-config '{"":""}' --initial-node-count '5' --vpc-id 'xxx'""" + def test_describe_node_version(self): + cmd = """python ../../main.py kubernetes describe-node-version --node-version 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_create_node_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_node_group(self): - cmd = """python ../../main.py kubernetes describe-node-group --node-group-id 'xxx'""" + def test_describe_upgradable_master_versions(self): + cmd = """python ../../main.py kubernetes describe-upgradable-master-versions --cluster-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_describe_node_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_node_group(self): - cmd = """python ../../main.py kubernetes modify-node-group --node-group-id 'xxx'""" + def test_describe_upgradable_node_versions(self): + cmd = """python ../../main.py kubernetes describe-upgradable-node-versions --cluster-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_modify_node_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_node_group(self): - cmd = """python ../../main.py kubernetes delete-node-group --node-group-id 'xxx'""" + def test_describe_quotas(self): + cmd = """python ../../main.py kubernetes describe-quotas """ with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_delete_node_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_node_group_size(self): - cmd = """python ../../main.py kubernetes set-node-group-size --node-group-id 'xxx' --expect-count '5'""" + def test_describe_clusters(self): + cmd = """python ../../main.py kubernetes describe-clusters """ with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_set_node_group_size(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_auto_repair(self): - cmd = """python ../../main.py kubernetes set-auto-repair --node-group-id 'xxx' --enabled 'true'""" + def test_create_cluster(self): + cmd = """python ../../main.py kubernetes create-cluster --name 'xxx' --node-group '{"":""}' --master-cidr 'xxx' --access-key 'xxx' --secret-key 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_set_auto_repair(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_rollback_node_group_upgrade(self): - cmd = """python ../../main.py kubernetes rollback-node-group-upgrade --node-group-id 'xxx'""" + def test_describe_cluster(self): + cmd = """python ../../main.py kubernetes describe-cluster --cluster-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +194,8 @@ def test_rollback_node_group_upgrade(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_node_group_ca(self): - cmd = """python ../../main.py kubernetes set-node-group-ca --node-group-id 'xxx' --ca-config '{"":""}'""" + def test_modify_cluster(self): + cmd = """python ../../main.py kubernetes modify-cluster --cluster-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +203,8 @@ def test_set_node_group_ca(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_node_instances(self): - cmd = """python ../../main.py kubernetes delete-node-instances --node-group-id 'xxx'""" + def test_delete_cluster(self): + cmd = """python ../../main.py kubernetes delete-cluster --cluster-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -212,8 +212,8 @@ def test_delete_node_instances(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_quotas(self): - cmd = """python ../../main.py kubernetes describe-quotas """ + def test_set_user_metrics(self): + cmd = """python ../../main.py kubernetes set-user-metrics --cluster-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -221,8 +221,8 @@ def test_describe_quotas(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_server_config(self): - cmd = """python ../../main.py kubernetes describe-server-config """ + def test_abort_upgrade(self): + cmd = """python ../../main.py kubernetes abort-upgrade --cluster-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -230,8 +230,8 @@ def test_describe_server_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_versions(self): - cmd = """python ../../main.py kubernetes describe-versions """ + def test_describe_progress(self): + cmd = """python ../../main.py kubernetes describe-progress --cluster-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -239,8 +239,8 @@ def test_describe_versions(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_node_version(self): - cmd = """python ../../main.py kubernetes describe-node-version --node-version 'xxx'""" + def test_set_auto_upgrade(self): + cmd = """python ../../main.py kubernetes set-auto-upgrade --cluster-id 'xxx' --auto-upgrade 'true'""" with os.popen(cmd) as f: content = f.read() @@ -248,8 +248,8 @@ def test_describe_node_version(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_upgradable_master_versions(self): - cmd = """python ../../main.py kubernetes describe-upgradable-master-versions --cluster-id 'xxx'""" + def test_upgrade_cluster(self): + cmd = """python ../../main.py kubernetes upgrade-cluster --cluster-id 'xxx' --scope 'xxx' --version 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -257,8 +257,8 @@ def test_describe_upgradable_master_versions(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_upgradable_node_versions(self): - cmd = """python ../../main.py kubernetes describe-upgradable-node-versions --cluster-id 'xxx'""" + def test_set_addons(self): + cmd = """python ../../main.py kubernetes set-addons --cluster-id 'xxx' --addons-config '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/lb_test.py b/testcases/generated/lb_test.py index 2dcc8b4..f717808 100644 --- a/testcases/generated/lb_test.py +++ b/testcases/generated/lb_test.py @@ -23,8 +23,8 @@ class LbTest(unittest.TestCase): - def test_describe_backends(self): - cmd = """python ../../main.py lb describe-backends """ + def test_describe_url_maps(self): + cmd = """python ../../main.py lb describe-url-maps """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_backends(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_backend(self): - cmd = """python ../../main.py lb create-backend --backend-name 'xxx' --load-balancer-id 'xxx' --protocol 'xxx' --port '5' --health-check-spec '{"":""}'""" + def test_create_url_map(self): + cmd = """python ../../main.py lb create-url-map --url-map-name 'xxx' --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_create_backend(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_backend(self): - cmd = """python ../../main.py lb describe-backend --backend-id 'xxx'""" + def test_describe_url_map(self): + cmd = """python ../../main.py lb describe-url-map --url-map-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_describe_backend(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_backend(self): - cmd = """python ../../main.py lb update-backend --backend-id 'xxx'""" + def test_update_url_map(self): + cmd = """python ../../main.py lb update-url-map --url-map-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_update_backend(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_backend(self): - cmd = """python ../../main.py lb delete-backend --backend-id 'xxx'""" + def test_delete_url_map(self): + cmd = """python ../../main.py lb delete-url-map --url-map-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_delete_backend(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_target_health(self): - cmd = """python ../../main.py lb describe-target-health --backend-id 'xxx'""" + def test_add_rules(self): + cmd = """python ../../main.py lb add-rules --url-map-id 'xxx' --rule-specs '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_describe_target_health(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_listeners(self): - cmd = """python ../../main.py lb describe-listeners """ + def test_update_rules(self): + cmd = """python ../../main.py lb update-rules --url-map-id 'xxx' --rule-update-specs '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_describe_listeners(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_listener(self): - cmd = """python ../../main.py lb create-listener --listener-name 'xxx' --protocol 'xxx' --port '5' --backend-id 'xxx' --load-balancer-id 'xxx'""" + def test_delete_rules(self): + cmd = """python ../../main.py lb delete-rules --url-map-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_create_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_listener(self): - cmd = """python ../../main.py lb describe-listener --listener-id 'xxx'""" + def test_describe_target_groups(self): + cmd = """python ../../main.py lb describe-target-groups """ with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_describe_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_listener(self): - cmd = """python ../../main.py lb update-listener --listener-id 'xxx'""" + def test_create_target_group(self): + cmd = """python ../../main.py lb create-target-group --target-group-name 'xxx' --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_update_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_listener(self): - cmd = """python ../../main.py lb delete-listener --listener-id 'xxx'""" + def test_describe_target_group(self): + cmd = """python ../../main.py lb describe-target-group --target-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_delete_listener(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_load_balancers(self): - cmd = """python ../../main.py lb describe-load-balancers """ + def test_update_target_group(self): + cmd = """python ../../main.py lb update-target-group --target-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_describe_load_balancers(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_load_balancer(self): - cmd = """python ../../main.py lb create-load-balancer --load-balancer-name 'xxx' --subnet-id 'xxx'""" + def test_delete_target_group(self): + cmd = """python ../../main.py lb delete-target-group --target-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_create_load_balancer(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_load_balancer(self): - cmd = """python ../../main.py lb describe-load-balancer --load-balancer-id 'xxx'""" + def test_register_targets(self): + cmd = """python ../../main.py lb register-targets --target-group-id 'xxx' --target-specs '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_describe_load_balancer(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_load_balancer(self): - cmd = """python ../../main.py lb update-load-balancer --load-balancer-id 'xxx'""" + def test_de_register_targets(self): + cmd = """python ../../main.py lb de-register-targets --target-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_update_load_balancer(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_load_balancer(self): - cmd = """python ../../main.py lb delete-load-balancer --load-balancer-id 'xxx'""" + def test_update_targets(self): + cmd = """python ../../main.py lb update-targets --target-group-id 'xxx' --target-update-specs '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_delete_load_balancer(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_associate_elastic_ip(self): - cmd = """python ../../main.py lb associate-elastic-ip --load-balancer-id 'xxx' --elastic-ip-id 'xxx'""" + def test_describe_targets(self): + cmd = """python ../../main.py lb describe-targets --target-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_associate_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disassociate_elastic_ip(self): - cmd = """python ../../main.py lb disassociate-elastic-ip --load-balancer-id 'xxx' --elastic-ip-id 'xxx'""" + def test_describe_backends(self): + cmd = """python ../../main.py lb describe-backends """ with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_disassociate_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_associate_security_group(self): - cmd = """python ../../main.py lb associate-security-group --load-balancer-id 'xxx'""" + def test_create_backend(self): + cmd = """python ../../main.py lb create-backend --backend-name 'xxx' --load-balancer-id 'xxx' --protocol 'xxx' --port '5' --health-check-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +194,8 @@ def test_associate_security_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disassociate_security_group(self): - cmd = """python ../../main.py lb disassociate-security-group --load-balancer-id 'xxx'""" + def test_describe_backend(self): + cmd = """python ../../main.py lb describe-backend --backend-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +203,8 @@ def test_disassociate_security_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_target_groups(self): - cmd = """python ../../main.py lb describe-target-groups """ + def test_update_backend(self): + cmd = """python ../../main.py lb update-backend --backend-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -212,8 +212,8 @@ def test_describe_target_groups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_target_group(self): - cmd = """python ../../main.py lb create-target-group --target-group-name 'xxx' --load-balancer-id 'xxx'""" + def test_delete_backend(self): + cmd = """python ../../main.py lb delete-backend --backend-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -221,8 +221,8 @@ def test_create_target_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_target_group(self): - cmd = """python ../../main.py lb describe-target-group --target-group-id 'xxx'""" + def test_describe_target_health(self): + cmd = """python ../../main.py lb describe-target-health --backend-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -230,8 +230,8 @@ def test_describe_target_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_target_group(self): - cmd = """python ../../main.py lb update-target-group --target-group-id 'xxx'""" + def test_describe_load_balancers(self): + cmd = """python ../../main.py lb describe-load-balancers """ with os.popen(cmd) as f: content = f.read() @@ -239,8 +239,8 @@ def test_update_target_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_target_group(self): - cmd = """python ../../main.py lb delete-target-group --target-group-id 'xxx'""" + def test_create_load_balancer(self): + cmd = """python ../../main.py lb create-load-balancer --load-balancer-name 'xxx' --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -248,8 +248,8 @@ def test_delete_target_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_register_targets(self): - cmd = """python ../../main.py lb register-targets --target-group-id 'xxx' --target-specs '[{"":""}]'""" + def test_describe_load_balancer(self): + cmd = """python ../../main.py lb describe-load-balancer --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -257,8 +257,8 @@ def test_register_targets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_de_register_targets(self): - cmd = """python ../../main.py lb de-register-targets --target-group-id 'xxx'""" + def test_update_load_balancer(self): + cmd = """python ../../main.py lb update-load-balancer --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -266,8 +266,8 @@ def test_de_register_targets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_targets(self): - cmd = """python ../../main.py lb update-targets --target-group-id 'xxx' --target-update-specs '[{"":""}]'""" + def test_delete_load_balancer(self): + cmd = """python ../../main.py lb delete-load-balancer --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -275,8 +275,8 @@ def test_update_targets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_targets(self): - cmd = """python ../../main.py lb describe-targets --target-group-id 'xxx'""" + def test_associate_elastic_ip(self): + cmd = """python ../../main.py lb associate-elastic-ip --load-balancer-id 'xxx' --elastic-ip-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -284,8 +284,8 @@ def test_describe_targets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_url_maps(self): - cmd = """python ../../main.py lb describe-url-maps """ + def test_disassociate_elastic_ip(self): + cmd = """python ../../main.py lb disassociate-elastic-ip --load-balancer-id 'xxx' --elastic-ip-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -293,8 +293,8 @@ def test_describe_url_maps(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_url_map(self): - cmd = """python ../../main.py lb create-url-map --url-map-name 'xxx' --load-balancer-id 'xxx'""" + def test_associate_security_group(self): + cmd = """python ../../main.py lb associate-security-group --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -302,8 +302,8 @@ def test_create_url_map(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_url_map(self): - cmd = """python ../../main.py lb describe-url-map --url-map-id 'xxx'""" + def test_disassociate_security_group(self): + cmd = """python ../../main.py lb disassociate-security-group --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -311,8 +311,8 @@ def test_describe_url_map(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_url_map(self): - cmd = """python ../../main.py lb update-url-map --url-map-id 'xxx'""" + def test_describe_listeners(self): + cmd = """python ../../main.py lb describe-listeners """ with os.popen(cmd) as f: content = f.read() @@ -320,8 +320,8 @@ def test_update_url_map(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_url_map(self): - cmd = """python ../../main.py lb delete-url-map --url-map-id 'xxx'""" + def test_create_listener(self): + cmd = """python ../../main.py lb create-listener --listener-name 'xxx' --protocol 'xxx' --port '5' --backend-id 'xxx' --load-balancer-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -329,8 +329,8 @@ def test_delete_url_map(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_rules(self): - cmd = """python ../../main.py lb add-rules --url-map-id 'xxx' --rule-specs '[{"":""}]'""" + def test_describe_listener(self): + cmd = """python ../../main.py lb describe-listener --listener-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -338,8 +338,8 @@ def test_add_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_rules(self): - cmd = """python ../../main.py lb update-rules --url-map-id 'xxx' --rule-update-specs '[{"":""}]'""" + def test_update_listener(self): + cmd = """python ../../main.py lb update-listener --listener-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -347,8 +347,35 @@ def test_update_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_rules(self): - cmd = """python ../../main.py lb delete-rules --url-map-id 'xxx'""" + def test_delete_listener(self): + cmd = """python ../../main.py lb delete-listener --listener-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_add_listener_certificates(self): + cmd = """python ../../main.py lb add-listener-certificates --listener-id 'xxx' --certificates '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_listener_certificates(self): + cmd = """python ../../main.py lb update-listener-certificates --listener-id 'xxx' --certificates '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_listener_certificates(self): + cmd = """python ../../main.py lb delete-listener-certificates --listener-id 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/live_test.py b/testcases/generated/live_test.py index 2d79080..eb486e8 100644 --- a/testcases/generated/live_test.py +++ b/testcases/generated/live_test.py @@ -23,8 +23,8 @@ class LiveTest(unittest.TestCase): - def test_describe_live_app(self): - cmd = """python ../../main.py live describe-live-app """ + def test_describe_publish_stream_info_data(self): + cmd = """python ../../main.py live describe-publish-stream-info-data --domain-name 'xxx' --app-name 'xxx' --stream-name 'xxx' --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_live_app(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_live_app(self): - cmd = """python ../../main.py live add-live-app --publish-domain 'xxx' --app-name 'xxx'""" + def test_describe_live_stream_history_user_num(self): + cmd = """python ../../main.py live describe-live-stream-history-user-num --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_add_live_app(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_live_app(self): - cmd = """python ../../main.py live stop-live-app --publish-domain 'xxx' --app-name 'xxx'""" + def test_describe_live_publish_stream_num(self): + cmd = """python ../../main.py live describe-live-publish-stream-num --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_stop_live_app(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_play_auth_key(self): - cmd = """python ../../main.py live describe-live-play-auth-key --play-domain 'xxx'""" + def test_describe_live_stream_player_ranking_data(self): + cmd = """python ../../main.py live describe-live-stream-player-ranking-data --domain-name 'xxx' --app-name 'xxx' --protocol-type 'xxx' --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_describe_live_play_auth_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_live_play_auth_key(self): - cmd = """python ../../main.py live set-live-play-auth-key --play-domain 'xxx'""" + def test_describe_live_transcode_stream_list(self): + cmd = """python ../../main.py live describe-live-transcode-stream-list --domain-name 'xxx' --app-name 'xxx' --stream-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_set_live_play_auth_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_restart_auth_key(self): - cmd = """python ../../main.py live describe-live-restart-auth-key --restart-domain 'xxx'""" + def test_describe_live_transcode_stream_num(self): + cmd = """python ../../main.py live describe-live-transcode-stream-num """ with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_describe_live_restart_auth_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_live_restart_auth_key(self): - cmd = """python ../../main.py live set-live-restart-auth-key --restart-domain 'xxx'""" + def test_describe_live_transcode_stream_player_user_num(self): + cmd = """python ../../main.py live describe-live-transcode-stream-player-user-num --domain-name 'xxx' --app-name 'xxx' --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,53 @@ def test_set_live_restart_auth_key(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_bill_data(self): - cmd = """python ../../main.py live describe-live-bill-data """ + def test_describe_live_transcode_stream_bandwidth(self): + cmd = """python ../../main.py live describe-live-transcode-stream-bandwidth --domain-name 'xxx' --app-name 'xxx' --start-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_domain_online_stream(self): + cmd = """python ../../main.py live describe-domain-online-stream --domain-name 'xxx' --start-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_domains_log(self): + cmd = """python ../../main.py live describe-domains-log --domains 'xxx' --start-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_url_ranking(self): + cmd = """python ../../main.py live describe-url-ranking --domain-name 'xxx' --start-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_live_stream_publish_info_by_page(self): + cmd = """python ../../main.py live describe-live-stream-publish-info-by-page --domain-name 'xxx' --start-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_live_stream_play_info_by_page(self): + cmd = """python ../../main.py live describe-live-stream-play-info-by-page --domain-name 'xxx' --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +176,8 @@ def test_set_live_restart_domain_certificate(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_domains(self): - cmd = """python ../../main.py live describe-live-domains """ + def test_add_live_stream_domain_transcode(self): + cmd = """python ../../main.py live add-live-stream-domain-transcode --publish-domain 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +185,8 @@ def test_describe_live_domains(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_live_domain(self): - cmd = """python ../../main.py live add-live-domain --publish-domain 'xxx' --play-domain 'xxx'""" + def test_add_live_stream_app_transcode(self): + cmd = """python ../../main.py live add-live-stream-app-transcode --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +194,8 @@ def test_add_live_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_live_domain(self): - cmd = """python ../../main.py live start-live-domain --publish-domain 'xxx'""" + def test_add_custom_live_stream_transcode_template(self): + cmd = """python ../../main.py live add-custom-live-stream-transcode-template --video-code-rate '5' --video-frame-rate 'xxx' --template 'xxx' --audio-codec 'xxx' --audio-sample-rate '5' --audio-channel '5' --audio-code-rate '5'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +203,8 @@ def test_start_live_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_live_domain(self): - cmd = """python ../../main.py live stop-live-domain --publish-domain 'xxx'""" + def test_describe_custom_live_stream_transcode_templates(self): + cmd = """python ../../main.py live describe-custom-live-stream-transcode-templates """ with os.popen(cmd) as f: content = f.read() @@ -167,8 +212,8 @@ def test_stop_live_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_domain_detail(self): - cmd = """python ../../main.py live describe-live-domain-detail --publish-domain 'xxx'""" + def test_describe_system_live_stream_transcode_templates(self): + cmd = """python ../../main.py live describe-system-live-stream-transcode-templates """ with os.popen(cmd) as f: content = f.read() @@ -176,8 +221,8 @@ def test_describe_live_domain_detail(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_live_domain(self): - cmd = """python ../../main.py live delete-live-domain --publish-domain 'xxx'""" + def test_describe_live_stream_transcode_config(self): + cmd = """python ../../main.py live describe-live-stream-transcode-config """ with os.popen(cmd) as f: content = f.read() @@ -185,8 +230,44 @@ def test_delete_live_domain(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_live_restart_domain(self): - cmd = """python ../../main.py live add-live-restart-domain --play-domain 'xxx' --restart-domain 'xxx'""" + def test_delete_live_stream_domain_transcode(self): + cmd = """python ../../main.py live delete-live-stream-domain-transcode --publish-domain 'xxx' --template 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_live_stream_app_transcode(self): + cmd = """python ../../main.py live delete-live-stream-app-transcode --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_custom_live_stream_transcode_template(self): + cmd = """python ../../main.py live describe-custom-live-stream-transcode-template --template 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_custom_live_stream_transcode_template(self): + cmd = """python ../../main.py live delete-custom-live-stream-transcode-template --template 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_transcode_binding(self): + cmd = """python ../../main.py live describe-transcode-binding --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -293,8 +374,8 @@ def test_describe_quality_detection_binding(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_open_live_p2p(self): - cmd = """python ../../main.py live open-live-p2p """ + def test_describe_live_play_auth_key(self): + cmd = """python ../../main.py live describe-live-play-auth-key --play-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -302,8 +383,8 @@ def test_open_live_p2p(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_close_live_p2p(self): - cmd = """python ../../main.py live close-live-p2p """ + def test_set_live_play_auth_key(self): + cmd = """python ../../main.py live set-live-play-auth-key --play-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -311,8 +392,8 @@ def test_close_live_p2p(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_p2p_configs(self): - cmd = """python ../../main.py live describe-live-p2p-configs --play-domain 'xxx'""" + def test_describe_live_restart_auth_key(self): + cmd = """python ../../main.py live describe-live-restart-auth-key --restart-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -320,8 +401,8 @@ def test_describe_live_p2p_configs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_custom_live_stream_record_templates(self): - cmd = """python ../../main.py live describe-custom-live-stream-record-templates """ + def test_set_live_restart_auth_key(self): + cmd = """python ../../main.py live set-live-restart-auth-key --restart-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -329,8 +410,8 @@ def test_describe_custom_live_stream_record_templates(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_custom_live_stream_record_template(self): - cmd = """python ../../main.py live add-custom-live-stream-record-template --record-period '5' --save-bucket 'xxx' --record-file-type 'xxx' --template 'xxx'""" + def test_add_custom_live_stream_watermark_template(self): + cmd = """python ../../main.py live add-custom-live-stream-watermark-template --offset-x '5' --offset-y '5' --width '5' --height '5' --template 'xxx' --url 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -338,8 +419,8 @@ def test_add_custom_live_stream_record_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_live_stream_app_record(self): - cmd = """python ../../main.py live add-live-stream-app-record --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" + def test_describe_custom_live_stream_watermark_templates(self): + cmd = """python ../../main.py live describe-custom-live-stream-watermark-templates """ with os.popen(cmd) as f: content = f.read() @@ -347,8 +428,8 @@ def test_add_live_stream_app_record(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_live_stream_domain_record(self): - cmd = """python ../../main.py live add-live-stream-domain-record --publish-domain 'xxx' --template 'xxx'""" + def test_add_live_stream_app_watermark(self): + cmd = """python ../../main.py live add-live-stream-app-watermark --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -356,8 +437,8 @@ def test_add_live_stream_domain_record(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_custom_live_stream_record_config(self): - cmd = """python ../../main.py live describe-custom-live-stream-record-config """ + def test_add_live_stream_domain_watermark(self): + cmd = """python ../../main.py live add-live-stream-domain-watermark --publish-domain 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -365,8 +446,8 @@ def test_describe_custom_live_stream_record_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_live_stream_record_notify_config(self): - cmd = """python ../../main.py live set-live-stream-record-notify-config --publish-domain 'xxx' --notify-url 'xxx'""" + def test_describe_custom_live_stream_watermark_config(self): + cmd = """python ../../main.py live describe-custom-live-stream-watermark-config """ with os.popen(cmd) as f: content = f.read() @@ -374,8 +455,8 @@ def test_set_live_stream_record_notify_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_custom_live_stream_record_template(self): - cmd = """python ../../main.py live delete-custom-live-stream-record-template --template 'xxx'""" + def test_delete_custom_live_stream_watermark_template(self): + cmd = """python ../../main.py live delete-custom-live-stream-watermark-template --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -383,8 +464,8 @@ def test_delete_custom_live_stream_record_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_live_stream_app_record(self): - cmd = """python ../../main.py live delete-live-stream-app-record --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" + def test_delete_live_stream_app_watermark(self): + cmd = """python ../../main.py live delete-live-stream-app-watermark --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -392,8 +473,8 @@ def test_delete_live_stream_app_record(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_live_stream_domain_record(self): - cmd = """python ../../main.py live delete-live-stream-domain-record --publish-domain 'xxx' --template 'xxx'""" + def test_delete_live_stream_domain_watermark(self): + cmd = """python ../../main.py live delete-live-stream-domain-watermark --publish-domain 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -401,8 +482,8 @@ def test_delete_live_stream_domain_record(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_stream_record_notify_config(self): - cmd = """python ../../main.py live describe-live-stream-record-notify-config --publish-domain 'xxx'""" + def test_describe_watermark_binding(self): + cmd = """python ../../main.py live describe-watermark-binding --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -410,8 +491,8 @@ def test_describe_live_stream_record_notify_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_live_stream_record_notify_config(self): - cmd = """python ../../main.py live delete-live-stream-record-notify-config --publish-domain 'xxx'""" + def test_create_live_forward_task(self): + cmd = """python ../../main.py live create-live-forward-task --source-url 'xxx' --push-url 'xxx' --start-mode 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -419,8 +500,8 @@ def test_delete_live_stream_record_notify_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_live_record_task(self): - cmd = """python ../../main.py live add-live-record-task --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx' --record-times '[{"":""}]' --save-bucket 'xxx' --save-endpoint 'xxx' --record-file-type 'xxx'""" + def test_update_live_forward_task(self): + cmd = """python ../../main.py live update-live-forward-task --task-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -428,8 +509,8 @@ def test_add_live_record_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_record_binding(self): - cmd = """python ../../main.py live describe-record-binding --template 'xxx'""" + def test_query_live_forward_task(self): + cmd = """python ../../main.py live query-live-forward-task """ with os.popen(cmd) as f: content = f.read() @@ -437,8 +518,8 @@ def test_describe_record_binding(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_statistic_group_by_stream(self): - cmd = """python ../../main.py live describe-live-statistic-group-by-stream --start-time 'xxx'""" + def test_start_live_forward_task(self): + cmd = """python ../../main.py live start-live-forward-task --task-ids 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -446,8 +527,8 @@ def test_describe_live_statistic_group_by_stream(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_statistic_group_by_area(self): - cmd = """python ../../main.py live describe-live-statistic-group-by-area --domain-name 'xxx' --app-name 'xxx' --stream-name 'xxx' --start-time 'xxx'""" + def test_stop_live_forward_task(self): + cmd = """python ../../main.py live stop-live-forward-task --task-ids 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -455,8 +536,8 @@ def test_describe_live_statistic_group_by_area(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_statistic_group_by_area_isp(self): - cmd = """python ../../main.py live describe-live-statistic-group-by-area-isp --domain-name 'xxx' --app-name 'xxx' --stream-name 'xxx' --start-time 'xxx'""" + def test_delete_live_forward_task(self): + cmd = """python ../../main.py live delete-live-forward-task --task-ids 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -464,8 +545,8 @@ def test_describe_live_statistic_group_by_area_isp(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_publish_stream_info_data(self): - cmd = """python ../../main.py live describe-publish-stream-info-data --domain-name 'xxx' --app-name 'xxx' --stream-name 'xxx' --start-time 'xxx'""" + def test_delete_live_recordings(self): + cmd = """python ../../main.py live delete-live-recordings --file-url 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -473,8 +554,8 @@ def test_describe_publish_stream_info_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_stream_history_user_num(self): - cmd = """python ../../main.py live describe-live-stream-history-user-num --start-time 'xxx'""" + def test_add_live_stream_domain_translate(self): + cmd = """python ../../main.py live add-live-stream-domain-translate --publish-domain 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -482,8 +563,8 @@ def test_describe_live_stream_history_user_num(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_publish_stream_num(self): - cmd = """python ../../main.py live describe-live-publish-stream-num --start-time 'xxx'""" + def test_add_live_stream_app_translate(self): + cmd = """python ../../main.py live add-live-stream-app-translate --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -491,8 +572,8 @@ def test_describe_live_publish_stream_num(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_stream_player_ranking_data(self): - cmd = """python ../../main.py live describe-live-stream-player-ranking-data --domain-name 'xxx' --app-name 'xxx' --protocol-type 'xxx' --start-time 'xxx'""" + def test_add_live_stream_translate(self): + cmd = """python ../../main.py live add-live-stream-translate --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -500,8 +581,8 @@ def test_describe_live_stream_player_ranking_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_transcode_stream_list(self): - cmd = """python ../../main.py live describe-live-transcode-stream-list --domain-name 'xxx' --app-name 'xxx' --stream-name 'xxx'""" + def test_describe_system_live_stream_translate_templates(self): + cmd = """python ../../main.py live describe-system-live-stream-translate-templates """ with os.popen(cmd) as f: content = f.read() @@ -509,8 +590,8 @@ def test_describe_live_transcode_stream_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_transcode_stream_num(self): - cmd = """python ../../main.py live describe-live-transcode-stream-num """ + def test_describe_live_stream_translate_config(self): + cmd = """python ../../main.py live describe-live-stream-translate-config """ with os.popen(cmd) as f: content = f.read() @@ -518,8 +599,8 @@ def test_describe_live_transcode_stream_num(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_transcode_stream_player_user_num(self): - cmd = """python ../../main.py live describe-live-transcode-stream-player-user-num --domain-name 'xxx' --app-name 'xxx' --start-time 'xxx'""" + def test_describe_live_domain_translate_config(self): + cmd = """python ../../main.py live describe-live-domain-translate-config """ with os.popen(cmd) as f: content = f.read() @@ -527,8 +608,8 @@ def test_describe_live_transcode_stream_player_user_num(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_transcode_stream_bandwidth(self): - cmd = """python ../../main.py live describe-live-transcode-stream-bandwidth --domain-name 'xxx' --app-name 'xxx' --start-time 'xxx'""" + def test_delete_live_stream_domain_translate(self): + cmd = """python ../../main.py live delete-live-stream-domain-translate --publish-domain 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -536,8 +617,8 @@ def test_describe_live_transcode_stream_bandwidth(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_domain_online_stream(self): - cmd = """python ../../main.py live describe-domain-online-stream --domain-name 'xxx' --start-time 'xxx'""" + def test_delete_live_stream_app_translate(self): + cmd = """python ../../main.py live delete-live-stream-app-translate --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -545,8 +626,8 @@ def test_describe_domain_online_stream(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_domains_log(self): - cmd = """python ../../main.py live describe-domains-log --domains 'xxx' --start-time 'xxx'""" + def test_delete_live_stream_translate(self): + cmd = """python ../../main.py live delete-live-stream-translate --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -554,8 +635,8 @@ def test_describe_domains_log(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_url_ranking(self): - cmd = """python ../../main.py live describe-url-ranking --domain-name 'xxx' --start-time 'xxx'""" + def test_describe_translate_binding(self): + cmd = """python ../../main.py live describe-translate-binding --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -563,8 +644,8 @@ def test_describe_url_ranking(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_transcoding_duration_data(self): - cmd = """python ../../main.py live describe-live-transcoding-duration-data --start-time 'xxx'""" + def test_pause_live_stream_translate(self): + cmd = """python ../../main.py live pause-live-stream-translate --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -572,8 +653,8 @@ def test_describe_live_transcoding_duration_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_file_storage_data(self): - cmd = """python ../../main.py live describe-live-file-storage-data --start-time 'xxx'""" + def test_resume_live_stream_translate(self): + cmd = """python ../../main.py live resume-live-stream-translate --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -581,8 +662,8 @@ def test_describe_live_file_storage_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_stream_bandwidth_data(self): - cmd = """python ../../main.py live describe-live-stream-bandwidth-data --start-time 'xxx'""" + def test_forbid_live_stream(self): + cmd = """python ../../main.py live forbid-live-stream --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -590,8 +671,8 @@ def test_describe_live_stream_bandwidth_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_stream_publish_bandwidth_data(self): - cmd = """python ../../main.py live describe-live-stream-publish-bandwidth-data --start-time 'xxx'""" + def test_resume_live_stream(self): + cmd = """python ../../main.py live resume-live-stream --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -599,8 +680,8 @@ def test_describe_live_stream_publish_bandwidth_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_stream_traffic_data(self): - cmd = """python ../../main.py live describe-live-stream-traffic-data --start-time 'xxx'""" + def test_interrupt_live_stream(self): + cmd = """python ../../main.py live interrupt-live-stream --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -608,8 +689,8 @@ def test_describe_live_stream_traffic_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_stream_publish_traffic_data(self): - cmd = """python ../../main.py live describe-live-stream-publish-traffic-data --start-time 'xxx'""" + def test_describe_live_stream_info(self): + cmd = """python ../../main.py live describe-live-stream-info --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -617,8 +698,8 @@ def test_describe_live_stream_publish_traffic_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_snapshot_data(self): - cmd = """python ../../main.py live describe-live-snapshot-data --start-time 'xxx'""" + def test_set_live_stream_notify_config(self): + cmd = """python ../../main.py live set-live-stream-notify-config --publish-domain 'xxx' --notify-url 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -626,8 +707,98 @@ def test_describe_live_snapshot_data(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_porn_data(self): - cmd = """python ../../main.py live describe-live-porn-data --start-time 'xxx'""" + def test_describe_live_stream_notify_config(self): + cmd = """python ../../main.py live describe-live-stream-notify-config --publish-domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_live_stream_notify_config(self): + cmd = """python ../../main.py live delete-live-stream-notify-config --publish-domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_live_stream_online_list(self): + cmd = """python ../../main.py live describe-live-stream-online-list --publish-domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_live_stream_publish_list(self): + cmd = """python ../../main.py live describe-live-stream-publish-list --publish-domain 'xxx' --start-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_live_bill_data(self): + cmd = """python ../../main.py live describe-live-bill-data """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_open_live_restart(self): + cmd = """python ../../main.py live open-live-restart --restart-domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_close_live_restart(self): + cmd = """python ../../main.py live close-live-restart --restart-domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_live_restart_configs(self): + cmd = """python ../../main.py live describe-live-restart-configs --restart-domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_open_live_p2p(self): + cmd = """python ../../main.py live open-live-p2p """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_close_live_p2p(self): + cmd = """python ../../main.py live close-live-p2p """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_live_p2p_configs(self): + cmd = """python ../../main.py live describe-live-p2p-configs --play-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -743,8 +914,8 @@ def test_describe_snapshot_binding(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_forbid_live_stream(self): - cmd = """python ../../main.py live forbid-live-stream --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx'""" + def test_describe_live_domains(self): + cmd = """python ../../main.py live describe-live-domains """ with os.popen(cmd) as f: content = f.read() @@ -752,8 +923,8 @@ def test_forbid_live_stream(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_resume_live_stream(self): - cmd = """python ../../main.py live resume-live-stream --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx'""" + def test_add_live_domain(self): + cmd = """python ../../main.py live add-live-domain --publish-domain 'xxx' --play-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -761,8 +932,8 @@ def test_resume_live_stream(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_interrupt_live_stream(self): - cmd = """python ../../main.py live interrupt-live-stream --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx'""" + def test_start_live_domain(self): + cmd = """python ../../main.py live start-live-domain --publish-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -770,8 +941,8 @@ def test_interrupt_live_stream(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_stream_info(self): - cmd = """python ../../main.py live describe-live-stream-info --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx'""" + def test_stop_live_domain(self): + cmd = """python ../../main.py live stop-live-domain --publish-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -779,8 +950,8 @@ def test_describe_live_stream_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_set_live_stream_notify_config(self): - cmd = """python ../../main.py live set-live-stream-notify-config --publish-domain 'xxx' --notify-url 'xxx'""" + def test_describe_live_domain_detail(self): + cmd = """python ../../main.py live describe-live-domain-detail --publish-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -788,8 +959,8 @@ def test_set_live_stream_notify_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_stream_notify_config(self): - cmd = """python ../../main.py live describe-live-stream-notify-config --publish-domain 'xxx'""" + def test_delete_live_domain(self): + cmd = """python ../../main.py live delete-live-domain --publish-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -797,8 +968,8 @@ def test_describe_live_stream_notify_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_live_stream_notify_config(self): - cmd = """python ../../main.py live delete-live-stream-notify-config --publish-domain 'xxx'""" + def test_add_live_restart_domain(self): + cmd = """python ../../main.py live add-live-restart-domain --play-domain 'xxx' --restart-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -806,8 +977,8 @@ def test_delete_live_stream_notify_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_stream_online_list(self): - cmd = """python ../../main.py live describe-live-stream-online-list --publish-domain 'xxx'""" + def test_describe_custom_live_stream_record_templates(self): + cmd = """python ../../main.py live describe-custom-live-stream-record-templates """ with os.popen(cmd) as f: content = f.read() @@ -815,8 +986,8 @@ def test_describe_live_stream_online_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_stream_publish_list(self): - cmd = """python ../../main.py live describe-live-stream-publish-list --publish-domain 'xxx' --start-time 'xxx'""" + def test_add_custom_live_stream_record_template(self): + cmd = """python ../../main.py live add-custom-live-stream-record-template --record-period '5' --save-bucket 'xxx' --record-file-type 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -824,8 +995,8 @@ def test_describe_live_stream_publish_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_open_live_restart(self): - cmd = """python ../../main.py live open-live-restart --restart-domain 'xxx'""" + def test_add_live_stream_app_record(self): + cmd = """python ../../main.py live add-live-stream-app-record --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -833,8 +1004,8 @@ def test_open_live_restart(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_close_live_restart(self): - cmd = """python ../../main.py live close-live-restart --restart-domain 'xxx'""" + def test_add_live_stream_domain_record(self): + cmd = """python ../../main.py live add-live-stream-domain-record --publish-domain 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -842,8 +1013,8 @@ def test_close_live_restart(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_restart_configs(self): - cmd = """python ../../main.py live describe-live-restart-configs --restart-domain 'xxx'""" + def test_describe_custom_live_stream_record_config(self): + cmd = """python ../../main.py live describe-custom-live-stream-record-config """ with os.popen(cmd) as f: content = f.read() @@ -851,8 +1022,8 @@ def test_describe_live_restart_configs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_open_live_timeshift(self): - cmd = """python ../../main.py live open-live-timeshift --play-domain 'xxx'""" + def test_set_live_stream_record_notify_config(self): + cmd = """python ../../main.py live set-live-stream-record-notify-config --publish-domain 'xxx' --notify-url 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -860,8 +1031,8 @@ def test_open_live_timeshift(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_close_live_timeshift(self): - cmd = """python ../../main.py live close-live-timeshift --play-domain 'xxx'""" + def test_delete_custom_live_stream_record_template(self): + cmd = """python ../../main.py live delete-custom-live-stream-record-template --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -869,8 +1040,8 @@ def test_close_live_timeshift(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_timeshift_configs(self): - cmd = """python ../../main.py live describe-live-timeshift-configs --play-domain 'xxx'""" + def test_delete_live_stream_app_record(self): + cmd = """python ../../main.py live delete-live-stream-app-record --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -878,8 +1049,8 @@ def test_describe_live_timeshift_configs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_live_stream_domain_transcode(self): - cmd = """python ../../main.py live add-live-stream-domain-transcode --publish-domain 'xxx' --template 'xxx'""" + def test_delete_live_stream_domain_record(self): + cmd = """python ../../main.py live delete-live-stream-domain-record --publish-domain 'xxx' --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -887,8 +1058,8 @@ def test_add_live_stream_domain_transcode(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_live_stream_app_transcode(self): - cmd = """python ../../main.py live add-live-stream-app-transcode --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" + def test_describe_live_stream_record_notify_config(self): + cmd = """python ../../main.py live describe-live-stream-record-notify-config --publish-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -896,8 +1067,8 @@ def test_add_live_stream_app_transcode(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_custom_live_stream_transcode_template(self): - cmd = """python ../../main.py live add-custom-live-stream-transcode-template --video-code-rate '5' --video-frame-rate 'xxx' --template 'xxx' --audio-codec 'xxx' --audio-sample-rate '5' --audio-channel '5' --audio-code-rate '5'""" + def test_delete_live_stream_record_notify_config(self): + cmd = """python ../../main.py live delete-live-stream-record-notify-config --publish-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -905,8 +1076,8 @@ def test_add_custom_live_stream_transcode_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_custom_live_stream_transcode_templates(self): - cmd = """python ../../main.py live describe-custom-live-stream-transcode-templates """ + def test_add_live_record_task(self): + cmd = """python ../../main.py live add-live-record-task --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx' --record-times '[{"":""}]' --save-bucket 'xxx' --save-endpoint 'xxx' --record-file-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -914,8 +1085,8 @@ def test_describe_custom_live_stream_transcode_templates(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_system_live_stream_transcode_templates(self): - cmd = """python ../../main.py live describe-system-live-stream-transcode-templates """ + def test_describe_record_binding(self): + cmd = """python ../../main.py live describe-record-binding --template 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -923,8 +1094,8 @@ def test_describe_system_live_stream_transcode_templates(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_live_stream_transcode_config(self): - cmd = """python ../../main.py live describe-live-stream-transcode-config """ + def test_describe_live_app(self): + cmd = """python ../../main.py live describe-live-app """ with os.popen(cmd) as f: content = f.read() @@ -932,8 +1103,8 @@ def test_describe_live_stream_transcode_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_live_stream_domain_transcode(self): - cmd = """python ../../main.py live delete-live-stream-domain-transcode --publish-domain 'xxx' --template 'xxx'""" + def test_add_live_app(self): + cmd = """python ../../main.py live add-live-app --publish-domain 'xxx' --app-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -941,8 +1112,8 @@ def test_delete_live_stream_domain_transcode(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_live_stream_app_transcode(self): - cmd = """python ../../main.py live delete-live-stream-app-transcode --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" + def test_stop_live_app(self): + cmd = """python ../../main.py live stop-live-app --publish-domain 'xxx' --app-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -950,8 +1121,8 @@ def test_delete_live_stream_app_transcode(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_custom_live_stream_transcode_template(self): - cmd = """python ../../main.py live describe-custom-live-stream-transcode-template --template 'xxx'""" + def test_describe_live_transcoding_duration_data(self): + cmd = """python ../../main.py live describe-live-transcoding-duration-data --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -959,8 +1130,8 @@ def test_describe_custom_live_stream_transcode_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_custom_live_stream_transcode_template(self): - cmd = """python ../../main.py live delete-custom-live-stream-transcode-template --template 'xxx'""" + def test_describe_live_file_storage_data(self): + cmd = """python ../../main.py live describe-live-file-storage-data --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -968,8 +1139,8 @@ def test_delete_custom_live_stream_transcode_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_transcode_binding(self): - cmd = """python ../../main.py live describe-transcode-binding --template 'xxx'""" + def test_describe_live_stream_bandwidth_data(self): + cmd = """python ../../main.py live describe-live-stream-bandwidth-data --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -977,8 +1148,8 @@ def test_describe_transcode_binding(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_custom_live_stream_watermark_template(self): - cmd = """python ../../main.py live add-custom-live-stream-watermark-template --offset-x '5' --offset-y '5' --width '5' --height '5' --template 'xxx' --url 'xxx'""" + def test_describe_live_stream_publish_bandwidth_data(self): + cmd = """python ../../main.py live describe-live-stream-publish-bandwidth-data --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -986,8 +1157,8 @@ def test_add_custom_live_stream_watermark_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_custom_live_stream_watermark_templates(self): - cmd = """python ../../main.py live describe-custom-live-stream-watermark-templates """ + def test_describe_live_stream_traffic_data(self): + cmd = """python ../../main.py live describe-live-stream-traffic-data --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -995,8 +1166,8 @@ def test_describe_custom_live_stream_watermark_templates(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_live_stream_app_watermark(self): - cmd = """python ../../main.py live add-live-stream-app-watermark --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" + def test_describe_live_stream_publish_traffic_data(self): + cmd = """python ../../main.py live describe-live-stream-publish-traffic-data --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1004,8 +1175,8 @@ def test_add_live_stream_app_watermark(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_live_stream_domain_watermark(self): - cmd = """python ../../main.py live add-live-stream-domain-watermark --publish-domain 'xxx' --template 'xxx'""" + def test_describe_live_snapshot_data(self): + cmd = """python ../../main.py live describe-live-snapshot-data --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1013,8 +1184,8 @@ def test_add_live_stream_domain_watermark(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_custom_live_stream_watermark_config(self): - cmd = """python ../../main.py live describe-custom-live-stream-watermark-config """ + def test_describe_live_porn_data(self): + cmd = """python ../../main.py live describe-live-porn-data --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1022,8 +1193,8 @@ def test_describe_custom_live_stream_watermark_config(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_custom_live_stream_watermark_template(self): - cmd = """python ../../main.py live delete-custom-live-stream-watermark-template --template 'xxx'""" + def test_describe_live_statistic_group_by_stream(self): + cmd = """python ../../main.py live describe-live-statistic-group-by-stream --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1031,8 +1202,8 @@ def test_delete_custom_live_stream_watermark_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_live_stream_app_watermark(self): - cmd = """python ../../main.py live delete-live-stream-app-watermark --publish-domain 'xxx' --app-name 'xxx' --template 'xxx'""" + def test_describe_live_statistic_group_by_area(self): + cmd = """python ../../main.py live describe-live-statistic-group-by-area --domain-name 'xxx' --app-name 'xxx' --stream-name 'xxx' --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1040,8 +1211,8 @@ def test_delete_live_stream_app_watermark(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_live_stream_domain_watermark(self): - cmd = """python ../../main.py live delete-live-stream-domain-watermark --publish-domain 'xxx' --template 'xxx'""" + def test_describe_live_statistic_group_by_area_isp(self): + cmd = """python ../../main.py live describe-live-statistic-group-by-area-isp --domain-name 'xxx' --start-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -1049,8 +1220,35 @@ def test_delete_live_stream_domain_watermark(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_watermark_binding(self): - cmd = """python ../../main.py live describe-watermark-binding --template 'xxx'""" + def test_describe_live_publish_statistic_group_by_stream(self): + cmd = """python ../../main.py live describe-live-publish-statistic-group-by-stream --start-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_open_live_timeshift(self): + cmd = """python ../../main.py live open-live-timeshift --play-domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_close_live_timeshift(self): + cmd = """python ../../main.py live close-live-timeshift --play-domain 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_live_timeshift_configs(self): + cmd = """python ../../main.py live describe-live-timeshift-configs --play-domain 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/logs_test.py b/testcases/generated/logs_test.py index e3ba500..a9b5e5e 100644 --- a/testcases/generated/logs_test.py +++ b/testcases/generated/logs_test.py @@ -60,7 +60,7 @@ def test_update_collect_resources(self): self.assertIsInstance(result, dict) def test_create_collect_info(self): - cmd = """python ../../main.py logs create-collect-info --logtopic-uid 'xxx' --enabled 'true' --app-code 'xxx' --service-code 'xxx' --resource-type 'xxx'""" + cmd = """python ../../main.py logs create-collect-info --logtopic-uid 'xxx' --app-code 'xxx' --enabled 'true' --resource-type 'xxx' --service-code 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_create_collect_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_logd_ca(self): - cmd = """python ../../main.py logs describe-logd-ca --instance-id 'xxx'""" + def test_create_parser(self): + cmd = """python ../../main.py logs create-parser --logtopic-uid 'xxx' --parser-fields '[{"":""}]' --parser-mode 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_describe_logd_ca(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instance_collect_confs(self): - cmd = """python ../../main.py logs describe-instance-collect-confs --instance-id 'xxx'""" + def test_describe_parser(self): + cmd = """python ../../main.py logs describe-parser --logtopic-uid 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_describe_instance_collect_confs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_logsets(self): - cmd = """python ../../main.py logs describe-logsets """ + def test_update_parser(self): + cmd = """python ../../main.py logs update-parser --logtopic-uid 'xxx' --parser-fields '[{"":""}]' --parser-mode 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_describe_logsets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_logset(self): - cmd = """python ../../main.py logs create-logset --name 'xxx' --life-cycle '5'""" + def test_validate_parser(self): + cmd = """python ../../main.py logs validate-parser --parser-mode 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_create_logset(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_logset(self): - cmd = """python ../../main.py logs describe-logset --logset-uid 'xxx'""" + def test_histograms(self): + cmd = """python ../../main.py logs histograms --logset-uid 'xxx' --logtopic-uid 'xxx' --action 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_describe_logset(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_logset(self): - cmd = """python ../../main.py logs update-logset --logset-uid 'xxx'""" + def test_get_logs(self): + cmd = """python ../../main.py logs get-logs --logset-uid 'xxx' --logtopic-uid 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_update_logset(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_logset(self): - cmd = """python ../../main.py logs delete-logset --logset-uids 'xxx'""" + def test_search(self): + cmd = """python ../../main.py logs search --logset-uid 'xxx' --logtopic-uid 'xxx' --action 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_update_logtopic(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_put(self): - cmd = """python ../../main.py logs put --logtopic-uid 'xxx' --entries '[{"":""}]'""" + def test_test_metric_task(self): + cmd = """python ../../main.py logs test-metric-task --logset-uid 'xxx' --logtopic-uid 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_put(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_search_log_context(self): - cmd = """python ../../main.py logs search-log-context --logset-uid 'xxx' --logtopic-uid 'xxx' --anchor '[{"":""}]' --id 'xxx' --line-size '5' --time '5'""" + def test_describe_metric_tasks(self): + cmd = """python ../../main.py logs describe-metric-tasks --logset-uid 'xxx' --logtopic-uid 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +194,116 @@ def test_search_log_context(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_search(self): - cmd = """python ../../main.py logs search --logset-uid 'xxx' --logtopic-uid 'xxx' --action 'xxx'""" + def test_create_metric_task(self): + cmd = """python ../../main.py logs create-metric-task --logset-uid 'xxx' --logtopic-uid 'xxx' --custom-unit 'xxx' --interval '5' --name 'xxx' --unit 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_metric_task(self): + cmd = """python ../../main.py logs describe-metric-task --logset-uid 'xxx' --logtopic-uid 'xxx' --logmetrictask-uid 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_metric_task(self): + cmd = """python ../../main.py logs update-metric-task --logset-uid 'xxx' --logtopic-uid 'xxx' --logmetrictask-uid 'xxx' --custom-unit 'xxx' --name 'xxx' --unit 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_metric_task(self): + cmd = """python ../../main.py logs delete-metric-task --logset-uid 'xxx' --logtopic-uid 'xxx' --logmetrictask-uid 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_parser(self): + cmd = """python ../../main.py logs create-parser --logtopic-uid 'xxx' --parser-fields '[{"":""}]' --parser-mode 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_subscribe(self): + cmd = """python ../../main.py logs describe-subscribe --logset-uid 'xxx' --logtopic-uid 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_subscribe(self): + cmd = """python ../../main.py logs create-subscribe --logset-uid 'xxx' --logtopic-uid 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_subscribe(self): + cmd = """python ../../main.py logs update-subscribe --logset-uid 'xxx' --logtopic-uid 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_logsets(self): + cmd = """python ../../main.py logs describe-logsets """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_logset(self): + cmd = """python ../../main.py logs create-logset --name 'xxx' --life-cycle '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_logset(self): + cmd = """python ../../main.py logs describe-logset --logset-uid 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_logset(self): + cmd = """python ../../main.py logs update-logset --logset-uid 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_logset(self): + cmd = """python ../../main.py logs delete-logset --logset-uids 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/mongodb_test.py b/testcases/generated/mongodb_test.py index 4cee109..bf0709e 100644 --- a/testcases/generated/mongodb_test.py +++ b/testcases/generated/mongodb_test.py @@ -23,8 +23,8 @@ class MongodbTest(unittest.TestCase): - def test_describe_instances(self): - cmd = """python ../../main.py mongodb describe-instances """ + def test_describe_security_ips(self): + cmd = """python ../../main.py mongodb describe-security-ips --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_instances(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_instance(self): - cmd = """python ../../main.py mongodb create-instance --instance-spec '{"":""}'""" + def test_modify_security_ips(self): + cmd = """python ../../main.py mongodb modify-security-ips --instance-id 'xxx' --modify-mode 'xxx' --security-ips 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_create_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_instance(self): - cmd = """python ../../main.py mongodb delete-instance --instance-id 'xxx'""" + def test_describe_backups(self): + cmd = """python ../../main.py mongodb describe-backups """ with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_delete_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_reset_password(self): - cmd = """python ../../main.py mongodb reset-password --instance-id 'xxx' --account-password 'xxx'""" + def test_create_backup(self): + cmd = """python ../../main.py mongodb create-backup --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_reset_password(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_instance_spec(self): - cmd = """python ../../main.py mongodb modify-instance-spec --instance-id 'xxx' --instance-class 'xxx' --instance-storage-gb '5'""" + def test_delete_backup(self): + cmd = """python ../../main.py mongodb delete-backup --backup-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_modify_instance_spec(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_instance_name(self): - cmd = """python ../../main.py mongodb modify-instance-name --instance-id 'xxx' --instance-name 'xxx'""" + def test_backup_download_url(self): + cmd = """python ../../main.py mongodb backup-download-url --backup-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_modify_instance_name(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_backup_policy(self): - cmd = """python ../../main.py mongodb describe-backup-policy --instance-id 'xxx'""" + def test_describe_instances(self): + cmd = """python ../../main.py mongodb describe-instances """ with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_describe_backup_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_backup_policy(self): - cmd = """python ../../main.py mongodb modify-backup-policy --instance-id 'xxx' --preferred-backup-time 'xxx'""" + def test_create_instance(self): + cmd = """python ../../main.py mongodb create-instance --instance-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_modify_backup_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_restore_instance(self): - cmd = """python ../../main.py mongodb restore-instance --instance-id 'xxx' --backup-id 'xxx'""" + def test_delete_instance(self): + cmd = """python ../../main.py mongodb delete-instance --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_restore_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_flavors(self): - cmd = """python ../../main.py mongodb describe-flavors """ + def test_reset_password(self): + cmd = """python ../../main.py mongodb reset-password --instance-id 'xxx' --account-password 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_describe_flavors(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_available_zones(self): - cmd = """python ../../main.py mongodb describe-available-zones """ + def test_modify_instance_spec(self): + cmd = """python ../../main.py mongodb modify-instance-spec --instance-id 'xxx' --instance-class 'xxx' --instance-storage-gb '5'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_describe_available_zones(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_restart_instance(self): - cmd = """python ../../main.py mongodb restart-instance --instance-id 'xxx'""" + def test_modify_instance_name(self): + cmd = """python ../../main.py mongodb modify-instance-name --instance-id 'xxx' --instance-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_restart_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_sharding_instance(self): - cmd = """python ../../main.py mongodb create-sharding-instance --sharding-instance-spec '{"":""}'""" + def test_describe_backup_policy(self): + cmd = """python ../../main.py mongodb describe-backup-policy --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_create_sharding_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_node_spec(self): - cmd = """python ../../main.py mongodb modify-node-spec --instance-id 'xxx' --node-id 'xxx' --node-type 'xxx'""" + def test_modify_backup_policy(self): + cmd = """python ../../main.py mongodb modify-backup-policy --instance-id 'xxx' --preferred-backup-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_modify_node_spec(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_restart_node(self): - cmd = """python ../../main.py mongodb restart-node --instance-id 'xxx' --node-id 'xxx'""" + def test_restore_instance(self): + cmd = """python ../../main.py mongodb restore-instance --instance-id 'xxx' --backup-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_restart_node(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_backups(self): - cmd = """python ../../main.py mongodb describe-backups """ + def test_describe_flavors(self): + cmd = """python ../../main.py mongodb describe-flavors """ with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_describe_backups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_backup(self): - cmd = """python ../../main.py mongodb create-backup --instance-id 'xxx'""" + def test_describe_available_zones(self): + cmd = """python ../../main.py mongodb describe-available-zones """ with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_create_backup(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_backup(self): - cmd = """python ../../main.py mongodb delete-backup --backup-id 'xxx'""" + def test_restart_instance(self): + cmd = """python ../../main.py mongodb restart-instance --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_delete_backup(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_backup_download_url(self): - cmd = """python ../../main.py mongodb backup-download-url --backup-id 'xxx'""" + def test_create_sharding_instance(self): + cmd = """python ../../main.py mongodb create-sharding-instance --sharding-instance-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +194,8 @@ def test_backup_download_url(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_backup_synchronicities(self): - cmd = """python ../../main.py mongodb describe-backup-synchronicities """ + def test_modify_node_spec(self): + cmd = """python ../../main.py mongodb modify-node-spec --instance-id 'xxx' --node-id 'xxx' --node-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +203,8 @@ def test_describe_backup_synchronicities(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_backup_synchronicity(self): - cmd = """python ../../main.py mongodb create-backup-synchronicity --instance-id 'xxx' --src-region 'xxx' --dst-region 'xxx'""" + def test_restart_node(self): + cmd = """python ../../main.py mongodb restart-node --instance-id 'xxx' --node-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -212,8 +212,8 @@ def test_create_backup_synchronicity(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_backup_synchronicities(self): - cmd = """python ../../main.py mongodb delete-backup-synchronicities --service-id 'xxx'""" + def test_describe_backup_synchronicities(self): + cmd = """python ../../main.py mongodb describe-backup-synchronicities """ with os.popen(cmd) as f: content = f.read() @@ -221,8 +221,8 @@ def test_delete_backup_synchronicities(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_security_ips(self): - cmd = """python ../../main.py mongodb describe-security-ips --instance-id 'xxx'""" + def test_create_backup_synchronicity(self): + cmd = """python ../../main.py mongodb create-backup-synchronicity --instance-id 'xxx' --src-region 'xxx' --dst-region 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -230,8 +230,8 @@ def test_describe_security_ips(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_security_ips(self): - cmd = """python ../../main.py mongodb modify-security-ips --instance-id 'xxx' --modify-mode 'xxx' --security-ips 'xxx'""" + def test_delete_backup_synchronicities(self): + cmd = """python ../../main.py mongodb delete-backup-synchronicities --service-id 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/monitor_test.py b/testcases/generated/monitor_test.py index 699b2a9..b3b51ce 100644 --- a/testcases/generated/monitor_test.py +++ b/testcases/generated/monitor_test.py @@ -122,8 +122,8 @@ def test_describe_metrics(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_one_data_point(self): - cmd = """python ../../main.py monitor describe-one-data-point --metric 'xxx' --service-code 'xxx' --resource-id 'xxx'""" + def test_last_downsample(self): + cmd = """python ../../main.py monitor last-downsample --metric 'xxx' --service-code 'xxx' --resource-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,6 +140,15 @@ def test_describe_metric_data(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_tag_values(self): + cmd = """python ../../main.py monitor describe-tag-values --tag-key 'xxx' --service-code 'xxx' --resource-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_services(self): cmd = """python ../../main.py monitor describe-services """ with os.popen(cmd) as f: @@ -149,6 +158,24 @@ def test_describe_services(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_put_product_metric_data(self): + cmd = """python ../../main.py monitor put-product-metric-data --app-code 'xxx' --service-code 'xxx' --region 'xxx' --resource-id 'xxx' --data-points '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_put_product_metric_data(self): + cmd = """python ../../main.py monitor put-product-metric-data --app-code 'xxx' --service-code 'xxx' --region 'xxx' --resource-id 'xxx' --data-points '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_put_custom_metric_data(self): cmd = """python ../../main.py monitor put-custom-metric-data """ with os.popen(cmd) as f: @@ -167,3 +194,12 @@ def test_put_custom_metric_data(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_custom_metric_data(self): + cmd = """python ../../main.py monitor describe-custom-metric-data --namespace-uid 'xxx' --query '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + diff --git a/testcases/generated/mps_test.py b/testcases/generated/mps_test.py deleted file mode 100644 index 4c5bc02..0000000 --- a/testcases/generated/mps_test.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding=utf8 - -# Copyright 2018 JDCLOUD.COM -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# NOTE: This class is auto generated by the jdcloud code generator program. - -import unittest -import os -import json - - -class MpsTest(unittest.TestCase): - - def test_get_style_delimiter(self): - cmd = """python ../../main.py mps get-style-delimiter --bucket-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_set_style_delimiter(self): - cmd = """python ../../main.py mps set-style-delimiter --bucket-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_delete_style_delimiter(self): - cmd = """python ../../main.py mps delete-style-delimiter --bucket-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_list_thumbnail_task(self): - cmd = """python ../../main.py mps list-thumbnail-task """ - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_create_thumbnail_task(self): - cmd = """python ../../main.py mps create-thumbnail-task --source '{"":""}' --target '{"":""}'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_get_thumbnail_task(self): - cmd = """python ../../main.py mps get-thumbnail-task --task-id 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_get_notification(self): - cmd = """python ../../main.py mps get-notification """ - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_set_notification(self): - cmd = """python ../../main.py mps set-notification --enabled 'true'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - diff --git a/testcases/generated/nativecontainer_test.py b/testcases/generated/nativecontainer_test.py index 0eff3be..37456d5 100644 --- a/testcases/generated/nativecontainer_test.py +++ b/testcases/generated/nativecontainer_test.py @@ -23,8 +23,8 @@ class NativecontainerTest(unittest.TestCase): - def test_describe_containers(self): - cmd = """python ../../main.py nativecontainer describe-containers """ + def test_describe_secrets(self): + cmd = """python ../../main.py nativecontainer describe-secrets """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_containers(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_containers(self): - cmd = """python ../../main.py nativecontainer create-containers --container-spec '{"":""}' --max-count '5'""" + def test_create_secret(self): + cmd = """python ../../main.py nativecontainer create-secret --name 'xxx' --secret-type 'xxx' --data '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_create_containers(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_container(self): - cmd = """python ../../main.py nativecontainer describe-container --container-id 'xxx'""" + def test_describe_secret(self): + cmd = """python ../../main.py nativecontainer describe-secret --name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_describe_container(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_container(self): - cmd = """python ../../main.py nativecontainer delete-container --container-id 'xxx'""" + def test_delete_secret(self): + cmd = """python ../../main.py nativecontainer delete-secret --name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_delete_container(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_container(self): - cmd = """python ../../main.py nativecontainer start-container --container-id 'xxx'""" + def test_describe_quota(self): + cmd = """python ../../main.py nativecontainer describe-quota --resource-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_start_container(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_container(self): - cmd = """python ../../main.py nativecontainer stop-container --container-id 'xxx'""" + def test_describe_containers(self): + cmd = """python ../../main.py nativecontainer describe-containers """ with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_stop_container(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_container_attribute(self): - cmd = """python ../../main.py nativecontainer modify-container-attribute --container-id 'xxx'""" + def test_create_containers(self): + cmd = """python ../../main.py nativecontainer create-containers --container-spec '{"":""}' --max-count '5'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_modify_container_attribute(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_associate_elastic_ip(self): - cmd = """python ../../main.py nativecontainer associate-elastic-ip --container-id 'xxx' --elastic-ip-id 'xxx'""" + def test_describe_container(self): + cmd = """python ../../main.py nativecontainer describe-container --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_associate_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disassociate_elastic_ip(self): - cmd = """python ../../main.py nativecontainer disassociate-elastic-ip --container-id 'xxx' --elastic-ip-id 'xxx'""" + def test_delete_container(self): + cmd = """python ../../main.py nativecontainer delete-container --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_disassociate_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_logs(self): - cmd = """python ../../main.py nativecontainer get-logs --container-id 'xxx'""" + def test_start_container(self): + cmd = """python ../../main.py nativecontainer start-container --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_get_logs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_rebuild_container(self): - cmd = """python ../../main.py nativecontainer rebuild-container --container-id 'xxx' --image 'xxx'""" + def test_stop_container(self): + cmd = """python ../../main.py nativecontainer stop-container --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_rebuild_container(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_resize_container(self): - cmd = """python ../../main.py nativecontainer resize-container --container-id 'xxx' --instance-type 'xxx'""" + def test_modify_container_attribute(self): + cmd = """python ../../main.py nativecontainer modify-container-attribute --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_resize_container(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_exec_create(self): - cmd = """python ../../main.py nativecontainer exec-create --container-id 'xxx'""" + def test_associate_elastic_ip(self): + cmd = """python ../../main.py nativecontainer associate-elastic-ip --container-id 'xxx' --elastic-ip-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_exec_create(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_exec_get_exit_code(self): - cmd = """python ../../main.py nativecontainer exec-get-exit-code --container-id 'xxx' --exec-id 'xxx'""" + def test_disassociate_elastic_ip(self): + cmd = """python ../../main.py nativecontainer disassociate-elastic-ip --container-id 'xxx' --elastic-ip-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_exec_get_exit_code(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_resize_tty(self): - cmd = """python ../../main.py nativecontainer resize-tty --container-id 'xxx' --height '5' --width '5'""" + def test_get_logs(self): + cmd = """python ../../main.py nativecontainer get-logs --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_resize_tty(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instance_types(self): - cmd = """python ../../main.py nativecontainer describe-instance-types """ + def test_rebuild_container(self): + cmd = """python ../../main.py nativecontainer rebuild-container --container-id 'xxx' --image 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_describe_instance_types(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_quota(self): - cmd = """python ../../main.py nativecontainer describe-quota --resource-type 'xxx'""" + def test_resize_container(self): + cmd = """python ../../main.py nativecontainer resize-container --container-id 'xxx' --instance-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_describe_quota(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_secrets(self): - cmd = """python ../../main.py nativecontainer describe-secrets """ + def test_exec_create(self): + cmd = """python ../../main.py nativecontainer exec-create --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_describe_secrets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_secret(self): - cmd = """python ../../main.py nativecontainer create-secret --name 'xxx' --secret-type 'xxx' --data '{"":""}'""" + def test_exec_get_exit_code(self): + cmd = """python ../../main.py nativecontainer exec-get-exit-code --container-id 'xxx' --exec-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +194,8 @@ def test_create_secret(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_secret(self): - cmd = """python ../../main.py nativecontainer describe-secret --name 'xxx'""" + def test_resize_tty(self): + cmd = """python ../../main.py nativecontainer resize-tty --container-id 'xxx' --height '5' --width '5'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +203,8 @@ def test_describe_secret(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_secret(self): - cmd = """python ../../main.py nativecontainer delete-secret --name 'xxx'""" + def test_describe_instance_types(self): + cmd = """python ../../main.py nativecontainer describe-instance-types """ with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/nc_test.py b/testcases/generated/nc_test.py index 424dde8..a117c96 100644 --- a/testcases/generated/nc_test.py +++ b/testcases/generated/nc_test.py @@ -23,8 +23,8 @@ class NcTest(unittest.TestCase): - def test_describe_containers(self): - cmd = """python ../../main.py nc describe-containers """ + def test_describe_secrets(self): + cmd = """python ../../main.py nc describe-secrets """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_containers(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_containers(self): - cmd = """python ../../main.py nc create-containers """ + def test_create_secret(self): + cmd = """python ../../main.py nc create-secret --name 'xxx' --secret-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_create_containers(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_container(self): - cmd = """python ../../main.py nc describe-container --container-id 'xxx'""" + def test_describe_secret(self): + cmd = """python ../../main.py nc describe-secret --name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_describe_container(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_container(self): - cmd = """python ../../main.py nc delete-container --container-id 'xxx'""" + def test_delete_secret(self): + cmd = """python ../../main.py nc delete-secret --name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_delete_container(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_container(self): - cmd = """python ../../main.py nc start-container --container-id 'xxx'""" + def test_describe_quota(self): + cmd = """python ../../main.py nc describe-quota --resource-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_start_container(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_container(self): - cmd = """python ../../main.py nc stop-container --container-id 'xxx'""" + def test_describe_containers(self): + cmd = """python ../../main.py nc describe-containers """ with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_stop_container(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_container_attribute(self): - cmd = """python ../../main.py nc modify-container-attribute --container-id 'xxx'""" + def test_create_containers(self): + cmd = """python ../../main.py nc create-containers """ with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_modify_container_attribute(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_associate_elastic_ip(self): - cmd = """python ../../main.py nc associate-elastic-ip --container-id 'xxx' --elastic-ip-id 'xxx'""" + def test_describe_container(self): + cmd = """python ../../main.py nc describe-container --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_associate_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disassociate_elastic_ip(self): - cmd = """python ../../main.py nc disassociate-elastic-ip --container-id 'xxx' --elastic-ip-id 'xxx'""" + def test_delete_container(self): + cmd = """python ../../main.py nc delete-container --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_disassociate_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_logs(self): - cmd = """python ../../main.py nc get-logs --container-id 'xxx'""" + def test_start_container(self): + cmd = """python ../../main.py nc start-container --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_get_logs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_quota(self): - cmd = """python ../../main.py nc describe-quota --resource-type 'xxx'""" + def test_stop_container(self): + cmd = """python ../../main.py nc stop-container --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_describe_quota(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_secrets(self): - cmd = """python ../../main.py nc describe-secrets """ + def test_modify_container_attribute(self): + cmd = """python ../../main.py nc modify-container-attribute --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_describe_secrets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_secret(self): - cmd = """python ../../main.py nc create-secret --name 'xxx' --secret-type 'xxx'""" + def test_associate_elastic_ip(self): + cmd = """python ../../main.py nc associate-elastic-ip --container-id 'xxx' --elastic-ip-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_create_secret(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_secret(self): - cmd = """python ../../main.py nc describe-secret --name 'xxx'""" + def test_disassociate_elastic_ip(self): + cmd = """python ../../main.py nc disassociate-elastic-ip --container-id 'xxx' --elastic-ip-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_describe_secret(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_secret(self): - cmd = """python ../../main.py nc delete-secret --name 'xxx'""" + def test_get_logs(self): + cmd = """python ../../main.py nc get-logs --container-id 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/ossopenapi_test.py b/testcases/generated/ossopenapi_test.py index 6bc63e3..2d851a8 100644 --- a/testcases/generated/ossopenapi_test.py +++ b/testcases/generated/ossopenapi_test.py @@ -59,3 +59,39 @@ def test_delete_back_source_configuration(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_get_historical_replicat_task(self): + cmd = """python ../../main.py ossopenapi get-historical-replicat-task --bucket-name 'xxx' --task-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_abort_historical_replicat_task(self): + cmd = """python ../../main.py ossopenapi abort-historical-replicat-task --bucket-name 'xxx' --task-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_list_historical_replicat_tasks(self): + cmd = """python ../../main.py ossopenapi list-historical-replicat-tasks --bucket-name 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_historical_replicat_task(self): + cmd = """python ../../main.py ossopenapi create-historical-replicat-task --bucket-name 'xxx' --action 'xxx' --bucket-name 'xxx' --bucket-region 'xxx' --target-bucket-name 'xxx' --target-bucket-region 'xxx' --storage-class 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + diff --git a/testcases/generated/pod_test.py b/testcases/generated/pod_test.py index a182ed9..cdce072 100644 --- a/testcases/generated/pod_test.py +++ b/testcases/generated/pod_test.py @@ -23,8 +23,8 @@ class PodTest(unittest.TestCase): - def test_describe_container(self): - cmd = """python ../../main.py pod describe-container --pod-id 'xxx' --container-name 'xxx'""" + def test_describe_secrets(self): + cmd = """python ../../main.py pod describe-secrets """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_container(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_exec_create(self): - cmd = """python ../../main.py pod exec-create --pod-id 'xxx' --container-name 'xxx'""" + def test_create_secret(self): + cmd = """python ../../main.py pod create-secret --name 'xxx' --secret-type 'xxx' --data '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_exec_create(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_exec_get_exit_code(self): - cmd = """python ../../main.py pod exec-get-exit-code --pod-id 'xxx' --container-name 'xxx' --exec-id 'xxx'""" + def test_describe_secret(self): + cmd = """python ../../main.py pod describe-secret --name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_exec_get_exit_code(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_resize_tty(self): - cmd = """python ../../main.py pod resize-tty --pod-id 'xxx' --container-name 'xxx' --height '5' --width '5'""" + def test_delete_secret(self): + cmd = """python ../../main.py pod delete-secret --name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_resize_tty(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instance_types(self): - cmd = """python ../../main.py pod describe-instance-types """ + def test_create_config_file(self): + cmd = """python ../../main.py pod create-config-file --name 'xxx' --data '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_describe_instance_types(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_pods(self): - cmd = """python ../../main.py pod describe-pods """ + def test_describe_config_file(self): + cmd = """python ../../main.py pod describe-config-file --name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_describe_pods(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_pods(self): - cmd = """python ../../main.py pod create-pods --pod-spec '{"":""}' --max-count '5'""" + def test_delete_config_file(self): + cmd = """python ../../main.py pod delete-config-file --name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_create_pods(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_check_pod_name(self): - cmd = """python ../../main.py pod check-pod-name --pod-name 'xxx'""" + def test_update_config_file(self): + cmd = """python ../../main.py pod update-config-file --name 'xxx' --name 'xxx' --data '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_check_pod_name(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_pod(self): - cmd = """python ../../main.py pod describe-pod --pod-id 'xxx'""" + def test_describe_quota(self): + cmd = """python ../../main.py pod describe-quota --resource-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_describe_pod(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_pod(self): - cmd = """python ../../main.py pod delete-pod --pod-id 'xxx'""" + def test_describe_container(self): + cmd = """python ../../main.py pod describe-container --pod-id 'xxx' --container-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_delete_pod(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_pod(self): - cmd = """python ../../main.py pod start-pod --pod-id 'xxx'""" + def test_exec_create(self): + cmd = """python ../../main.py pod exec-create --pod-id 'xxx' --container-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_start_pod(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_pod(self): - cmd = """python ../../main.py pod stop-pod --pod-id 'xxx'""" + def test_exec_get_exit_code(self): + cmd = """python ../../main.py pod exec-get-exit-code --pod-id 'xxx' --container-name 'xxx' --exec-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_stop_pod(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_pod_attribute(self): - cmd = """python ../../main.py pod modify-pod-attribute --pod-id 'xxx'""" + def test_resize_tty(self): + cmd = """python ../../main.py pod resize-tty --pod-id 'xxx' --container-name 'xxx' --height '5' --width '5'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_modify_pod_attribute(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_associate_elastic_ip(self): - cmd = """python ../../main.py pod associate-elastic-ip --pod-id 'xxx' --elastic-ip-id 'xxx'""" + def test_describe_pods(self): + cmd = """python ../../main.py pod describe-pods """ with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_associate_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disassociate_elastic_ip(self): - cmd = """python ../../main.py pod disassociate-elastic-ip --pod-id 'xxx' --elastic-ip-id 'xxx'""" + def test_create_pods(self): + cmd = """python ../../main.py pod create-pods --pod-spec '{"":""}' --max-count '5'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_disassociate_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_container_logs(self): - cmd = """python ../../main.py pod get-container-logs --pod-id 'xxx' --container-name 'xxx'""" + def test_check_pod_name(self): + cmd = """python ../../main.py pod check-pod-name --pod-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_get_container_logs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_rebuild_pod(self): - cmd = """python ../../main.py pod rebuild-pod --pod-id 'xxx' --containers '[{"":""}]'""" + def test_describe_pod(self): + cmd = """python ../../main.py pod describe-pod --pod-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_rebuild_pod(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_resize_pod(self): - cmd = """python ../../main.py pod resize-pod --pod-id 'xxx' --instance-type 'xxx'""" + def test_delete_pod(self): + cmd = """python ../../main.py pod delete-pod --pod-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_resize_pod(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_quota(self): - cmd = """python ../../main.py pod describe-quota --resource-type 'xxx'""" + def test_start_pod(self): + cmd = """python ../../main.py pod start-pod --pod-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +194,8 @@ def test_describe_quota(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_secrets(self): - cmd = """python ../../main.py pod describe-secrets """ + def test_stop_pod(self): + cmd = """python ../../main.py pod stop-pod --pod-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +203,8 @@ def test_describe_secrets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_secret(self): - cmd = """python ../../main.py pod create-secret --name 'xxx' --secret-type 'xxx' --data '{"":""}'""" + def test_modify_pod_attribute(self): + cmd = """python ../../main.py pod modify-pod-attribute --pod-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -212,8 +212,8 @@ def test_create_secret(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_secret(self): - cmd = """python ../../main.py pod describe-secret --name 'xxx'""" + def test_associate_elastic_ip(self): + cmd = """python ../../main.py pod associate-elastic-ip --pod-id 'xxx' --elastic-ip-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -221,8 +221,44 @@ def test_describe_secret(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_secret(self): - cmd = """python ../../main.py pod delete-secret --name 'xxx'""" + def test_disassociate_elastic_ip(self): + cmd = """python ../../main.py pod disassociate-elastic-ip --pod-id 'xxx' --elastic-ip-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_get_container_logs(self): + cmd = """python ../../main.py pod get-container-logs --pod-id 'xxx' --container-name 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_rebuild_pod(self): + cmd = """python ../../main.py pod rebuild-pod --pod-id 'xxx' --containers '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_resize_pod(self): + cmd = """python ../../main.py pod resize-pod --pod-id 'xxx' --instance-type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_instance_types(self): + cmd = """python ../../main.py pod describe-instance-types """ with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/rds_test.py b/testcases/generated/rds_test.py index 59d8c4f..1bc287b 100644 --- a/testcases/generated/rds_test.py +++ b/testcases/generated/rds_test.py @@ -23,6 +23,33 @@ class RdsTest(unittest.TestCase): + def test_describe_binlogs(self): + cmd = """python ../../main.py rds describe-binlogs --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_binlog_download_url(self): + cmd = """python ../../main.py rds describe-binlog-download-url --instance-id 'xxx' --binlog-backup-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_clear_binlogs(self): + cmd = """python ../../main.py rds clear-binlogs --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_accounts(self): cmd = """python ../../main.py rds describe-accounts --instance-id 'xxx'""" with os.popen(cmd) as f: @@ -104,8 +131,8 @@ def test_grant_account_privilege(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_audit(self): - cmd = """python ../../main.py rds describe-audit --instance-id 'xxx'""" + def test_describe_accounts_for_ops(self): + cmd = """python ../../main.py rds describe-accounts-for-ops --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +140,8 @@ def test_describe_audit(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_audit(self): - cmd = """python ../../main.py rds create-audit --instance-id 'xxx' --enabled 'xxx'""" + def test_create_account_for_ops(self): + cmd = """python ../../main.py rds create-account-for-ops --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +149,8 @@ def test_create_audit(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_audit(self): - cmd = """python ../../main.py rds delete-audit --instance-id 'xxx'""" + def test_modify_account_for_ops(self): + cmd = """python ../../main.py rds modify-account-for-ops --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +158,8 @@ def test_delete_audit(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_audit_options(self): - cmd = """python ../../main.py rds describe-audit-options --instance-id 'xxx' --name 'xxx'""" + def test_describe_instances(self): + cmd = """python ../../main.py rds describe-instances """ with os.popen(cmd) as f: content = f.read() @@ -140,8 +167,8 @@ def test_describe_audit_options(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_audit(self): - cmd = """python ../../main.py rds modify-audit --instance-id 'xxx'""" + def test_create_instance(self): + cmd = """python ../../main.py rds create-instance --instance-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +176,8 @@ def test_modify_audit(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_audit_files(self): - cmd = """python ../../main.py rds describe-audit-files --instance-id 'xxx'""" + def test_describe_instance_attributes(self): + cmd = """python ../../main.py rds describe-instance-attributes --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +185,8 @@ def test_describe_audit_files(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_audit_download_url(self): - cmd = """python ../../main.py rds describe-audit-download-url --instance-id 'xxx' --file-name 'xxx'""" + def test_delete_instance(self): + cmd = """python ../../main.py rds delete-instance --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -167,8 +194,8 @@ def test_describe_audit_download_url(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_enable_audit(self): - cmd = """python ../../main.py rds enable-audit --instance-id 'xxx'""" + def test_describe_backup_policy(self): + cmd = """python ../../main.py rds describe-backup-policy --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +203,8 @@ def test_enable_audit(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disable_audit(self): - cmd = """python ../../main.py rds disable-audit --instance-id 'xxx'""" + def test_modify_backup_policy(self): + cmd = """python ../../main.py rds modify-backup-policy --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +212,8 @@ def test_disable_audit(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_audit_result(self): - cmd = """python ../../main.py rds describe-audit-result --instance-id 'xxx' --start-time 'xxx' --end-time 'xxx'""" + def test_enable_enhanced_backup(self): + cmd = """python ../../main.py rds enable-enhanced-backup --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +221,8 @@ def test_describe_audit_result(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_azs(self): - cmd = """python ../../main.py rds describe-azs --engine 'xxx'""" + def test_describe_backup_space(self): + cmd = """python ../../main.py rds describe-backup-space --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +230,8 @@ def test_describe_azs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_backups(self): - cmd = """python ../../main.py rds describe-backups --instance-id 'xxx' --page-number '5' --page-size '5'""" + def test_describe_backup_charge(self): + cmd = """python ../../main.py rds describe-backup-charge --engine 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -212,8 +239,8 @@ def test_describe_backups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_backup(self): - cmd = """python ../../main.py rds create-backup """ + def test_modify_instance_name(self): + cmd = """python ../../main.py rds modify-instance-name --instance-id 'xxx' --instance-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -221,8 +248,8 @@ def test_create_backup(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_backup(self): - cmd = """python ../../main.py rds delete-backup --backup-id 'xxx'""" + def test_failover_instance(self): + cmd = """python ../../main.py rds failover-instance --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -230,8 +257,8 @@ def test_delete_backup(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_backup_download_url(self): - cmd = """python ../../main.py rds describe-backup-download-url --backup-id 'xxx'""" + def test_reboot_instance(self): + cmd = """python ../../main.py rds reboot-instance --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -239,8 +266,8 @@ def test_describe_backup_download_url(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_backup_synchronicities(self): - cmd = """python ../../main.py rds describe-backup-synchronicities """ + def test_enable_internet_access(self): + cmd = """python ../../main.py rds enable-internet-access --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -248,8 +275,8 @@ def test_describe_backup_synchronicities(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_backup_synchronicity(self): - cmd = """python ../../main.py rds create-backup-synchronicity --instance-id 'xxx' --dest-region 'xxx'""" + def test_disable_internet_access(self): + cmd = """python ../../main.py rds disable-internet-access --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -257,8 +284,8 @@ def test_create_backup_synchronicity(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_backup_synchronicity(self): - cmd = """python ../../main.py rds delete-backup-synchronicity --service-id 'xxx'""" + def test_restore_instance(self): + cmd = """python ../../main.py rds restore-instance --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -266,8 +293,8 @@ def test_delete_backup_synchronicity(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_instance_by_time_in_cross_region(self): - cmd = """python ../../main.py rds create-instance-by-time-in-cross-region --restore-time 'xxx' --service-id 'xxx' --instance-spec '{"":""}'""" + def test_create_instance_from_backup(self): + cmd = """python ../../main.py rds create-instance-from-backup --backup-id 'xxx' --engine 'xxx' --instance-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -275,8 +302,8 @@ def test_create_instance_by_time_in_cross_region(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_binlogs(self): - cmd = """python ../../main.py rds describe-binlogs --instance-id 'xxx'""" + def test_modify_instance_spec(self): + cmd = """python ../../main.py rds modify-instance-spec --instance-id 'xxx' --new-instance-class 'xxx' --new-instance-storage-gb '5'""" with os.popen(cmd) as f: content = f.read() @@ -284,8 +311,8 @@ def test_describe_binlogs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_binlog_download_url(self): - cmd = """python ../../main.py rds describe-binlog-download-url --instance-id 'xxx' --binlog-backup-id 'xxx'""" + def test_create_instance_by_time(self): + cmd = """python ../../main.py rds create-instance-by-time --instance-id 'xxx' --restore-time 'xxx' --instance-spec '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -293,8 +320,8 @@ def test_describe_binlog_download_url(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_clear_binlogs(self): - cmd = """python ../../main.py rds clear-binlogs --instance-id 'xxx'""" + def test_create_roinstance(self): + cmd = """python ../../main.py rds create-roinstance --instance-id 'xxx' --instance-name 'xxx' --instance-class 'xxx' --instance-storage-gb '5' --az-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -302,8 +329,8 @@ def test_clear_binlogs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_alter_table_with_online_ddl(self): - cmd = """python ../../main.py rds alter-table-with-online-ddl --instance-id 'xxx' --database 'xxx' --table 'xxx' --command 'xxx'""" + def test_modify_connection_mode(self): + cmd = """python ../../main.py rds modify-connection-mode --instance-id 'xxx' --connection-mode 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -311,8 +338,8 @@ def test_alter_table_with_online_ddl(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_privilege(self): - cmd = """python ../../main.py rds describe-privilege --engine 'xxx'""" + def test_describe_latest_restore_time(self): + cmd = """python ../../main.py rds describe-latest-restore-time --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -320,8 +347,8 @@ def test_describe_privilege(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_databases(self): - cmd = """python ../../main.py rds describe-databases --instance-id 'xxx'""" + def test_modify_parameter_group(self): + cmd = """python ../../main.py rds modify-parameter-group --instance-id 'xxx' --parameter-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -329,8 +356,8 @@ def test_describe_databases(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_database(self): - cmd = """python ../../main.py rds create-database --instance-id 'xxx' --db-name 'xxx' --character-set-name 'xxx'""" + def test_exchange_instance_dns(self): + cmd = """python ../../main.py rds exchange-instance-dns --instance-id 'xxx' --target-instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -338,8 +365,8 @@ def test_create_database(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_database(self): - cmd = """python ../../main.py rds delete-database --instance-id 'xxx' --db-name 'xxx'""" + def test_modify_instance_az(self): + cmd = """python ../../main.py rds modify-instance-az --instance-id 'xxx' --new-az-id '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -347,8 +374,8 @@ def test_delete_database(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_restore_database_from_backup(self): - cmd = """python ../../main.py rds restore-database-from-backup --instance-id 'xxx' --db-name 'xxx' --backup-id 'xxx' --backup-file-name 'xxx'""" + def test_describe_ssl(self): + cmd = """python ../../main.py rds describe-ssl --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -356,8 +383,8 @@ def test_restore_database_from_backup(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_restore_database_from_file(self): - cmd = """python ../../main.py rds restore-database-from-file --instance-id 'xxx' --db-name 'xxx' --file-name 'xxx'""" + def test_enable_ssl(self): + cmd = """python ../../main.py rds enable-ssl --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -365,8 +392,8 @@ def test_restore_database_from_file(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_restore_database_from_oss(self): - cmd = """python ../../main.py rds restore-database-from-oss --instance-id 'xxx' --db-name 'xxx' --oss-url 'xxx'""" + def test_disable_ssl(self): + cmd = """python ../../main.py rds disable-ssl --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -374,8 +401,71 @@ def test_restore_database_from_oss(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_error_logs(self): - cmd = """python ../../main.py rds describe-error-logs --instance-id 'xxx'""" + def test_restore_instance_by_time(self): + cmd = """python ../../main.py rds restore-instance-by-time --instance-id 'xxx' --restore-time 'xxx' --restore-schema '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_active_directory(self): + cmd = """python ../../main.py rds modify-active-directory --instance-id 'xxx' --ad-resource-id 'xxx' --force-restart 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_instance_maintain_time(self): + cmd = """python ../../main.py rds modify-instance-maintain-time --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_instance_maintain_time(self): + cmd = """python ../../main.py rds describe-instance-maintain-time --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_switch_for_modifying_instance_spec(self): + cmd = """python ../../main.py rds switch-for-modifying-instance-spec --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_upgrade_versions(self): + cmd = """python ../../main.py rds describe-upgrade-versions --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_upgrade_plan(self): + cmd = """python ../../main.py rds describe-upgrade-plan --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_upgrade_engine_version(self): + cmd = """python ../../main.py rds upgrade-engine-version --instance-id 'xxx' --upgrade-schedule '5'""" with os.popen(cmd) as f: content = f.read() @@ -419,8 +509,8 @@ def test_delete_import_file(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instances(self): - cmd = """python ../../main.py rds describe-instances """ + def test_describe_logs(self): + cmd = """python ../../main.py rds describe-logs --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -428,8 +518,8 @@ def test_describe_instances(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_instance(self): - cmd = """python ../../main.py rds create-instance --instance-spec '{"":""}'""" + def test_update_log_download_urlinternal(self): + cmd = """python ../../main.py rds update-log-download-urlinternal --instance-id 'xxx' --log-id 'xxx' --seconds '5'""" with os.popen(cmd) as f: content = f.read() @@ -437,8 +527,8 @@ def test_create_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instance_attributes(self): - cmd = """python ../../main.py rds describe-instance-attributes --instance-id 'xxx'""" + def test_describe_log_download_url(self): + cmd = """python ../../main.py rds describe-log-download-url --instance-id 'xxx' --log-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -446,8 +536,8 @@ def test_describe_instance_attributes(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_instance(self): - cmd = """python ../../main.py rds delete-instance --instance-id 'xxx'""" + def test_describe_databases(self): + cmd = """python ../../main.py rds describe-databases --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -455,8 +545,8 @@ def test_delete_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_backup_policy(self): - cmd = """python ../../main.py rds describe-backup-policy --instance-id 'xxx'""" + def test_create_database(self): + cmd = """python ../../main.py rds create-database --instance-id 'xxx' --db-name 'xxx' --character-set-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -464,8 +554,8 @@ def test_describe_backup_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_backup_policy(self): - cmd = """python ../../main.py rds modify-backup-policy --instance-id 'xxx'""" + def test_delete_database(self): + cmd = """python ../../main.py rds delete-database --instance-id 'xxx' --db-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -473,8 +563,8 @@ def test_modify_backup_policy(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_instance_name(self): - cmd = """python ../../main.py rds modify-instance-name --instance-id 'xxx' --instance-name 'xxx'""" + def test_restore_database_from_backup(self): + cmd = """python ../../main.py rds restore-database-from-backup --instance-id 'xxx' --db-name 'xxx' --backup-id 'xxx' --backup-file-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -482,8 +572,8 @@ def test_modify_instance_name(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_failover_instance(self): - cmd = """python ../../main.py rds failover-instance --instance-id 'xxx'""" + def test_restore_database_from_file(self): + cmd = """python ../../main.py rds restore-database-from-file --instance-id 'xxx' --db-name 'xxx' --file-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -491,8 +581,8 @@ def test_failover_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_reboot_instance(self): - cmd = """python ../../main.py rds reboot-instance --instance-id 'xxx'""" + def test_restore_database_from_oss(self): + cmd = """python ../../main.py rds restore-database-from-oss --instance-id 'xxx' --db-name 'xxx' --oss-url 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -500,8 +590,8 @@ def test_reboot_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_enable_internet_access(self): - cmd = """python ../../main.py rds enable-internet-access --instance-id 'xxx'""" + def test_modify_database_comment(self): + cmd = """python ../../main.py rds modify-database-comment --instance-id 'xxx' --db-name 'xxx' --comment 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -509,8 +599,8 @@ def test_enable_internet_access(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disable_internet_access(self): - cmd = """python ../../main.py rds disable-internet-access --instance-id 'xxx'""" + def test_enable_intercept(self): + cmd = """python ../../main.py rds enable-intercept --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -518,8 +608,8 @@ def test_disable_internet_access(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_restore_instance(self): - cmd = """python ../../main.py rds restore-instance --instance-id 'xxx'""" + def test_disable_intercept(self): + cmd = """python ../../main.py rds disable-intercept --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -527,8 +617,8 @@ def test_restore_instance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_instance_from_backup(self): - cmd = """python ../../main.py rds create-instance-from-backup --backup-id 'xxx' --engine 'xxx' --instance-spec '{"":""}'""" + def test_describe_intercept_result(self): + cmd = """python ../../main.py rds describe-intercept-result --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -536,8 +626,8 @@ def test_create_instance_from_backup(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_instance_spec(self): - cmd = """python ../../main.py rds modify-instance-spec --instance-id 'xxx' --new-instance-class 'xxx' --new-instance-storage-gb '5'""" + def test_describe_intercept(self): + cmd = """python ../../main.py rds describe-intercept --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -545,8 +635,8 @@ def test_modify_instance_spec(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_instance_by_time(self): - cmd = """python ../../main.py rds create-instance-by-time --instance-id 'xxx' --restore-time 'xxx' --instance-spec '{"":""}'""" + def test_describe_read_write_proxies(self): + cmd = """python ../../main.py rds describe-read-write-proxies --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -554,8 +644,8 @@ def test_create_instance_by_time(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_roinstance(self): - cmd = """python ../../main.py rds create-roinstance --instance-id 'xxx' --instance-name 'xxx' --instance-class 'xxx' --instance-storage-gb '5' --az-id 'xxx'""" + def test_create_read_write_proxy(self): + cmd = """python ../../main.py rds create-read-write-proxy --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -563,8 +653,8 @@ def test_create_roinstance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_connection_mode(self): - cmd = """python ../../main.py rds modify-connection-mode --instance-id 'xxx' --connection-mode 'xxx'""" + def test_describe_read_write_proxy_attribute(self): + cmd = """python ../../main.py rds describe-read-write-proxy-attribute --read-write-proxy-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -572,8 +662,8 @@ def test_modify_connection_mode(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_latest_restore_time(self): - cmd = """python ../../main.py rds describe-latest-restore-time --instance-id 'xxx'""" + def test_delete_read_write_proxy(self): + cmd = """python ../../main.py rds delete-read-write-proxy --read-write-proxy-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -581,8 +671,8 @@ def test_describe_latest_restore_time(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_parameter_group(self): - cmd = """python ../../main.py rds modify-parameter-group --instance-id 'xxx' --parameter-group-id 'xxx'""" + def test_enable_read_write_proxy_internet_access(self): + cmd = """python ../../main.py rds enable-read-write-proxy-internet-access --read-write-proxy-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -590,8 +680,8 @@ def test_modify_parameter_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_exchange_instance_dns(self): - cmd = """python ../../main.py rds exchange-instance-dns --instance-id 'xxx' --target-instance-id 'xxx'""" + def test_disable_read_write_proxy_internet_access(self): + cmd = """python ../../main.py rds disable-read-write-proxy-internet-access --read-write-proxy-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -599,8 +689,8 @@ def test_exchange_instance_dns(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_instance_az(self): - cmd = """python ../../main.py rds modify-instance-az --instance-id 'xxx' --new-az-id '{"":""}'""" + def test_modify_read_write_proxy(self): + cmd = """python ../../main.py rds modify-read-write-proxy --read-write-proxy-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -608,8 +698,8 @@ def test_modify_instance_az(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_ssl(self): - cmd = """python ../../main.py rds describe-ssl --instance-id 'xxx'""" + def test_delete_parameter_group(self): + cmd = """python ../../main.py rds delete-parameter-group --parameter-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -617,8 +707,8 @@ def test_describe_ssl(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_enable_ssl(self): - cmd = """python ../../main.py rds enable-ssl --instance-id 'xxx'""" + def test_modify_parameter_group_attribute(self): + cmd = """python ../../main.py rds modify-parameter-group-attribute --parameter-group-id 'xxx' --parameter-group-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -626,8 +716,8 @@ def test_enable_ssl(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_restore_instance_by_time(self): - cmd = """python ../../main.py rds restore-instance-by-time --instance-id 'xxx' --restore-time 'xxx' --restore-schema '[{"":""}]'""" + def test_describe_parameter_groups(self): + cmd = """python ../../main.py rds describe-parameter-groups """ with os.popen(cmd) as f: content = f.read() @@ -635,8 +725,8 @@ def test_restore_instance_by_time(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_enable_intercept(self): - cmd = """python ../../main.py rds enable-intercept --instance-id 'xxx'""" + def test_create_parameter_group(self): + cmd = """python ../../main.py rds create-parameter-group --engine 'xxx' --engine-version 'xxx' --parameter-group-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -644,8 +734,8 @@ def test_enable_intercept(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disable_intercept(self): - cmd = """python ../../main.py rds disable-intercept --instance-id 'xxx'""" + def test_describe_parameter_group_parameters(self): + cmd = """python ../../main.py rds describe-parameter-group-parameters --parameter-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -653,8 +743,8 @@ def test_disable_intercept(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_intercept_result(self): - cmd = """python ../../main.py rds describe-intercept-result --instance-id 'xxx'""" + def test_modify_parameter_group_parameters(self): + cmd = """python ../../main.py rds modify-parameter-group-parameters --parameter-group-id 'xxx' --parameters '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -662,8 +752,8 @@ def test_describe_intercept_result(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_intercept(self): - cmd = """python ../../main.py rds describe-intercept --instance-id 'xxx'""" + def test_describe_parameter_modify_records(self): + cmd = """python ../../main.py rds describe-parameter-modify-records --parameter-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -671,8 +761,8 @@ def test_describe_intercept(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_logs(self): - cmd = """python ../../main.py rds describe-logs --instance-id 'xxx'""" + def test_copy_parameter_group(self): + cmd = """python ../../main.py rds copy-parameter-group --parameter-group-id 'xxx' --parameter-group-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -680,8 +770,8 @@ def test_describe_logs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_log_download_urlinternal(self): - cmd = """python ../../main.py rds update-log-download-urlinternal --instance-id 'xxx' --log-id 'xxx' --seconds '5'""" + def test_describe_parameter_group_attached_instances(self): + cmd = """python ../../main.py rds describe-parameter-group-attached-instances --parameter-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -689,8 +779,8 @@ def test_update_log_download_urlinternal(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_log_download_url(self): - cmd = """python ../../main.py rds describe-log-download-url --instance-id 'xxx' --log-id 'xxx'""" + def test_describe_backups(self): + cmd = """python ../../main.py rds describe-backups --instance-id 'xxx' --page-number '5' --page-size '5'""" with os.popen(cmd) as f: content = f.read() @@ -698,8 +788,8 @@ def test_describe_log_download_url(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_parameters(self): - cmd = """python ../../main.py rds describe-parameters --instance-id 'xxx'""" + def test_create_backup(self): + cmd = """python ../../main.py rds create-backup """ with os.popen(cmd) as f: content = f.read() @@ -707,8 +797,8 @@ def test_describe_parameters(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_parameters(self): - cmd = """python ../../main.py rds modify-parameters --instance-id 'xxx' --parameters '[{"":""}]'""" + def test_delete_backup(self): + cmd = """python ../../main.py rds delete-backup --backup-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -716,8 +806,8 @@ def test_modify_parameters(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_parameter_group(self): - cmd = """python ../../main.py rds delete-parameter-group --parameter-group-id 'xxx'""" + def test_describe_backup_download_url(self): + cmd = """python ../../main.py rds describe-backup-download-url --backup-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -725,8 +815,8 @@ def test_delete_parameter_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_parameter_group_attribute(self): - cmd = """python ../../main.py rds modify-parameter-group-attribute --parameter-group-id 'xxx' --parameter-group-name 'xxx'""" + def test_describe_tables(self): + cmd = """python ../../main.py rds describe-tables --instance-id 'xxx' --db-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -734,8 +824,8 @@ def test_modify_parameter_group_attribute(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_parameter_groups(self): - cmd = """python ../../main.py rds describe-parameter-groups """ + def test_describe_tde(self): + cmd = """python ../../main.py rds describe-tde --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -743,8 +833,8 @@ def test_describe_parameter_groups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_parameter_group(self): - cmd = """python ../../main.py rds create-parameter-group --engine 'xxx' --engine-version 'xxx' --parameter-group-name 'xxx'""" + def test_enable_tde(self): + cmd = """python ../../main.py rds enable-tde --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -752,8 +842,8 @@ def test_create_parameter_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_parameter_group_parameters(self): - cmd = """python ../../main.py rds describe-parameter-group-parameters --parameter-group-id 'xxx'""" + def test_describe_white_list(self): + cmd = """python ../../main.py rds describe-white-list --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -761,8 +851,8 @@ def test_describe_parameter_group_parameters(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_parameter_group_parameters(self): - cmd = """python ../../main.py rds modify-parameter-group-parameters --parameter-group-id 'xxx' --parameters '[{"":""}]'""" + def test_modify_white_list(self): + cmd = """python ../../main.py rds modify-white-list --instance-id 'xxx' --ips 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -770,8 +860,8 @@ def test_modify_parameter_group_parameters(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_parameter_modify_records(self): - cmd = """python ../../main.py rds describe-parameter-modify-records --parameter-group-id 'xxx'""" + def test_describe_audit(self): + cmd = """python ../../main.py rds describe-audit --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -779,8 +869,8 @@ def test_describe_parameter_modify_records(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_copy_parameter_group(self): - cmd = """python ../../main.py rds copy-parameter-group --parameter-group-id 'xxx' --parameter-group-name 'xxx'""" + def test_create_audit(self): + cmd = """python ../../main.py rds create-audit --instance-id 'xxx' --enabled 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -788,8 +878,8 @@ def test_copy_parameter_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_parameter_group_attached_instances(self): - cmd = """python ../../main.py rds describe-parameter-group-attached-instances --parameter-group-id 'xxx'""" + def test_delete_audit(self): + cmd = """python ../../main.py rds delete-audit --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -797,8 +887,8 @@ def test_describe_parameter_group_attached_instances(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_index_performance(self): - cmd = """python ../../main.py rds describe-index-performance --instance-id 'xxx' --query-type 'xxx'""" + def test_describe_audit_options(self): + cmd = """python ../../main.py rds describe-audit-options --instance-id 'xxx' --name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -806,8 +896,8 @@ def test_describe_index_performance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_query_performance(self): - cmd = """python ../../main.py rds describe-query-performance --instance-id 'xxx' --query-type 'xxx'""" + def test_modify_audit(self): + cmd = """python ../../main.py rds modify-audit --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -815,8 +905,8 @@ def test_describe_query_performance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_slow_log_attributes(self): - cmd = """python ../../main.py rds describe-slow-log-attributes --instance-id 'xxx' --start-time 'xxx' --end-time 'xxx'""" + def test_describe_audit_files(self): + cmd = """python ../../main.py rds describe-audit-files --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -824,8 +914,8 @@ def test_describe_slow_log_attributes(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_slow_logs(self): - cmd = """python ../../main.py rds describe-slow-logs --instance-id 'xxx' --start-time 'xxx' --end-time 'xxx'""" + def test_describe_audit_download_url(self): + cmd = """python ../../main.py rds describe-audit-download-url --instance-id 'xxx' --file-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -833,8 +923,8 @@ def test_describe_slow_logs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_active_query_performance(self): - cmd = """python ../../main.py rds describe-active-query-performance --instance-id 'xxx'""" + def test_enable_audit(self): + cmd = """python ../../main.py rds enable-audit --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -842,8 +932,8 @@ def test_describe_active_query_performance(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_error_log(self): - cmd = """python ../../main.py rds describe-error-log --instance-id 'xxx' --start-time 'xxx' --end-time 'xxx'""" + def test_disable_audit(self): + cmd = """python ../../main.py rds disable-audit --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -851,8 +941,8 @@ def test_describe_error_log(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_tables(self): - cmd = """python ../../main.py rds describe-tables --instance-id 'xxx' --db-name 'xxx'""" + def test_describe_audit_result(self): + cmd = """python ../../main.py rds describe-audit-result --instance-id 'xxx' --start-time 'xxx' --end-time 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -860,8 +950,8 @@ def test_describe_tables(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_tde(self): - cmd = """python ../../main.py rds describe-tde --instance-id 'xxx'""" + def test_describe_azs(self): + cmd = """python ../../main.py rds describe-azs --engine 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -869,8 +959,8 @@ def test_describe_tde(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_enable_tde(self): - cmd = """python ../../main.py rds enable-tde --instance-id 'xxx'""" + def test_alter_table_with_online_ddl(self): + cmd = """python ../../main.py rds alter-table-with-online-ddl --instance-id 'xxx' --database 'xxx' --table 'xxx' --command 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -878,8 +968,8 @@ def test_enable_tde(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_white_list(self): - cmd = """python ../../main.py rds describe-white-list --instance-id 'xxx'""" + def test_describe_parameters(self): + cmd = """python ../../main.py rds describe-parameters --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -887,8 +977,116 @@ def test_describe_white_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_white_list(self): - cmd = """python ../../main.py rds modify-white-list --instance-id 'xxx' --ips 'xxx'""" + def test_modify_parameters(self): + cmd = """python ../../main.py rds modify-parameters --instance-id 'xxx' --parameters '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_backup_synchronicities(self): + cmd = """python ../../main.py rds describe-backup-synchronicities """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_backup_synchronicity(self): + cmd = """python ../../main.py rds create-backup-synchronicity --instance-id 'xxx' --dest-region 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_backup_synchronicity(self): + cmd = """python ../../main.py rds delete-backup-synchronicity --service-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_instance_by_time_in_cross_region(self): + cmd = """python ../../main.py rds create-instance-by-time-in-cross-region --restore-time 'xxx' --service-id 'xxx' --instance-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_error_logs(self): + cmd = """python ../../main.py rds describe-error-logs --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_privilege(self): + cmd = """python ../../main.py rds describe-privilege --engine 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_index_performance(self): + cmd = """python ../../main.py rds describe-index-performance --instance-id 'xxx' --query-type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_query_performance(self): + cmd = """python ../../main.py rds describe-query-performance --instance-id 'xxx' --query-type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_slow_log_attributes(self): + cmd = """python ../../main.py rds describe-slow-log-attributes --instance-id 'xxx' --start-time 'xxx' --end-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_slow_logs(self): + cmd = """python ../../main.py rds describe-slow-logs --instance-id 'xxx' --start-time 'xxx' --end-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_active_query_performance(self): + cmd = """python ../../main.py rds describe-active-query-performance --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_error_log(self): + cmd = """python ../../main.py rds describe-error-log --instance-id 'xxx' --start-time 'xxx' --end-time 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/redis_test.py b/testcases/generated/redis_test.py index 628670e..8fb5be7 100644 --- a/testcases/generated/redis_test.py +++ b/testcases/generated/redis_test.py @@ -23,6 +23,33 @@ class RedisTest(unittest.TestCase): + def test_describe_spec_config(self): + cmd = """python ../../main.py redis describe-spec-config """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_available_resource(self): + cmd = """python ../../main.py redis describe-available-resource """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_available_resource2(self): + cmd = """python ../../main.py redis describe-available-resource2 """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_cache_instances(self): cmd = """python ../../main.py redis describe-cache-instances """ with os.popen(cmd) as f: @@ -149,6 +176,24 @@ def test_describe_cache_analysis_result(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_client_list(self): + cmd = """python ../../main.py redis describe-client-list --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_client_ip_detail(self): + cmd = """python ../../main.py redis describe-client-ip-detail --cache-instance-id 'xxx' --ip 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_backups(self): cmd = """python ../../main.py redis describe-backups --cache-instance-id 'xxx'""" with os.popen(cmd) as f: @@ -239,6 +284,258 @@ def test_describe_slow_log(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_task_progress_list(self): + cmd = """python ../../main.py redis describe-task-progress-list --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_get_disable_commands(self): + cmd = """python ../../main.py redis get-disable-commands --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_set_disable_commands(self): + cmd = """python ../../main.py redis set-disable-commands --cache-instance-id 'xxx' --disable-commands '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_accounts(self): + cmd = """python ../../main.py redis describe-accounts --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_account(self): + cmd = """python ../../main.py redis create-account --cache-instance-id 'xxx' --account-name 'xxx' --account-password 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_account(self): + cmd = """python ../../main.py redis modify-account --cache-instance-id 'xxx' --account-name 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_account(self): + cmd = """python ../../main.py redis delete-account --cache-instance-id 'xxx' --account-name 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_accounts(self): + cmd = """python ../../main.py redis modify-accounts --cache-instance-id 'xxx' --accounts '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_start_clear_data(self): + cmd = """python ../../main.py redis start-clear-data --cache-instance-id 'xxx' --clear-type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_stop_clear_data(self): + cmd = """python ../../main.py redis stop-clear-data --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_clear_data(self): + cmd = """python ../../main.py redis describe-clear-data --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_big_key_list(self): + cmd = """python ../../main.py redis describe-big-key-list --cache-instance-id 'xxx' --date 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_big_key_analysis(self): + cmd = """python ../../main.py redis create-big-key-analysis --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_big_key_detail(self): + cmd = """python ../../main.py redis describe-big-key-detail --cache-instance-id 'xxx' --task-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_big_key_analysis_time(self): + cmd = """python ../../main.py redis describe-big-key-analysis-time --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_big_key_analysis_time(self): + cmd = """python ../../main.py redis modify-big-key-analysis-time --cache-instance-id 'xxx' --analysis-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_stop_cache_analysis(self): + cmd = """python ../../main.py redis stop-cache-analysis --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_analysis_threshold(self): + cmd = """python ../../main.py redis describe-analysis-threshold --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_analysis_threshold(self): + cmd = """python ../../main.py redis modify-analysis-threshold --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_big_key_analysis2(self): + cmd = """python ../../main.py redis create-big-key-analysis2 --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_big_key_list2(self): + cmd = """python ../../main.py redis describe-big-key-list2 --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_big_key_detail2(self): + cmd = """python ../../main.py redis describe-big-key-detail2 --cache-instance-id 'xxx' --task-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_big_key_analysis_time2(self): + cmd = """python ../../main.py redis describe-big-key-analysis-time2 --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_big_key_analysis_time2(self): + cmd = """python ../../main.py redis modify-big-key-analysis-time2 --cache-instance-id 'xxx' --analysis-time 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_analysis_threshold2(self): + cmd = """python ../../main.py redis describe-analysis-threshold2 --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_analysis_threshold2(self): + cmd = """python ../../main.py redis modify-analysis-threshold2 --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_hot_key_result2(self): + cmd = """python ../../main.py redis describe-hot-key-result2 --cache-instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_hot_key_detail2(self): + cmd = """python ../../main.py redis describe-hot-key-detail2 --cache-instance-id 'xxx' --node-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_instance_class(self): cmd = """python ../../main.py redis describe-instance-class """ with os.popen(cmd) as f: @@ -248,8 +545,8 @@ def test_describe_instance_class(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_user_quota(self): - cmd = """python ../../main.py redis describe-user-quota """ + def test_describe_available_region(self): + cmd = """python ../../main.py redis describe-available-region """ with os.popen(cmd) as f: content = f.read() @@ -257,8 +554,8 @@ def test_describe_user_quota(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_spec_config(self): - cmd = """python ../../main.py redis describe-spec-config """ + def test_describe_user_quota(self): + cmd = """python ../../main.py redis describe-user-quota """ with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/resourcetag_test.py b/testcases/generated/resourcetag_test.py index d5ed1e9..438b8e9 100644 --- a/testcases/generated/resourcetag_test.py +++ b/testcases/generated/resourcetag_test.py @@ -41,6 +41,24 @@ def test_describe_tags(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_keys(self): + cmd = """python ../../main.py resourcetag describe-keys --tag-keys-vo '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_values(self): + cmd = """python ../../main.py resourcetag describe-values --tag-values-vo '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_tag_resources(self): cmd = """python ../../main.py resourcetag tag-resources --tag-resources '{"":""}'""" with os.popen(cmd) as f: diff --git a/testcases/generated/sop_test.py b/testcases/generated/sop_test.py index efb1016..8b926bc 100644 --- a/testcases/generated/sop_test.py +++ b/testcases/generated/sop_test.py @@ -23,8 +23,8 @@ class SopTest(unittest.TestCase): - def test_get_security_token(self): - cmd = """python ../../main.py sop get-security-token --get-security-token-info '{"":""}'""" + def test_get_sensitive_op_setting(self): + cmd = """python ../../main.py sop get-sensitive-op-setting --action 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_get_security_token(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_sensitive_op_setting(self): - cmd = """python ../../main.py sop get-sensitive-op-setting --action 'xxx'""" + def test_get_security_token(self): + cmd = """python ../../main.py sop get-security-token --get-security-token-info '{"":""}'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/streamcomputer_test.py b/testcases/generated/streamcomputer_test.py index a0eae56..efda2c2 100644 --- a/testcases/generated/streamcomputer_test.py +++ b/testcases/generated/streamcomputer_test.py @@ -23,8 +23,8 @@ class StreamcomputerTest(unittest.TestCase): - def test_describe_job(self): - cmd = """python ../../main.py streamcomputer describe-job --job-id '5' --namespace-id '5'""" + def test_query_namespaces(self): + cmd = """python ../../main.py streamcomputer query-namespaces """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_job(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_or_update_job(self): - cmd = """python ../../main.py streamcomputer add-or-update-job --job-str '{"":""}'""" + def test_query_namespace_detail(self): + cmd = """python ../../main.py streamcomputer query-namespace-detail --namespace-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_add_or_update_job(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_job(self): - cmd = """python ../../main.py streamcomputer delete-job --namespace-id 'xxx' --job-id '5'""" + def test_create_namespace(self): + cmd = """python ../../main.py streamcomputer create-namespace --namespace-str '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_delete_job(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_job_list(self): - cmd = """python ../../main.py streamcomputer get-job-list --namespace-id 'xxx'""" + def test_update_namespace(self): + cmd = """python ../../main.py streamcomputer update-namespace --namespace-str '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_get_job_list(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_start_job(self): - cmd = """python ../../main.py streamcomputer start-job --namespace-id 'xxx' --job-id '5'""" + def test_delete_namespace(self): + cmd = """python ../../main.py streamcomputer delete-namespace --namespace-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_start_job(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_stop_job(self): - cmd = """python ../../main.py streamcomputer stop-job --namespace-id 'xxx' --job-id '5'""" + def test_describe_storage(self): + cmd = """python ../../main.py streamcomputer describe-storage --storage-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_stop_job(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_namespaces(self): - cmd = """python ../../main.py streamcomputer query-namespaces """ + def test_add_or_update_storage(self): + cmd = """python ../../main.py streamcomputer add-or-update-storage --storage-str '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_query_namespaces(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_namespace_detail(self): - cmd = """python ../../main.py streamcomputer query-namespace-detail --namespace-id '5'""" + def test_delete_storage(self): + cmd = """python ../../main.py streamcomputer delete-storage --storage-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_query_namespace_detail(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_namespace(self): - cmd = """python ../../main.py streamcomputer create-namespace --namespace-str '{"":""}'""" + def test_get_storage_list(self): + cmd = """python ../../main.py streamcomputer get-storage-list --storage-type 'xxx' --namespace-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_create_namespace(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_namespace(self): - cmd = """python ../../main.py streamcomputer update-namespace --namespace-str '{"":""}'""" + def test_describe_job(self): + cmd = """python ../../main.py streamcomputer describe-job --job-id '5' --namespace-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_update_namespace(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_namespace(self): - cmd = """python ../../main.py streamcomputer delete-namespace --namespace-id '5'""" + def test_add_or_update_job(self): + cmd = """python ../../main.py streamcomputer add-or-update-job --job-str '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_delete_namespace(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_storage(self): - cmd = """python ../../main.py streamcomputer describe-storage --storage-id '5'""" + def test_delete_job(self): + cmd = """python ../../main.py streamcomputer delete-job --namespace-id 'xxx' --job-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_describe_storage(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_or_update_storage(self): - cmd = """python ../../main.py streamcomputer add-or-update-storage --storage-str '{"":""}'""" + def test_get_job_list(self): + cmd = """python ../../main.py streamcomputer get-job-list --namespace-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_add_or_update_storage(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_storage(self): - cmd = """python ../../main.py streamcomputer delete-storage --storage-id '5'""" + def test_start_job(self): + cmd = """python ../../main.py streamcomputer start-job --namespace-id 'xxx' --job-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_delete_storage(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_storage_list(self): - cmd = """python ../../main.py streamcomputer get-storage-list --storage-type 'xxx' --namespace-id 'xxx'""" + def test_stop_job(self): + cmd = """python ../../main.py streamcomputer stop-job --namespace-id 'xxx' --job-id '5'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/vm_test.py b/testcases/generated/vm_test.py index a640a56..6f92878 100644 --- a/testcases/generated/vm_test.py +++ b/testcases/generated/vm_test.py @@ -23,6 +23,123 @@ class VmTest(unittest.TestCase): + def test_describe_instance_templates(self): + cmd = """python ../../main.py vm describe-instance-templates """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_instance_template(self): + cmd = """python ../../main.py vm create-instance-template --instance-template-data '{"":""}' --name 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_instance_template(self): + cmd = """python ../../main.py vm describe-instance-template --instance-template-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_instance_template(self): + cmd = """python ../../main.py vm update-instance-template --instance-template-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_instance_template(self): + cmd = """python ../../main.py vm delete-instance-template --instance-template-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_verify_instance_template(self): + cmd = """python ../../main.py vm verify-instance-template --instance-template-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_instance_templates_customdata(self): + cmd = """python ../../main.py vm describe-instance-templates-customdata """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_keypairs(self): + cmd = """python ../../main.py vm describe-keypairs """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_keypair(self): + cmd = """python ../../main.py vm create-keypair --key-name 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_import_keypair(self): + cmd = """python ../../main.py vm import-keypair --key-name 'xxx' --public-key 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_keypair(self): + cmd = """python ../../main.py vm delete-keypair --key-name 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_attach_keypair(self): + cmd = """python ../../main.py vm attach-keypair --key-name 'xxx' --pass-word-auth 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_detach_keypair(self): + cmd = """python ../../main.py vm detach-keypair --key-name 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_image(self): cmd = """python ../../main.py vm describe-image --image-id 'xxx'""" with os.popen(cmd) as f: @@ -150,7 +267,16 @@ def test_export_image(self): self.assertIsInstance(result, dict) def test_image_tasks(self): - cmd = """python ../../main.py vm image-tasks --task-action 'xxx'""" + cmd = """python ../../main.py vm image-tasks """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_quotas(self): + cmd = """python ../../main.py vm describe-quotas """ with os.popen(cmd) as f: content = f.read() @@ -267,7 +393,7 @@ def test_detach_network_interface(self): self.assertIsInstance(result, dict) def test_modify_instance_network_attribute(self): - cmd = """python ../../main.py vm modify-instance-network-attribute --instance-id 'xxx'""" + cmd = """python ../../main.py vm modify-instance-network-attribute --instance-id 'xxx' --networks '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -338,8 +464,8 @@ def test_modify_instance_attribute(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_instance_password(self): - cmd = """python ../../main.py vm modify-instance-password --instance-id 'xxx' --password 'xxx'""" + def test_modify_instance_vpc_attribute(self): + cmd = """python ../../main.py vm modify-instance-vpc-attribute --instance-id 'xxx' --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -347,35 +473,8 @@ def test_modify_instance_password(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instance_vnc_url(self): - cmd = """python ../../main.py vm describe-instance-vnc-url --instance-id 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_resize_instance(self): - cmd = """python ../../main.py vm resize-instance --instance-id 'xxx' --instance-type 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_rebuild_instance(self): - cmd = """python ../../main.py vm rebuild-instance --instance-id 'xxx' --password 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_describe_instance_templates(self): - cmd = """python ../../main.py vm describe-instance-templates """ + def test_modify_instance_password(self): + cmd = """python ../../main.py vm modify-instance-password --instance-id 'xxx' --password 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -383,8 +482,8 @@ def test_describe_instance_templates(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_instance_template(self): - cmd = """python ../../main.py vm create-instance-template --instance-template-data '{"":""}' --name 'xxx'""" + def test_describe_instance_vnc_url(self): + cmd = """python ../../main.py vm describe-instance-vnc-url --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -392,8 +491,8 @@ def test_create_instance_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_instance_template(self): - cmd = """python ../../main.py vm describe-instance-template --instance-template-id 'xxx'""" + def test_resize_instance(self): + cmd = """python ../../main.py vm resize-instance --instance-id 'xxx' --instance-type 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -401,8 +500,8 @@ def test_describe_instance_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_instance_template(self): - cmd = """python ../../main.py vm update-instance-template --instance-template-id 'xxx'""" + def test_rebuild_instance(self): + cmd = """python ../../main.py vm rebuild-instance --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -410,8 +509,8 @@ def test_update_instance_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_instance_template(self): - cmd = """python ../../main.py vm delete-instance-template --instance-template-id 'xxx'""" + def test_describe_instances_custom_data(self): + cmd = """python ../../main.py vm describe-instances-custom-data """ with os.popen(cmd) as f: content = f.read() @@ -419,8 +518,8 @@ def test_delete_instance_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_verify_instance_template(self): - cmd = """python ../../main.py vm verify-instance-template --instance-template-id 'xxx'""" + def test_modify_instance_placement(self): + cmd = """python ../../main.py vm modify-instance-placement --instance-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -437,48 +536,3 @@ def test_describe_instance_types(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_keypairs(self): - cmd = """python ../../main.py vm describe-keypairs """ - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_create_keypair(self): - cmd = """python ../../main.py vm create-keypair --key-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_import_keypair(self): - cmd = """python ../../main.py vm import-keypair --key-name 'xxx' --public-key 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_delete_keypair(self): - cmd = """python ../../main.py vm delete-keypair --key-name 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_describe_quotas(self): - cmd = """python ../../main.py vm describe-quotas """ - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - diff --git a/testcases/generated/vod_test.py b/testcases/generated/vod_test.py index f571304..5c018b6 100644 --- a/testcases/generated/vod_test.py +++ b/testcases/generated/vod_test.py @@ -23,8 +23,8 @@ class VodTest(unittest.TestCase): - def test_list_categories(self): - cmd = """python ../../main.py vod list-categories """ + def test_list_transcode_template_groups(self): + cmd = """python ../../main.py vod list-transcode-template-groups """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_list_categories(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_category(self): - cmd = """python ../../main.py vod create-category --name 'xxx'""" + def test_create_transcode_template_group(self): + cmd = """python ../../main.py vod create-transcode-template-group """ with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_create_category(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_category_with_children(self): - cmd = """python ../../main.py vod get-category-with-children --category-id '5'""" + def test_get_transcode_template_group(self): + cmd = """python ../../main.py vod get-transcode-template-group --group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_get_category_with_children(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_category(self): - cmd = """python ../../main.py vod get-category --category-id '5'""" + def test_update_transcode_template_group(self): + cmd = """python ../../main.py vod update-transcode-template-group --group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_get_category(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_category(self): - cmd = """python ../../main.py vod update-category --category-id '5'""" + def test_delete_transcode_template_group(self): + cmd = """python ../../main.py vod delete-transcode-template-group --group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,260 @@ def test_update_category(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_category(self): - cmd = """python ../../main.py vod delete-category --category-id '5'""" + def test_delete_grouped_transcode_templates(self): + cmd = """python ../../main.py vod delete-grouped-transcode-templates """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_list_quality_detection_templates(self): + cmd = """python ../../main.py vod list-quality-detection-templates """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_quality_detection_template(self): + cmd = """python ../../main.py vod create-quality-detection-template --name 'xxx' --template-type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_get_quality_detection_template(self): + cmd = """python ../../main.py vod get-quality-detection-template --template-id '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_quality_detection_template(self): + cmd = """python ../../main.py vod update-quality-detection-template --template-id '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_quality_detection_template(self): + cmd = """python ../../main.py vod delete-quality-detection-template --template-id '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_video_upload_task(self): + cmd = """python ../../main.py vod create-video-upload-task --title 'xxx' --file-name 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_refresh_video_upload_task(self): + cmd = """python ../../main.py vod refresh-video-upload-task --video-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_image_upload_task(self): + cmd = """python ../../main.py vod create-image-upload-task --file-name 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_live_to_vod_task(self): + cmd = """python ../../main.py vod create-live-to-vod-task --title 'xxx' --file-name 'xxx' --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx' --record-times '[{"":""}]' --record-file-type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_list_videos(self): + cmd = """python ../../main.py vod list-videos """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_get_video(self): + cmd = """python ../../main.py vod get-video --video-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_video(self): + cmd = """python ../../main.py vod update-video --video-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_video(self): + cmd = """python ../../main.py vod delete-video --video-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_batch_delete_videos(self): + cmd = """python ../../main.py vod batch-delete-videos """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_batch_update_videos(self): + cmd = """python ../../main.py vod batch-update-videos --bulk-items '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_get_video_play_info(self): + cmd = """python ../../main.py vod get-video-play-info --video-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_video_streams(self): + cmd = """python ../../main.py vod delete-video-streams --video-id 'xxx' --task-ids '[5]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_video_audit(self): + cmd = """python ../../main.py vod video-audit --video-id 'xxx' --audit-result 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_get_video_source_info(self): + cmd = """python ../../main.py vod get-video-source-info --video-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_submit_quality_detection_job(self): + cmd = """python ../../main.py vod submit-quality-detection-job """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_batch_submit_quality_detection_jobs(self): + cmd = """python ../../main.py vod batch-submit-quality-detection-jobs """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_vedit_job(self): + cmd = """python ../../main.py vod create-vedit-job --project-name 'xxx' --timeline '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_submit_vedit_job(self): + cmd = """python ../../main.py vod submit-vedit-job --project-id '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_list_vedit_projects(self): + cmd = """python ../../main.py vod list-vedit-projects """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_vedit_project(self): + cmd = """python ../../main.py vod create-vedit-project --project-name 'xxx' --timeline '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_get_vedit_project(self): + cmd = """python ../../main.py vod get-vedit-project --project-id '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_update_vedit_project(self): + cmd = """python ../../main.py vod update-vedit-project --project-id '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_vedit_project(self): + cmd = """python ../../main.py vod delete-vedit-project --project-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -239,17 +491,8 @@ def test_get_http_ssl(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_live_to_vod_task(self): - cmd = """python ../../main.py vod create-live-to-vod-task --title 'xxx' --file-name 'xxx' --publish-domain 'xxx' --app-name 'xxx' --stream-name 'xxx' --record-times '[{"":""}]' --record-file-type 'xxx'""" - with os.popen(cmd) as f: - content = f.read() - - print(content) - result = json.loads(content) - self.assertIsInstance(result, dict) - - def test_create_video_upload_task(self): - cmd = """python ../../main.py vod create-video-upload-task --title 'xxx' --file-name 'xxx'""" + def test_list_categories(self): + cmd = """python ../../main.py vod list-categories """ with os.popen(cmd) as f: content = f.read() @@ -257,8 +500,8 @@ def test_create_video_upload_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_refresh_video_upload_task(self): - cmd = """python ../../main.py vod refresh-video-upload-task --video-id 'xxx'""" + def test_create_category(self): + cmd = """python ../../main.py vod create-category --name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -266,8 +509,8 @@ def test_refresh_video_upload_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_image_upload_task(self): - cmd = """python ../../main.py vod create-image-upload-task --file-name 'xxx'""" + def test_list_all_categories(self): + cmd = """python ../../main.py vod list-all-categories """ with os.popen(cmd) as f: content = f.read() @@ -275,8 +518,8 @@ def test_create_image_upload_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_submit_quality_detection_job(self): - cmd = """python ../../main.py vod submit-quality-detection-job """ + def test_get_category_with_children(self): + cmd = """python ../../main.py vod get-category-with-children --category-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -284,8 +527,8 @@ def test_submit_quality_detection_job(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_batch_submit_quality_detection_jobs(self): - cmd = """python ../../main.py vod batch-submit-quality-detection-jobs """ + def test_get_category(self): + cmd = """python ../../main.py vod get-category --category-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -293,8 +536,8 @@ def test_batch_submit_quality_detection_jobs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_quality_detection_templates(self): - cmd = """python ../../main.py vod list-quality-detection-templates """ + def test_update_category(self): + cmd = """python ../../main.py vod update-category --category-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -302,8 +545,8 @@ def test_list_quality_detection_templates(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_quality_detection_template(self): - cmd = """python ../../main.py vod create-quality-detection-template --name 'xxx' --template-type 'xxx'""" + def test_delete_category(self): + cmd = """python ../../main.py vod delete-category --category-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -311,8 +554,8 @@ def test_create_quality_detection_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_quality_detection_template(self): - cmd = """python ../../main.py vod get-quality-detection-template --template-id '5'""" + def test_submit_snapshot_task(self): + cmd = """python ../../main.py vod submit-snapshot-task """ with os.popen(cmd) as f: content = f.read() @@ -320,8 +563,8 @@ def test_get_quality_detection_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_quality_detection_template(self): - cmd = """python ../../main.py vod update-quality-detection-template --template-id '5'""" + def test_list_snapshot_tasks(self): + cmd = """python ../../main.py vod list-snapshot-tasks """ with os.popen(cmd) as f: content = f.read() @@ -329,8 +572,8 @@ def test_update_quality_detection_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_quality_detection_template(self): - cmd = """python ../../main.py vod delete-quality-detection-template --template-id '5'""" + def test_list_transcode_templates(self): + cmd = """python ../../main.py vod list-transcode-templates """ with os.popen(cmd) as f: content = f.read() @@ -338,8 +581,8 @@ def test_delete_quality_detection_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_submit_transcode_job(self): - cmd = """python ../../main.py vod submit-transcode-job """ + def test_create_transcode_template(self): + cmd = """python ../../main.py vod create-transcode-template --name 'xxx' --video '{"":""}' --audio '{"":""}' --encapsulation '{"":""}' --definition 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -347,8 +590,8 @@ def test_submit_transcode_job(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_batch_submit_transcode_jobs(self): - cmd = """python ../../main.py vod batch-submit-transcode-jobs """ + def test_get_transcode_template(self): + cmd = """python ../../main.py vod get-transcode-template --template-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -356,8 +599,8 @@ def test_batch_submit_transcode_jobs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_transcode_templates(self): - cmd = """python ../../main.py vod list-transcode-templates """ + def test_update_transcode_template(self): + cmd = """python ../../main.py vod update-transcode-template --template-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -365,8 +608,8 @@ def test_list_transcode_templates(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_transcode_template(self): - cmd = """python ../../main.py vod create-transcode-template --name 'xxx' --video '{"":""}' --audio '{"":""}' --encapsulation '{"":""}' --definition 'xxx'""" + def test_delete_transcode_template(self): + cmd = """python ../../main.py vod delete-transcode-template --template-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -374,8 +617,8 @@ def test_create_transcode_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_transcode_template(self): - cmd = """python ../../main.py vod get-transcode-template --template-id '5'""" + def test_list_snapshot_templates(self): + cmd = """python ../../main.py vod list-snapshot-templates """ with os.popen(cmd) as f: content = f.read() @@ -383,8 +626,8 @@ def test_get_transcode_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_transcode_template(self): - cmd = """python ../../main.py vod update-transcode-template --template-id '5'""" + def test_create_snapshot_template(self): + cmd = """python ../../main.py vod create-snapshot-template --template-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -392,8 +635,8 @@ def test_update_transcode_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_transcode_template(self): - cmd = """python ../../main.py vod delete-transcode-template --template-id '5'""" + def test_get_snapshot_template(self): + cmd = """python ../../main.py vod get-snapshot-template --template-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -401,8 +644,8 @@ def test_delete_transcode_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_videos(self): - cmd = """python ../../main.py vod list-videos """ + def test_update_snapshot_template(self): + cmd = """python ../../main.py vod update-snapshot-template --template-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -410,8 +653,8 @@ def test_list_videos(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_video(self): - cmd = """python ../../main.py vod get-video --video-id 'xxx'""" + def test_delete_snapshot_template(self): + cmd = """python ../../main.py vod delete-snapshot-template --template-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -419,8 +662,8 @@ def test_get_video(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_video(self): - cmd = """python ../../main.py vod update-video --video-id 'xxx'""" + def test_submit_transcode_job(self): + cmd = """python ../../main.py vod submit-transcode-job """ with os.popen(cmd) as f: content = f.read() @@ -428,8 +671,8 @@ def test_update_video(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_video(self): - cmd = """python ../../main.py vod delete-video --video-id 'xxx'""" + def test_batch_submit_transcode_jobs(self): + cmd = """python ../../main.py vod batch-submit-transcode-jobs """ with os.popen(cmd) as f: content = f.read() @@ -437,8 +680,8 @@ def test_delete_video(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_batch_delete_videos(self): - cmd = """python ../../main.py vod batch-delete-videos """ + def test_get_transcode_summaries(self): + cmd = """python ../../main.py vod get-transcode-summaries """ with os.popen(cmd) as f: content = f.read() @@ -446,8 +689,8 @@ def test_batch_delete_videos(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_batch_update_videos(self): - cmd = """python ../../main.py vod batch-update-videos --bulk-items '[{"":""}]'""" + def test_get_transcode_job_summaries(self): + cmd = """python ../../main.py vod get-transcode-job-summaries """ with os.popen(cmd) as f: content = f.read() @@ -455,8 +698,8 @@ def test_batch_update_videos(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_video_play_info(self): - cmd = """python ../../main.py vod get-video-play-info --video-id 'xxx'""" + def test_get_transcode_task_summaries(self): + cmd = """python ../../main.py vod get-transcode-task-summaries """ with os.popen(cmd) as f: content = f.read() @@ -464,8 +707,8 @@ def test_get_video_play_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_video_streams(self): - cmd = """python ../../main.py vod delete-video-streams --video-id 'xxx' --task-ids '[5]'""" + def test_list_watermarks(self): + cmd = """python ../../main.py vod list-watermarks """ with os.popen(cmd) as f: content = f.read() @@ -473,8 +716,8 @@ def test_delete_video_streams(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_video_audit(self): - cmd = """python ../../main.py vod video-audit --video-id 'xxx' --audit-result 'xxx'""" + def test_create_watermark(self): + cmd = """python ../../main.py vod create-watermark --name 'xxx' --img-url 'xxx' --width 'xxx' --height 'xxx' --position 'xxx' --offset-x 'xxx' --offset-y 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -482,8 +725,8 @@ def test_video_audit(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_watermarks(self): - cmd = """python ../../main.py vod list-watermarks """ + def test_get_watermark(self): + cmd = """python ../../main.py vod get-watermark --watermark-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -491,8 +734,8 @@ def test_list_watermarks(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_watermark(self): - cmd = """python ../../main.py vod create-watermark --name 'xxx' --img-url 'xxx' --width 'xxx' --height 'xxx' --position 'xxx' --offset-x 'xxx' --offset-y 'xxx'""" + def test_update_watermark(self): + cmd = """python ../../main.py vod update-watermark --watermark-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -500,8 +743,8 @@ def test_create_watermark(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_watermark(self): - cmd = """python ../../main.py vod get-watermark --watermark-id '5'""" + def test_delete_watermark(self): + cmd = """python ../../main.py vod delete-watermark --watermark-id '5'""" with os.popen(cmd) as f: content = f.read() @@ -509,8 +752,8 @@ def test_get_watermark(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_watermark(self): - cmd = """python ../../main.py vod update-watermark --watermark-id '5'""" + def test_submit_transcode_job(self): + cmd = """python ../../main.py vod submit-transcode-job """ with os.popen(cmd) as f: content = f.read() @@ -518,8 +761,8 @@ def test_update_watermark(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_watermark(self): - cmd = """python ../../main.py vod delete-watermark --watermark-id '5'""" + def test_batch_submit_transcode_jobs(self): + cmd = """python ../../main.py vod batch-submit-transcode-jobs """ with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/vpc_test.py b/testcases/generated/vpc_test.py index 968612a..fcf0d69 100644 --- a/testcases/generated/vpc_test.py +++ b/testcases/generated/vpc_test.py @@ -23,8 +23,8 @@ class VpcTest(unittest.TestCase): - def test_describe_elastic_ips(self): - cmd = """python ../../main.py vpc describe-elastic-ips """ + def test_describe_vpc_peerings(self): + cmd = """python ../../main.py vpc describe-vpc-peerings """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_elastic_ips(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_elastic_ips(self): - cmd = """python ../../main.py vpc create-elastic-ips --max-count '5' --elastic-ip-spec '{"":""}'""" + def test_create_vpc_peering(self): + cmd = """python ../../main.py vpc create-vpc-peering --vpc-peering-name 'xxx' --vpc-id 'xxx' --remote-vpc-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_create_elastic_ips(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_elastic_ip(self): - cmd = """python ../../main.py vpc describe-elastic-ip --elastic-ip-id 'xxx'""" + def test_describe_vpc_peering(self): + cmd = """python ../../main.py vpc describe-vpc-peering --vpc-peering-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_describe_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_elastic_ip(self): - cmd = """python ../../main.py vpc modify-elastic-ip --elastic-ip-id 'xxx' --bandwidth-mbps '5'""" + def test_modify_vpc_peering(self): + cmd = """python ../../main.py vpc modify-vpc-peering --vpc-peering-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_modify_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_elastic_ip(self): - cmd = """python ../../main.py vpc delete-elastic-ip --elastic-ip-id 'xxx'""" + def test_delete_vpc_peering(self): + cmd = """python ../../main.py vpc delete-vpc-peering --vpc-peering-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_delete_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_network_acls(self): - cmd = """python ../../main.py vpc describe-network-acls """ + def test_describe_route_tables(self): + cmd = """python ../../main.py vpc describe-route-tables """ with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_describe_network_acls(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_network_acl(self): - cmd = """python ../../main.py vpc create-network-acl --vpc-id 'xxx' --network-acl-name 'xxx'""" + def test_create_route_table(self): + cmd = """python ../../main.py vpc create-route-table --vpc-id 'xxx' --route-table-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_create_network_acl(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_network_acl(self): - cmd = """python ../../main.py vpc describe-network-acl --network-acl-id 'xxx'""" + def test_describe_route_table(self): + cmd = """python ../../main.py vpc describe-route-table --route-table-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_describe_network_acl(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_network_acl(self): - cmd = """python ../../main.py vpc modify-network-acl --network-acl-id 'xxx'""" + def test_modify_route_table(self): + cmd = """python ../../main.py vpc modify-route-table --route-table-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_modify_network_acl(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_network_acl(self): - cmd = """python ../../main.py vpc delete-network-acl --network-acl-id 'xxx'""" + def test_delete_route_table(self): + cmd = """python ../../main.py vpc delete-route-table --route-table-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_delete_network_acl(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_associate_network_acl(self): - cmd = """python ../../main.py vpc associate-network-acl --network-acl-id 'xxx'""" + def test_add_route_table_rules(self): + cmd = """python ../../main.py vpc add-route-table-rules --route-table-id 'xxx' --route-table-rule-specs '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_associate_network_acl(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disassociate_network_acl(self): - cmd = """python ../../main.py vpc disassociate-network-acl --network-acl-id 'xxx' --subnet-id 'xxx'""" + def test_remove_route_table_rules(self): + cmd = """python ../../main.py vpc remove-route-table-rules --route-table-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_disassociate_network_acl(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_network_acl_rules(self): - cmd = """python ../../main.py vpc add-network-acl-rules --network-acl-id 'xxx' --network-acl-rule-specs '[{"":""}]'""" + def test_modify_route_table_rules(self): + cmd = """python ../../main.py vpc modify-route-table-rules --route-table-id 'xxx' --modify-route-table-rule-specs '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_add_network_acl_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_remove_network_acl_rules(self): - cmd = """python ../../main.py vpc remove-network-acl-rules --network-acl-id 'xxx'""" + def test_associate_route_table(self): + cmd = """python ../../main.py vpc associate-route-table --route-table-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_remove_network_acl_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_network_acl_rules(self): - cmd = """python ../../main.py vpc modify-network-acl-rules --network-acl-id 'xxx' --modify-network-acl-rule-specs '[{"":""}]'""" + def test_disassociate_route_table(self): + cmd = """python ../../main.py vpc disassociate-route-table --route-table-id 'xxx' --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_modify_network_acl_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_network_interfaces(self): - cmd = """python ../../main.py vpc describe-network-interfaces """ + def test_describe_subnets(self): + cmd = """python ../../main.py vpc describe-subnets """ with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_describe_network_interfaces(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_network_interface(self): - cmd = """python ../../main.py vpc create-network-interface --subnet-id 'xxx'""" + def test_create_subnet(self): + cmd = """python ../../main.py vpc create-subnet --vpc-id 'xxx' --subnet-name 'xxx' --address-prefix 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_create_network_interface(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_network_interface(self): - cmd = """python ../../main.py vpc describe-network-interface --network-interface-id 'xxx'""" + def test_describe_subnet(self): + cmd = """python ../../main.py vpc describe-subnet --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -185,8 +185,8 @@ def test_describe_network_interface(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_network_interface(self): - cmd = """python ../../main.py vpc modify-network-interface --network-interface-id 'xxx'""" + def test_modify_subnet(self): + cmd = """python ../../main.py vpc modify-subnet --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -194,8 +194,8 @@ def test_modify_network_interface(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_network_interface(self): - cmd = """python ../../main.py vpc delete-network-interface --network-interface-id 'xxx'""" + def test_delete_subnet(self): + cmd = """python ../../main.py vpc delete-subnet --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -203,8 +203,8 @@ def test_delete_network_interface(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_associate_elastic_ip(self): - cmd = """python ../../main.py vpc associate-elastic-ip --network-interface-id 'xxx'""" + def test_describe_network_acls(self): + cmd = """python ../../main.py vpc describe-network-acls """ with os.popen(cmd) as f: content = f.read() @@ -212,8 +212,8 @@ def test_associate_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disassociate_elastic_ip(self): - cmd = """python ../../main.py vpc disassociate-elastic-ip --network-interface-id 'xxx'""" + def test_create_network_acl(self): + cmd = """python ../../main.py vpc create-network-acl --vpc-id 'xxx' --network-acl-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -221,8 +221,8 @@ def test_disassociate_elastic_ip(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_assign_secondary_ips(self): - cmd = """python ../../main.py vpc assign-secondary-ips --network-interface-id 'xxx'""" + def test_describe_network_acl(self): + cmd = """python ../../main.py vpc describe-network-acl --network-acl-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -230,8 +230,8 @@ def test_assign_secondary_ips(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_unassign_secondary_ips(self): - cmd = """python ../../main.py vpc unassign-secondary-ips --network-interface-id 'xxx'""" + def test_modify_network_acl(self): + cmd = """python ../../main.py vpc modify-network-acl --network-acl-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -239,8 +239,8 @@ def test_unassign_secondary_ips(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_network_security_groups(self): - cmd = """python ../../main.py vpc describe-network-security-groups """ + def test_delete_network_acl(self): + cmd = """python ../../main.py vpc delete-network-acl --network-acl-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -248,8 +248,8 @@ def test_describe_network_security_groups(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_network_security_group(self): - cmd = """python ../../main.py vpc create-network-security-group --vpc-id 'xxx' --network-security-group-name 'xxx'""" + def test_associate_network_acl(self): + cmd = """python ../../main.py vpc associate-network-acl --network-acl-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -257,8 +257,8 @@ def test_create_network_security_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_network_security_group(self): - cmd = """python ../../main.py vpc describe-network-security-group --network-security-group-id 'xxx'""" + def test_disassociate_network_acl(self): + cmd = """python ../../main.py vpc disassociate-network-acl --network-acl-id 'xxx' --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -266,8 +266,8 @@ def test_describe_network_security_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_network_security_group(self): - cmd = """python ../../main.py vpc modify-network-security-group --network-security-group-id 'xxx'""" + def test_add_network_acl_rules(self): + cmd = """python ../../main.py vpc add-network-acl-rules --network-acl-id 'xxx' --network-acl-rule-specs '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -275,8 +275,8 @@ def test_modify_network_security_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_network_security_group(self): - cmd = """python ../../main.py vpc delete-network-security-group --network-security-group-id 'xxx'""" + def test_remove_network_acl_rules(self): + cmd = """python ../../main.py vpc remove-network-acl-rules --network-acl-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -284,8 +284,8 @@ def test_delete_network_security_group(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_network_security_group_rules(self): - cmd = """python ../../main.py vpc add-network-security-group-rules --network-security-group-id 'xxx' --network-security-group-rule-specs '[{"":""}]'""" + def test_modify_network_acl_rules(self): + cmd = """python ../../main.py vpc modify-network-acl-rules --network-acl-id 'xxx' --modify-network-acl-rule-specs '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -293,8 +293,8 @@ def test_add_network_security_group_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_remove_network_security_group_rules(self): - cmd = """python ../../main.py vpc remove-network-security-group-rules --network-security-group-id 'xxx'""" + def test_describe_vpcs(self): + cmd = """python ../../main.py vpc describe-vpcs """ with os.popen(cmd) as f: content = f.read() @@ -302,8 +302,8 @@ def test_remove_network_security_group_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_network_security_group_rules(self): - cmd = """python ../../main.py vpc modify-network-security-group-rules --network-security-group-id 'xxx' --modify-security-group-rule-specs '[{"":""}]'""" + def test_create_vpc(self): + cmd = """python ../../main.py vpc create-vpc --vpc-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -311,8 +311,8 @@ def test_modify_network_security_group_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_quota(self): - cmd = """python ../../main.py vpc describe-quota --type 'xxx'""" + def test_describe_vpc(self): + cmd = """python ../../main.py vpc describe-vpc --vpc-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -320,8 +320,8 @@ def test_describe_quota(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_route_tables(self): - cmd = """python ../../main.py vpc describe-route-tables """ + def test_modify_vpc(self): + cmd = """python ../../main.py vpc modify-vpc --vpc-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -329,8 +329,8 @@ def test_describe_route_tables(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_route_table(self): - cmd = """python ../../main.py vpc create-route-table --vpc-id 'xxx' --route-table-name 'xxx'""" + def test_delete_vpc(self): + cmd = """python ../../main.py vpc delete-vpc --vpc-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -338,8 +338,8 @@ def test_create_route_table(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_route_table(self): - cmd = """python ../../main.py vpc describe-route-table --route-table-id 'xxx'""" + def test_describe_network_interfaces(self): + cmd = """python ../../main.py vpc describe-network-interfaces """ with os.popen(cmd) as f: content = f.read() @@ -347,8 +347,8 @@ def test_describe_route_table(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_route_table(self): - cmd = """python ../../main.py vpc modify-route-table --route-table-id 'xxx'""" + def test_create_network_interface(self): + cmd = """python ../../main.py vpc create-network-interface --subnet-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -356,8 +356,8 @@ def test_modify_route_table(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_route_table(self): - cmd = """python ../../main.py vpc delete-route-table --route-table-id 'xxx'""" + def test_describe_network_interface(self): + cmd = """python ../../main.py vpc describe-network-interface --network-interface-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -365,8 +365,8 @@ def test_delete_route_table(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_add_route_table_rules(self): - cmd = """python ../../main.py vpc add-route-table-rules --route-table-id 'xxx' --route-table-rule-specs '[{"":""}]'""" + def test_modify_network_interface(self): + cmd = """python ../../main.py vpc modify-network-interface --network-interface-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -374,8 +374,8 @@ def test_add_route_table_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_remove_route_table_rules(self): - cmd = """python ../../main.py vpc remove-route-table-rules --route-table-id 'xxx'""" + def test_delete_network_interface(self): + cmd = """python ../../main.py vpc delete-network-interface --network-interface-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -383,8 +383,8 @@ def test_remove_route_table_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_route_table_rules(self): - cmd = """python ../../main.py vpc modify-route-table-rules --route-table-id 'xxx' --modify-route-table-rule-specs '[{"":""}]'""" + def test_associate_elastic_ip(self): + cmd = """python ../../main.py vpc associate-elastic-ip --network-interface-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -392,8 +392,8 @@ def test_modify_route_table_rules(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_associate_route_table(self): - cmd = """python ../../main.py vpc associate-route-table --route-table-id 'xxx'""" + def test_disassociate_elastic_ip(self): + cmd = """python ../../main.py vpc disassociate-elastic-ip --network-interface-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -401,8 +401,8 @@ def test_associate_route_table(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_disassociate_route_table(self): - cmd = """python ../../main.py vpc disassociate-route-table --route-table-id 'xxx' --subnet-id 'xxx'""" + def test_assign_secondary_ips(self): + cmd = """python ../../main.py vpc assign-secondary-ips --network-interface-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -410,8 +410,8 @@ def test_disassociate_route_table(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_edge_ip_providers(self): - cmd = """python ../../main.py vpc describe-edge-ip-providers """ + def test_unassign_secondary_ips(self): + cmd = """python ../../main.py vpc unassign-secondary-ips --network-interface-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -419,8 +419,8 @@ def test_describe_edge_ip_providers(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_subnets(self): - cmd = """python ../../main.py vpc describe-subnets """ + def test_describe_bandwidth_packages(self): + cmd = """python ../../main.py vpc describe-bandwidth-packages """ with os.popen(cmd) as f: content = f.read() @@ -428,8 +428,8 @@ def test_describe_subnets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_subnet(self): - cmd = """python ../../main.py vpc create-subnet --vpc-id 'xxx' --subnet-name 'xxx' --address-prefix 'xxx'""" + def test_create_bandwidth_package(self): + cmd = """python ../../main.py vpc create-bandwidth-package --name 'xxx' --bandwidth-mbps '5'""" with os.popen(cmd) as f: content = f.read() @@ -437,8 +437,8 @@ def test_create_subnet(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_subnet(self): - cmd = """python ../../main.py vpc describe-subnet --subnet-id 'xxx'""" + def test_describe_bandwidth_package(self): + cmd = """python ../../main.py vpc describe-bandwidth-package --bandwidth-package-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -446,8 +446,8 @@ def test_describe_subnet(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_subnet(self): - cmd = """python ../../main.py vpc modify-subnet --subnet-id 'xxx'""" + def test_modify_bandwidth_package(self): + cmd = """python ../../main.py vpc modify-bandwidth-package --bandwidth-package-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -455,8 +455,8 @@ def test_modify_subnet(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_subnet(self): - cmd = """python ../../main.py vpc delete-subnet --subnet-id 'xxx'""" + def test_delete_bandwidth_package(self): + cmd = """python ../../main.py vpc delete-bandwidth-package --bandwidth-package-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -464,8 +464,8 @@ def test_delete_subnet(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_vpcs(self): - cmd = """python ../../main.py vpc describe-vpcs """ + def test_add_bandwidth_package_ip(self): + cmd = """python ../../main.py vpc add-bandwidth-package-ip --bandwidth-package-id 'xxx' --bandwidth-package-ipspecs '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -473,8 +473,8 @@ def test_describe_vpcs(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_vpc(self): - cmd = """python ../../main.py vpc create-vpc --vpc-name 'xxx'""" + def test_remove_bandwidth_package_ip(self): + cmd = """python ../../main.py vpc remove-bandwidth-package-ip --bandwidth-package-id 'xxx' --bandwidth-package-ipspecs '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -482,8 +482,8 @@ def test_create_vpc(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_vpc(self): - cmd = """python ../../main.py vpc describe-vpc --vpc-id 'xxx'""" + def test_modify_bandwidth_package_ip_bandwidth(self): + cmd = """python ../../main.py vpc modify-bandwidth-package-ip-bandwidth --bandwidth-package-id 'xxx' --bandwidth-package-ipspecs '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -491,8 +491,8 @@ def test_describe_vpc(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_vpc(self): - cmd = """python ../../main.py vpc modify-vpc --vpc-id 'xxx'""" + def test_describe_network_security_groups(self): + cmd = """python ../../main.py vpc describe-network-security-groups """ with os.popen(cmd) as f: content = f.read() @@ -500,8 +500,8 @@ def test_modify_vpc(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vpc(self): - cmd = """python ../../main.py vpc delete-vpc --vpc-id 'xxx'""" + def test_create_network_security_group(self): + cmd = """python ../../main.py vpc create-network-security-group --vpc-id 'xxx' --network-security-group-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -509,8 +509,8 @@ def test_delete_vpc(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_vpc_peerings(self): - cmd = """python ../../main.py vpc describe-vpc-peerings """ + def test_describe_network_security_group(self): + cmd = """python ../../main.py vpc describe-network-security-group --network-security-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -518,8 +518,8 @@ def test_describe_vpc_peerings(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_vpc_peering(self): - cmd = """python ../../main.py vpc create-vpc-peering --vpc-peering-name 'xxx' --vpc-id 'xxx' --remote-vpc-id 'xxx'""" + def test_modify_network_security_group(self): + cmd = """python ../../main.py vpc modify-network-security-group --network-security-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -527,8 +527,8 @@ def test_create_vpc_peering(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_vpc_peering(self): - cmd = """python ../../main.py vpc describe-vpc-peering --vpc-peering-id 'xxx'""" + def test_delete_network_security_group(self): + cmd = """python ../../main.py vpc delete-network-security-group --network-security-group-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -536,8 +536,8 @@ def test_describe_vpc_peering(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_vpc_peering(self): - cmd = """python ../../main.py vpc modify-vpc-peering --vpc-peering-id 'xxx'""" + def test_add_network_security_group_rules(self): + cmd = """python ../../main.py vpc add-network-security-group-rules --network-security-group-id 'xxx' --network-security-group-rule-specs '[{"":""}]'""" with os.popen(cmd) as f: content = f.read() @@ -545,8 +545,80 @@ def test_modify_vpc_peering(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vpc_peering(self): - cmd = """python ../../main.py vpc delete-vpc-peering --vpc-peering-id 'xxx'""" + def test_remove_network_security_group_rules(self): + cmd = """python ../../main.py vpc remove-network-security-group-rules --network-security-group-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_network_security_group_rules(self): + cmd = """python ../../main.py vpc modify-network-security-group-rules --network-security-group-id 'xxx' --modify-security-group-rule-specs '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_quota(self): + cmd = """python ../../main.py vpc describe-quota --type 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_elastic_ips(self): + cmd = """python ../../main.py vpc describe-elastic-ips """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_elastic_ips(self): + cmd = """python ../../main.py vpc create-elastic-ips --max-count '5' --elastic-ip-spec '{"":""}'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_elastic_ip(self): + cmd = """python ../../main.py vpc describe-elastic-ip --elastic-ip-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_modify_elastic_ip(self): + cmd = """python ../../main.py vpc modify-elastic-ip --elastic-ip-id 'xxx' --bandwidth-mbps '5'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_elastic_ip(self): + cmd = """python ../../main.py vpc delete-elastic-ip --elastic-ip-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_edge_ip_providers(self): + cmd = """python ../../main.py vpc describe-edge-ip-providers """ with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/vqd_test.py b/testcases/generated/vqd_test.py index e8d1d97..6302c51 100644 --- a/testcases/generated/vqd_test.py +++ b/testcases/generated/vqd_test.py @@ -41,8 +41,8 @@ def test_query_callback(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_submit_vqd_task(self): - cmd = """python ../../main.py vqd submit-vqd-task --media '{"":""}' --template-id 'xxx'""" + def test_list_vqd_templates(self): + cmd = """python ../../main.py vqd list-vqd-templates """ with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_submit_vqd_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_batch_submit_vqd_tasks(self): - cmd = """python ../../main.py vqd batch-submit-vqd-tasks --media-list '[{"":""}]' --template-id 'xxx'""" + def test_create_vqd_template(self): + cmd = """python ../../main.py vqd create-vqd-template --template-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_batch_submit_vqd_tasks(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_vqd_tasks(self): - cmd = """python ../../main.py vqd list-vqd-tasks """ + def test_get_vqd_template(self): + cmd = """python ../../main.py vqd get-vqd-template --template-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_list_vqd_tasks(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vqd_task(self): - cmd = """python ../../main.py vqd get-vqd-task --task-id 'xxx'""" + def test_update_vqd_template(self): + cmd = """python ../../main.py vqd update-vqd-template --template-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_get_vqd_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vqd_task(self): - cmd = """python ../../main.py vqd delete-vqd-task --task-id 'xxx'""" + def test_delete_vqd_template(self): + cmd = """python ../../main.py vqd delete-vqd-template --template-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_delete_vqd_task(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_query_vqd_task_result(self): - cmd = """python ../../main.py vqd query-vqd-task-result --task-id 'xxx'""" + def test_submit_vqd_task(self): + cmd = """python ../../main.py vqd submit-vqd-task --media '{"":""}' --template-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_query_vqd_task_result(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_batch_delete_vqd_tasks(self): - cmd = """python ../../main.py vqd batch-delete-vqd-tasks """ + def test_batch_submit_vqd_tasks(self): + cmd = """python ../../main.py vqd batch-submit-vqd-tasks --media-list '[{"":""}]' --template-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -104,8 +104,8 @@ def test_batch_delete_vqd_tasks(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_vqd_templates(self): - cmd = """python ../../main.py vqd list-vqd-templates """ + def test_list_vqd_tasks(self): + cmd = """python ../../main.py vqd list-vqd-tasks """ with os.popen(cmd) as f: content = f.read() @@ -113,8 +113,8 @@ def test_list_vqd_templates(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_vqd_template(self): - cmd = """python ../../main.py vqd create-vqd-template --template-name 'xxx'""" + def test_get_vqd_task(self): + cmd = """python ../../main.py vqd get-vqd-task --task-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -122,8 +122,8 @@ def test_create_vqd_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_vqd_template(self): - cmd = """python ../../main.py vqd get-vqd-template --template-id 'xxx'""" + def test_delete_vqd_task(self): + cmd = """python ../../main.py vqd delete-vqd-task --task-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -131,8 +131,8 @@ def test_get_vqd_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_update_vqd_template(self): - cmd = """python ../../main.py vqd update-vqd-template --template-id 'xxx'""" + def test_query_vqd_task_result(self): + cmd = """python ../../main.py vqd query-vqd-task-result --task-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -140,8 +140,8 @@ def test_update_vqd_template(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_vqd_template(self): - cmd = """python ../../main.py vqd delete-vqd-template --template-id 'xxx'""" + def test_batch_delete_vqd_tasks(self): + cmd = """python ../../main.py vqd batch-delete-vqd-tasks """ with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/xdata_test.py b/testcases/generated/xdata_test.py index 3b877f7..e983810 100644 --- a/testcases/generated/xdata_test.py +++ b/testcases/generated/xdata_test.py @@ -23,8 +23,8 @@ class XdataTest(unittest.TestCase): - def test_list_database_info(self): - cmd = """python ../../main.py xdata list-database-info --instance-name 'xxx'""" + def test_list_instance_info(self): + cmd = """python ../../main.py xdata list-instance-info """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_list_database_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_database_info(self): - cmd = """python ../../main.py xdata get-database-info --database-name 'xxx' --instance-name 'xxx'""" + def test_list_table_info(self): + cmd = """python ../../main.py xdata list-table-info --instance-name 'xxx' --database-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_get_database_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_database(self): - cmd = """python ../../main.py xdata create-database --database-name 'xxx' --instance-name 'xxx'""" + def test_create_table(self): + cmd = """python ../../main.py xdata create-table --instance-name 'xxx' --db-model-dbtable '{"":""}'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_create_database(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_database(self): - cmd = """python ../../main.py xdata delete-database --database-name 'xxx' --instance-name 'xxx'""" + def test_get_table_info(self): + cmd = """python ../../main.py xdata get-table-info --table-name 'xxx' --instance-name 'xxx' --database-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_delete_database(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_instance_info(self): - cmd = """python ../../main.py xdata list-instance-info """ + def test_delete_table(self): + cmd = """python ../../main.py xdata delete-table --table-name 'xxx' --instance-name 'xxx' --database-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -149,8 +149,8 @@ def test_cancel_py_spark_job(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_list_table_info(self): - cmd = """python ../../main.py xdata list-table-info --instance-name 'xxx' --database-name 'xxx'""" + def test_list_database_info(self): + cmd = """python ../../main.py xdata list-database-info --instance-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -158,8 +158,8 @@ def test_list_table_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_table(self): - cmd = """python ../../main.py xdata create-table --instance-name 'xxx' --db-model-dbtable '{"":""}'""" + def test_get_database_info(self): + cmd = """python ../../main.py xdata get-database-info --database-name 'xxx' --instance-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -167,8 +167,8 @@ def test_create_table(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_get_table_info(self): - cmd = """python ../../main.py xdata get-table-info --table-name 'xxx' --instance-name 'xxx' --database-name 'xxx'""" + def test_create_database(self): + cmd = """python ../../main.py xdata create-database --database-name 'xxx' --instance-name 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -176,8 +176,8 @@ def test_get_table_info(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_table(self): - cmd = """python ../../main.py xdata delete-table --table-name 'xxx' --instance-name 'xxx' --database-name 'xxx'""" + def test_delete_database(self): + cmd = """python ../../main.py xdata delete-database --database-name 'xxx' --instance-name 'xxx'""" with os.popen(cmd) as f: content = f.read() diff --git a/testcases/generated/yunding_test.py b/testcases/generated/yunding_test.py index 446bc30..5f7eade 100644 --- a/testcases/generated/yunding_test.py +++ b/testcases/generated/yunding_test.py @@ -23,6 +23,60 @@ class YundingTest(unittest.TestCase): + def test_put_product_metric_data(self): + cmd = """python ../../main.py yunding put-product-metric-data --app-code 'xxx' --service-code 'xxx' --region 'xxx' --resource-id 'xxx' --data-points '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_put_product_metric_data(self): + cmd = """python ../../main.py yunding put-product-metric-data --app-code 'xxx' --service-code 'xxx' --region 'xxx' --resource-id 'xxx' --data-points '[{"":""}]'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_subnets(self): + cmd = """python ../../main.py yunding describe-subnets """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_subnet(self): + cmd = """python ../../main.py yunding create-subnet --vpc-id 'xxx' --subnet-name 'xxx' --address-prefix 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_subnet(self): + cmd = """python ../../main.py yunding describe-subnet --subnet-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_subnet(self): + cmd = """python ../../main.py yunding delete-subnet --subnet-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_assign_secondary_ips(self): cmd = """python ../../main.py yunding assign-secondary-ips --network-interface-id 'xxx'""" with os.popen(cmd) as f: @@ -41,6 +95,51 @@ def test_unassign_secondary_ips(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_describe_network_interface(self): + cmd = """python ../../main.py yunding describe-network-interface --network-interface-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_delete_network_interface(self): + cmd = """python ../../main.py yunding delete-network-interface --network-interface-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_network_interfaces(self): + cmd = """python ../../main.py yunding describe-network-interfaces """ + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_create_network_interface(self): + cmd = """python ../../main.py yunding create-network-interface --subnet-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + + def test_describe_tasks(self): + cmd = """python ../../main.py yunding describe-tasks --instance-id 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_rds_instances(self): cmd = """python ../../main.py yunding describe-rds-instances """ with os.popen(cmd) as f: @@ -122,6 +221,15 @@ def test_grant_rds_privilege(self): result = json.loads(content) self.assertIsInstance(result, dict) + def test_revoke_privilege(self): + cmd = """python ../../main.py yunding revoke-privilege --instance-id 'xxx' --account-name 'xxx'""" + with os.popen(cmd) as f: + content = f.read() + + print(content) + result = json.loads(content) + self.assertIsInstance(result, dict) + def test_describe_rds_databases(self): cmd = """python ../../main.py yunding describe-rds-databases --instance-id 'xxx'""" with os.popen(cmd) as f: diff --git a/testcases/generated/zfs_test.py b/testcases/generated/zfs_test.py index 2e82886..a1f0929 100644 --- a/testcases/generated/zfs_test.py +++ b/testcases/generated/zfs_test.py @@ -23,8 +23,8 @@ class ZfsTest(unittest.TestCase): - def test_describe_file_systems(self): - cmd = """python ../../main.py zfs describe-file-systems """ + def test_describe_mount_targets(self): + cmd = """python ../../main.py zfs describe-mount-targets """ with os.popen(cmd) as f: content = f.read() @@ -32,8 +32,8 @@ def test_describe_file_systems(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_file_system(self): - cmd = """python ../../main.py zfs create-file-system --name 'xxx' --description 'xxx' --client-token 'xxx'""" + def test_create_mount_target(self): + cmd = """python ../../main.py zfs create-mount-target --file-system-id 'xxx' --subnet-id 'xxx' --vpc-id 'xxx' --client-token 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -41,8 +41,8 @@ def test_create_file_system(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_file_system(self): - cmd = """python ../../main.py zfs describe-file-system --file-system-id 'xxx'""" + def test_describe_mount_target(self): + cmd = """python ../../main.py zfs describe-mount-target --mount-target-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -50,8 +50,8 @@ def test_describe_file_system(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_modify_file_system_attribute(self): - cmd = """python ../../main.py zfs modify-file-system-attribute --file-system-id 'xxx'""" + def test_delete_mount_target(self): + cmd = """python ../../main.py zfs delete-mount-target --mount-target-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -59,8 +59,8 @@ def test_modify_file_system_attribute(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_file_system(self): - cmd = """python ../../main.py zfs delete-file-system --file-system-id 'xxx'""" + def test_describe_file_systems(self): + cmd = """python ../../main.py zfs describe-file-systems """ with os.popen(cmd) as f: content = f.read() @@ -68,8 +68,8 @@ def test_delete_file_system(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_mount_targets(self): - cmd = """python ../../main.py zfs describe-mount-targets """ + def test_create_file_system(self): + cmd = """python ../../main.py zfs create-file-system --name 'xxx' --description 'xxx' --client-token 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -77,8 +77,8 @@ def test_describe_mount_targets(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_create_mount_target(self): - cmd = """python ../../main.py zfs create-mount-target --file-system-id 'xxx' --subnet-id 'xxx' --vpc-id 'xxx' --client-token 'xxx'""" + def test_describe_file_system(self): + cmd = """python ../../main.py zfs describe-file-system --file-system-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -86,8 +86,8 @@ def test_create_mount_target(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_describe_mount_target(self): - cmd = """python ../../main.py zfs describe-mount-target --mount-target-id 'xxx'""" + def test_modify_file_system_attribute(self): + cmd = """python ../../main.py zfs modify-file-system-attribute --file-system-id 'xxx'""" with os.popen(cmd) as f: content = f.read() @@ -95,8 +95,8 @@ def test_describe_mount_target(self): result = json.loads(content) self.assertIsInstance(result, dict) - def test_delete_mount_target(self): - cmd = """python ../../main.py zfs delete-mount-target --mount-target-id 'xxx'""" + def test_delete_file_system(self): + cmd = """python ../../main.py zfs delete-file-system --file-system-id 'xxx'""" with os.popen(cmd) as f: content = f.read()