Skip to content

Commit

Permalink
[update]更新查询条件返回, 资源配置
Browse files Browse the repository at this point in the history
  • Loading branch information
comprel committed May 7, 2021
1 parent 9547589 commit a4533b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/api/apibase_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ def run_query(self, rid, region, zone,
data=out_data)

x_json = self.reverse_asset_object(provider=provider_object["name"], data=x_json)
x_json.update(query_data)

if x_json.get("instance_type"):
instance_type, resource_info = InstanceTypeObject().convert_asset(provider=provider_object["name"],
Expand Down
2 changes: 1 addition & 1 deletion doc/update.sql
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ UPDATE terraform.resource SET provider='alicloud', resource_type='instance', re
UPDATE terraform.resource SET provider='tencentcloud', resource_type='instance', resource_name='tencentcloud_instance', extend_info='{"tags": {"type": "json"}}', resource_property='{"charge_type": "instance_charge_type", "password": {"convert": "password", "allow_null": 0, "type": "string"}, "disk_size": {"convert": "system_disk_size", "allow_null": 0, "type": "string"}, "name": {"convert": "instance_name", "allow_null": 0, "type": "string"}, "zone": {"convert": "availability_zone", "allow_null": 0, "type": "string"}, "subnet_id": {"convert": "subnet_id", "allow_null": 0, "type": "string"}, "force_delete": {"convert": "force_delete", "allow_null": 1, "type": "bool"}, "image": {"convert": "image_id", "allow_null": 0, "type": "string"}, "hostname": {"convert": "hostname", "allow_null": 0, "type": "string"}, "security_group_id": {"convert": "security_groups", "allow_null": 1, "type": "list"}, "instance_type": {"convert": "instance_type", "allow_null": 0, "type": "string"}, "vpc_id": {"convert": "vpc_id", "allow_null": 0, "type": "string"}, "disk_type": {"convert": "system_disk_type", "allow_null": 0, "type": "string"}, "power_action": {"convert": "running_flag", "allow_null": 1, "type": "bool"}, "data_disks": {"convert": "data_disks", "allow_null": 1, "type": "json"}, "internet_charge_type": "internet_charge_type"}', resource_output='{"public_ip": "public_ip", "ipaddress": "private_ip", "resource_id": "id"}', data_source_name='tencentcloud_instances', data_source_argument='instance_list', data_source='{"zone": "availability_zone", "resource_id": "instance_id", "subnet_id": "subnet_id", "public_ip": "-", "image_id": "-", "tag": "tags", "vpc_id": "vpc_id", "ipaddress": "-"}', data_source_output='{"charge_type": "instance_charge_type", "password": {"convert": "password", "allow_null": 0, "type": "string"}, "disk_size": {"convert": "system_disk_size", "allow_null": 0, "type": "string"}, "name": {"convert": "instance_name", "allow_null": 0, "type": "string"}, "zone": {"convert": "availability_zone", "allow_null": 0, "type": "string"}, "resource_id": "instance_id", "subnet_id": {"convert": "subnet_id", "allow_null": 0, "type": "string"}, "force_delete": {"convert": "force_delete", "allow_null": 1, "type": "bool"}, "image": {"convert": "image_id", "allow_null": 0, "type": "string"}, "hostname": {"convert": "hostname", "allow_null": 0, "type": "string"}, "security_group_id": {"convert": "security_groups", "allow_null": 1, "type": "list"}, "public_ip": "public_ip", "instance_type": {"convert": "instance_type", "allow_null": 0, "type": "string"}, "power_action": {"convert": "running_flag", "allow_null": 1, "type": "bool"}, "vpc_id": {"convert": "vpc_id", "allow_null": 0, "type": "string"}, "disk_type": {"convert": "system_disk_type", "allow_null": 0, "type": "string"}, "ipaddress": "private_ip", "data_disks": {"convert": "data_disks", "allow_null": 1, "type": "json"}, "internet_charge_type": "internet_charge_type"}' WHERE id='cd96fd53ee8b421fa8549103abe2d5e6';
UPDATE terraform.resource SET provider='alicloud', resource_type='mysql_database', resource_name='alicloud_db_database', extend_info='{"description": "from terraform"}', resource_property='{"mysql_id": {"convert": "instance_id", "allow_null": 0, "type": "string"}, "name": {"convert": "name", "allow_null": 0, "type": "string"}}', resource_output='{"resource_id": "id"}', data_source_name='', data_source_argument='', data_source='{}', data_source_output='{}' WHERE id='ce87aefd26f243f2b4e0fbee4823d1b9';
UPDATE terraform.resource SET provider='tencentcloud', resource_type='lb', resource_name='tencentcloud_clb_instance', extend_info='{"tags": {"type": "json"}}', resource_property='{"subnet_id": {"convert": "subnet_id", "allow_null": 0, "type": "string"}, "vpc_id": {"convert": "vpc_id", "allow_null": 1, "type": "string"}, "network_type": {"default": "INTERNAL", "convert": "network_type", "allow_null": 1, "type": "string"}, "name": {"convert": "clb_name", "allow_null": 0, "type": "string"}, "charge_type": "internet_charge_type"}', resource_output='{"ipaddress": "clb_vips", "resource_id": "id"}', data_source_name='tencentcloud_clb_instances', data_source_argument='clb_list', data_source='{"name": "clb_name", "resource_id": "clb_id", "subnet_id": "-", "tag": "-", "vpc_id": "-", "ipaddress": "-"}', data_source_output='{"charge_type": {"default": "TRAFFIC_POSTPAID_BY_HOUR", "convert": "internet_charge_type", "allow_null": "0", "type": "string"}, "name": {"convert": "clb_name", "allow_null": 0, "type": "string"}, "resource_id": "clb_id", "subnet_id": {"convert": "subnet_id", "allow_null": 0, "type": "string"}, "vpc_id": {"convert": "vpc_id", "allow_null": 0, "type": "string"}, "ipaddress": "clb_vips", "network_type": {"default": "INTERNAL", "convert": "network_type", "allow_null": 1, "type": "string"}}' WHERE id='da1c168374ae4dbc9fabf889630355be';
UPDATE terraform.resource SET provider='tencentcloud', resource_type='nat', resource_name='tencentcloud_nat_gateway', extend_info='{}', resource_property='{"subnet_id": "-", "vpc_id": "vpc_id", "name": "name", "eip": {"convert": "assigned_eip_set", "type": "list"}}', resource_output='{"resource_id": "id"}', data_source_name='tencentcloud_nat_gateways', data_source_argument='nats', data_source='{"vpc_id": "vpc_id", "name": "name", "resource_id": "id"}', data_source_output='{"subnet_id": "-", "vpc_id": "vpc_id", "name": "name", "eip": {"convert": "assigned_eip_set", "type": "list"}, "resource_id": "id"}' WHERE id='dc961b78fdc2483880c504c77042af96';
UPDATE terraform.resource SET provider='tencentcloud', resource_type='nat', resource_name='tencentcloud_nat_gateway', extend_info='{}', resource_property='{"subnet_id": "-", "vpc_id": "vpc_id", "bandwidth": {"convert": "bandwidth", "allow_null": 1, "type": "int"}, "name": "name", "eip": {"convert": "assigned_eip_set", "allow_null": 1, "type": "list"}}', resource_output='{"resource_id": "id"}', data_source_name='tencentcloud_nat_gateways', data_source_argument='nats', data_source='{"vpc_id": "vpc_id", "name": "name", "resource_id": "id"}', data_source_output='{"eip": {"convert": "assigned_eip_set", "allow_null": 1, "type": "list"}, "name": "name", "resource_id": "id", "subnet_id": "-", "bandwidth": {"convert": "bandwidth", "allow_null": 1, "type": "string"}, "vpc_id": "vpc_id"}' WHERE id='dc961b78fdc2483880c504c77042af96';
UPDATE terraform.resource SET provider='tencentcloud', resource_type='network_interface', resource_name='tencentcloud_eni', extend_info='{"ipv4_count": 1, "description": "create from terraform"}', resource_property='{"subnet_id": {"convert": "subnet_id", "allow_null": 0, "type": "string"}, "vpc_id": {"convert": "vpc_id", "allow_null": 0, "type": "string"}, "ipaddress": {"convert": "ipv4s", "allow_null": 1, "type": "string"}, "name": {"convert": "name", "allow_null": 0, "type": "string"}, "security_group_id": {"convert": "storage_id", "allow_null": 1, "type": "list"}}', resource_output='{"ipaddress": "ipv4_info.0.ip", "resource_id": "id"}', data_source_name='tencentcloud_enis', data_source_argument='enis', data_source='{"name": "name", "resource_id": {"convert": "ids", "type": "list"}, "subnet_id": "subnet_id", "public_ip": "-", "tag": "tags", "vpc_id": "vpc_id", "ipaddress": "-"}', data_source_output='{"name": {"convert": "name", "allow_null": 0, "type": "string"}, "resource_id": "id", "subnet_id": {"convert": "subnet_id", "allow_null": 0, "type": "string"}, "security_group_id": {"convert": "storage_id", "allow_null": 1, "type": "list"}, "vpc_id": {"convert": "vpc_id", "allow_null": 0, "type": "string"}, "ipaddress": {"convert": "ipv4s", "allow_null": 1, "type": "string"}}' WHERE id='dd15c84a54434f6685b9ae560b9121c2';
UPDATE terraform.resource SET provider='tencentcloud', resource_type='lb_listener', resource_name='tencentcloud_clb_listener', extend_info='{}', resource_property='{"health_check": {"convert": "health_check_switch", "allow_null": 1, "type": "bool"}, "protocol": {"default": "HTTP", "convert": "protocol", "allow_null": 1, "type": "string"}, "name": {"convert": "listener_name", "allow_null": 0, "type": "string"}, "health_check_uri": {"convert": "health_check_http_path", "allow_null": 1, "type": "string"}, "lb_id": {"convert": "clb_id", "allow_null": 0, "type": "string"}, "port": {"convert": "port", "allow_null": 0, "type": "int"}, "backend_port": "-"}', resource_output='{"resource_id": "listener_id"}', data_source_name='', data_source_argument='', data_source='{}', data_source_output='{}' WHERE id='dff77ee8e0794c07bcde4eb6df88ba9e';
UPDATE terraform.resource SET provider='tencentcloud', resource_type='ccn_attach', resource_name='tencentcloud_ccn_attachment', extend_info='{}', resource_property='{"instance_id": {"convert": "instance_id", "allow_null": 0, "type": "string"}, "instance_type": {"default": "VPC", "convert": "instance_type", "allow_null": 1, "type": "string"}, "ccn_id": {"convert": "ccn_id", "allow_null": 0, "type": "string"}, "instance_region": {"convert": "instance_region", "allow_null": 0, "type": "string"}}', resource_output='{"resource_id": "id"}', data_source_name='', data_source_argument='', data_source='{}', data_source_output='{}' WHERE id='e43bbc476ee946faa1bc1cd845ef33d4';
Expand Down

0 comments on commit a4533b6

Please sign in to comment.